# HG changeset patch # User koba # Date 1296129930 -32400 # Node ID 3acdeb3dc3e877bf3b0a09068d8c8d74030303f8 # Parent b31bed246abd8566cce040b106245c9bed08e439 collision use global_alloc (not work) diff -r b31bed246abd -r 3acdeb3dc3e8 Character.h --- a/Character.h Tue Jan 25 17:43:30 2011 +0900 +++ b/Character.h Thu Jan 27 21:05:30 2011 +0900 @@ -43,6 +43,7 @@ BOOL f; //apiarance idenfifier float s; //int group; + int chara_id; int task; diff -r b31bed246abd -r 3acdeb3dc3e8 StateList.c --- a/StateList.c Tue Jan 25 17:43:30 2011 +0900 +++ b/StateList.c Thu Jan 27 21:05:30 2011 +0900 @@ -27,6 +27,7 @@ initStateList() { SetTaskState(DELETE_CHARA, delete_chara, "delete_chara"); + SetTaskState(STATE0, chara_state0, "chara_state0"); SetTaskState(STATE1, chara_state1, "chara_state1"); SetTaskState(STATE2, chara_state2, "chara_state2"); diff -r b31bed246abd -r 3acdeb3dc3e8 TaskDandy.cc --- a/TaskDandy.cc Tue Jan 25 17:43:30 2011 +0900 +++ b/TaskDandy.cc Thu Jan 27 21:05:30 2011 +0900 @@ -30,6 +30,7 @@ #include "Character.h" #include "Character_state.h" #include "property.h" +#include "collision_task.h" #include "StateList.h" #include "Cheat.h" #include "debug_db.h" @@ -289,6 +290,7 @@ __debug("finished init_chara_list\n"); initStateList(); + collision_allocate(); return 1; } @@ -352,7 +354,13 @@ outofwindow(); // timeprof_end(timeprof_move); state_update(); + + HTaskPtr update = collision_update(); + HTaskPtr reflect = collision_reflect(); collision_detect(); + update->spawn(); + reflect->spawn(); + //charpatern(); //bosguage(); @@ -384,8 +392,9 @@ } SDL_Event usr_event; usr_event.type = SDL_QUIT; + SDL_PushEvent(&usr_event); - SDL_PushEvent(&usr_event); + collision_free(); //_______________________________________________ // SDL_mixerの後始末 diff -r b31bed246abd -r 3acdeb3dc3e8 collision_task.cc --- a/collision_task.cc Tue Jan 25 17:43:30 2011 +0900 +++ b/collision_task.cc Thu Jan 27 21:05:30 2011 +0900 @@ -1,107 +1,140 @@ #include #include #include -#include "SDL_opengl.h" +#include "Func.h" +#include "TaskManager.h" +#include "collision_task.h" #include "Character.h" +#include "count2.h" #include "tokuten.h" -#include "bom.h" -#include "count2.h" #include "object.h" #include "sgoex.h" -#include "TaskManager.h" -#include "Func.h" -#include "ObjectType.h" + #include "property.h" extern SpriteTable sptable[DEFOBJ]; extern TaskManager *tmanager; +HTaskPtr update_task; +HTaskPtr reflect_task; + static CollisionPropertyPtr -get_property(CHARACTER *p) +get_property() { CollisionPropertyPtr property = (CollisionPropertyPtr)tmanager->allocate(sizeof(CollisionProperty)); - property->collision_type = NO; - property->enemycount = 0; + property->infg_level = infg_level; + + property->tama_lv1_end = tama_lv1_end; + property->tama_lv2_end = tama_lv2_end; + property->laser_lv1_end = laser_lv1_end; + + property->enemycount = enemycount; + + property->jiki = jiki; + + property->lg = lg; + property->infg = infg; + + memcpy(property->tama_lv1, tama_lv1, sizeof(tama1)*20); + memcpy(property->tama_lv2, tama_lv2, sizeof(tama2)*20); property->tlv3 = tlv3[0]; + memcpy(property->laser_lv1, laser_lv1, sizeof(laser)*20); property->laser_lv2 = laser_lv2[0]; - property->p = *p; - - memcpy(property->tama_lv1, tama_lv1, sizeof(tama1)*(tama_lv1_end+1)); - memcpy(property->tama_lv2, tama_lv2, sizeof(tama2)*(tama_lv2_end+1)); - memcpy(property->laser_lv1, laser_lv1, sizeof(laser)*(laser_lv1_end+1)); memcpy(property->laser_lv3, laser_lv3, sizeof(laser)*128); return property; } -static void -check_collision() -{ - -} - void -free_property(SchedTask *s, void *prop, void *obj) +reflect_property(SchedTask *s, void *prop, void *none) { CollisionPropertyPtr property = (CollisionPropertyPtr)prop; - switch(property->collision_type) { - check_collision(); + infg_level = property->infg_level; + + tama_lv1_end = property->tama_lv1_end; + tama_lv2_end = property->tama_lv2_end; + laser_lv1_end = property->laser_lv1_end; + + enemycount = property->enemycount; + + jiki = property->jiki; + + lg = property->lg; + infg = property->infg; - case JIKI: - jiki.bf = property->jiki.bf; - jiki.zanki = property->jiki.zanki; - jiki.muteki = property->jiki.muteki; - infg = property->infg; - infg_level = property->infg_level; - break; + memcpy(tama_lv1, property->tama_lv1, sizeof(tama1)*20); + memcpy(tama_lv2, property->tama_lv2, sizeof(tama2)*20); + tlv3[0] = property->tlv3; + memcpy(laser_lv1, property->laser_lv1, sizeof(laser)*20); + laser_lv2[0] = property->laser_lv2; + memcpy(laser_lv3, property->laser_lv3, sizeof(laser)*128); +} + +void +after_free(SchedTask *s, void *object, void *none) +{ + free(object); +} + + +void +collision_allocate() +{ + HTaskPtr alloc_task = tmanager->create_task(DataAllocate); + + alloc_task->set_param(0, (memaddr)1); + alloc_task->set_param(1, (memaddr)sizeof(CollisionProperty)); + alloc_task->set_param(2, (memaddr)COLLDATA); + + alloc_task->set_cpu(SPE_0); + alloc_task->spawn(); +} - case TAMALV1: - infg = property->infg; - memcpy(tama_lv1, property->tama_lv1, sizeof(tama1)*(tama_lv1_end+1)); - break; - - case TAMALV2: - infg = property->infg; - memcpy(tama_lv2, property->tama_lv2, sizeof(tama2)*(tama_lv2_end+1)); - break; - - case TAMALV3: - infg = property->infg; - break; - - case LASERLV1: - infg = property->infg; - memcpy(laser_lv1, property->laser_lv1, sizeof(laser)*laser_lv1_end+1); - break; +HTaskPtr +collision_update() +{ + update_task = tmanager->create_task(DataUpdate); + CollisionPropertyPtr property = get_property(); + + update_task->set_param(0, (memaddr)1); + update_task->set_param(1, (memaddr)COLLDATA); + + update_task->set_inData(0, property, sizeof(CollisionProperty)); + + update_task->set_post(after_free, (void*)property, NULL); + update_task->set_cpu(SPE_0); + + return update_task; +} - case LASERLV2: - lg.stg -= 26; - infg = property->infg; - break; - - case LASERLV3: - infg = property->infg; +HTaskPtr +collision_reflect() +{ + reflect_task = tmanager->create_task(COLLDATA_REFLECT); + CollisionPropertyPtr property = (CollisionPropertyPtr)tmanager->allocate(sizeof(CollisionProperty)); - break; + reflect_task->set_param(0, (memaddr)COLLDATA); + + reflect_task->set_outData(0, property, sizeof(CollisionProperty)); + + reflect_task->set_post(reflect_property, (void*)property, NULL); + reflect_task->set_cpu(SPE_0); - default: - break; - } + return reflect_task; +} - ObjContainer *new_obj = (ObjContainerPtr)obj; - - if (new_obj->flag == true){ - ObjDataPtr obj_data = new_obj->data; - Bom(obj_data->x, obj_data->y); +void +collision_free() +{ + HTaskPtr free_task = tmanager->create_task(DataFree); - enemycount += property->enemycount; - } + free_task->set_param(0, (memaddr)COLLDATA); - free(new_obj); - free(prop); + free_task->set_cpu(SPE_0); + free_task->spawn(); } @@ -109,7 +142,6 @@ atari(CHARACTER *p) { int w, h, charno; - CollisionPropertyPtr property = get_property(p); charno = p->charano; w = sptable[charno].w; @@ -124,21 +156,19 @@ collision_task->set_param(0,(memaddr)w); collision_task->set_param(1,(memaddr)h); + collision_task->set_param(2, (memaddr)COLLDATA); - collision_task->set_inData(0, property, sizeof(CollisionProperty)); - collision_task->set_inData(1, &jiki, sizeof(player)); - collision_task->set_inData(2, &lg, sizeof(stge)); - collision_task->set_inData(3, &infg, sizeof(stge)); - collision_task->set_inData(4, &infg_level, sizeof(int)); - collision_task->set_inData(5, &tama_lv1_end, sizeof(int)); - collision_task->set_inData(6, &tama_lv2_end, sizeof(int)); - collision_task->set_inData(7, &laser_lv1_end, sizeof(int)); + collision_task->set_inData(0, p, sizeof(player)); - collision_task->set_outData(0, property, sizeof(CollisionProperty)); + collision_task->set_outData(0, p, sizeof(player)); collision_task->set_outData(1, obj, sizeof(ObjContainer)); - collision_task->set_post(free_property, (void*)property, (void*)obj); - collision_task->set_cpu(SPE_ANY); + collision_task->set_post(after_free, (void*)obj, NULL); + collision_task->set_cpu(SPE_0); + + collision_task->wait_for(update_task); + reflect_task->wait_for(collision_task); + collision_task->spawn(); return p; diff -r b31bed246abd -r 3acdeb3dc3e8 game_task.h --- a/game_task.h Tue Jan 25 17:43:30 2011 +0900 +++ b/game_task.h Thu Jan 27 21:05:30 2011 +0900 @@ -1,7 +1,10 @@ // Game で使用する Task ID + + DELETE_CHARA, + ATARI, - NO_ACT, - DELETE_CHARA, + COLLDATA_REFLECT, + STATE0, STATE1, STATE2, diff -r b31bed246abd -r 3acdeb3dc3e8 global_id.h --- a/global_id.h Tue Jan 25 17:43:30 2011 +0900 +++ b/global_id.h Thu Jan 27 21:05:30 2011 +0900 @@ -1,1 +1,3 @@ // global_alloc で使用する ID + + COLLDATA, diff -r b31bed246abd -r 3acdeb3dc3e8 ppe/Atari.cc --- a/ppe/Atari.cc Tue Jan 25 17:43:30 2011 +0900 +++ b/ppe/Atari.cc Thu Jan 27 21:05:30 2011 +0900 @@ -9,27 +9,29 @@ { int w = (int)smanager->get_param(0); int h = (int)smanager->get_param(1); + long load_id = (long)smanager->get_param(2); - CollisionPropertyPtr property - = (CollisionPropertyPtr)smanager->get_input(rbuf, 0); - player *jiki = (player*)smanager->get_input(rbuf, 1); + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + CollisionPropertyPtr property = + (CollisionPropertyPtr)smanager->global_get(load_id); + + int *p_infg_level = &property->infg_level; + int infg_level = *p_infg_level; - property->lg = *(stge*)smanager->get_input(rbuf, 2); - property->infg = *(stge*)smanager->get_input(rbuf, 3); + int tama_lv1_end = property->tama_lv1_end; + int tama_lv2_end = property->tama_lv2_end; + int laser_lv1_end = property->laser_lv1_end; + + int *enemycount = &property->enemycount; + + player *jiki = &property->jiki; + stge *lg = &property->lg; stge *infg = &property->infg; - int infg_level = *(int*)smanager->get_input(rbuf, 4); - int tama_lv1_end = *(int*)smanager->get_input(rbuf, 5); - int tama_lv2_end = *(int*)smanager->get_input(rbuf, 6); - int laser_lv1_end = *(int*)smanager->get_input(rbuf, 7); - - CHARACTER *p = &property->p; - int *enemycount = &property->enemycount; - tama1 *tlv3 = &property->tlv3; - tama1 *tama_lv1 = property->tama_lv1; tama2 *tama_lv2 = property->tama_lv2; + tama1 *tlv3 = &property->tlv3; laser *laser_lv1 = property->laser_lv1; laser *laser_lv2 = &property->laser_lv2; laser *laser_lv3 = property->laser_lv3; @@ -39,8 +41,7 @@ ex = p->x; ey = p->y; - CollisionPropertyPtr w_property - = (CollisionPropertyPtr)smanager->get_output(wbuf, 0); + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1); sprite->flag = false; sprite->length = 1; @@ -54,8 +55,6 @@ sprite->flag = true; Bom(jiki->x + 16, jiki->y + 16, &sprite->data[0]); - property->collision_type = JIKI; - jiki->bf = FALSE; jiki->zanki--; jiki->muteki = 120; @@ -66,9 +65,8 @@ if (infg_level < 0) infg_level = 0; - property->infg_level = infg_level; - - *w_property = *property; + *p_infg_level = infg_level; + *q = *p; return 0; } #endif @@ -81,7 +79,6 @@ && (ex + w > tama_lv1[i1].x + 16) && (tama_lv1[i1].y + 128 > ey) && (tama_lv1[i1].y < ey + h) && (tama_lv1[i1].r != -1)) { - property->collision_type = TAMALV1; tama_lv1[i1].r = -1; p->vit -= TAMALV1P; @@ -91,18 +88,17 @@ sprite->flag = true; Bom(p->x, p->y, &sprite->data[0]); *enemycount += (p->score * - ((infg->stg / 128) + infg_level + 1)); + ((infg->stg / 128) + infg_level + 1)); p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } if ((tama_lv1[i1].x + 64 > ex) && (ex + w > tama_lv1[i1].x) && (tama_lv1[i1].y + 128 > ey) && (tama_lv1[i1].y < ey + h) && (tama_lv1[i1].l != -1)) { - property->collision_type = TAMALV1; tama_lv1[i1].l = -1; p->vit -= TAMALV1P; @@ -116,7 +112,7 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } @@ -127,7 +123,6 @@ && (ex + w > tama_lv2[i1].x + 128) && (tama_lv2[i1].y + 192 > ey) && (tama_lv2[i1].y < ey + h) && (tama_lv2[i1].rr != -1)) { - property->collision_type = TAMALV2; tama_lv2[i1].rr = -1; p->vit -= TAMALV2P; @@ -141,7 +136,7 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } @@ -151,7 +146,6 @@ && (tama_lv2[i1].y - 32 + 192 > ey) && (tama_lv2[i1].y - 32 < ey + h) && (tama_lv2[i1].sr != -1)) { - property->collision_type = TAMALV2; tama_lv2[i1].sr = -1; p->vit -= TAMALV2P; @@ -165,7 +159,7 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } @@ -173,7 +167,6 @@ && (tama_lv2[i1].y - 32 + 192 > ey) && (tama_lv2[i1].y - 32 < ey + h) && (tama_lv2[i1].sl != -1)) { - property->collision_type = TAMALV2; tama_lv2[i1].sl = -1; p->vit -= TAMALV2P; @@ -187,7 +180,7 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } @@ -195,7 +188,6 @@ && (ex + w > tama_lv2[i1].x - 64) && (tama_lv2[i1].y + 192 > ey) && (tama_lv2[i1].y < ey + h) && (tama_lv2[i1].ll != -1)) { - property->collision_type = TAMALV2; tama_lv2[i1].ll = -1; p->vit -= TAMALV2P; @@ -209,14 +201,13 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } } if ((tlv3->r > 0) && (jiki->x < ex + w) && (jiki->x + 128 > ex) && (jiki->y > ey + h)) { - property->collision_type = TAMALV3; p->vit -= TAMALV3P; infg->stg++; @@ -229,14 +220,13 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } jumping: if ((tlv3->r > 0) && (jiki->x < ex + w) && (jiki->x + 128 > ex) && (jiki->y + 128 > ey) && (jiki->y < ey + h)) { - property->collision_type = TAMALV3; p->vit -= TAMALV3P; infg->stg++; @@ -249,7 +239,7 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } @@ -260,7 +250,6 @@ if ((laser_lv1[i1].x + n > ex) && (ex + w > laser_lv1[i1].x) && (laser_lv1[i1].y + n > ey) && (laser_lv1[i1].y < ey + h) && (laser_lv1[i1].r != -1)) { - property->collision_type = LASERLV1; laser_lv1[i1].r = -1; laser_lv1[i1].y = -1; @@ -275,7 +264,7 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } @@ -285,7 +274,6 @@ (laser_lv2[0].x + 128 > ex) && (ex + w > laser_lv2[0].x - 128) && (laser_lv2[0].y + 128 > ey) && (laser_lv2[0].y - 128 < ey + h) && (laser_lv2[0].r != 0)) { - property->collision_type = LASERLV2; p->vit -= LASERLV2P; lg->stg -= 26; @@ -302,7 +290,7 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } @@ -313,7 +301,6 @@ && (laser_lv3[i1].y + 128 > ey) && (laser_lv3[i1].y < ey + h) && (laser_lv3[i1].r > 0)) { - property->collision_type = LASERLV3; tama_lv2[i1].rr = -1; p->vit -= LASERLV3P; @@ -327,15 +314,13 @@ p->task = DELETE_CHARA; p->f = FALSE; - *w_property = *property; + *q = *p; return 0; } } } } - property->collision_type = NO; - - *w_property = *property; + *q = *p; return 0; } diff -r b31bed246abd -r 3acdeb3dc3e8 ppe/task_init.cc --- a/ppe/task_init.cc Tue Jan 25 17:43:30 2011 +0900 +++ b/ppe/task_init.cc Thu Jan 27 21:05:30 2011 +0900 @@ -4,6 +4,8 @@ /* 必ずこの位置に書いて */ SchedExternTask(Atari); +SchedExternTask(CollDataReflect); + SchedExternTask(State0); SchedExternTask(State1); SchedExternTask(State2); @@ -62,6 +64,8 @@ { SchedRegisterTask(ATARI, Atari); + SchedRegisterTask(COLLDATA_REFLECT, CollDataReflect); + SchedRegisterTask(STATE0, State0); SchedRegisterTask(STATE1, State1); SchedRegisterTask(STATE2, State2); diff -r b31bed246abd -r 3acdeb3dc3e8 ppe/task_object.h --- a/ppe/task_object.h Tue Jan 25 17:43:30 2011 +0900 +++ b/ppe/task_object.h Thu Jan 27 21:05:30 2011 +0900 @@ -101,21 +101,26 @@ typedef struct CollisionProperty { - int collision_type; int infg_level; + + int tama_lv1_end; + int tama_lv2_end; + int laser_lv1_end; + int enemycount; + + player jiki; - CHARACTER p; - player jiki; stge lg; stge infg; - + tama1 tama_lv1[20]; tama2 tama_lv2[20]; tama1 tlv3; laser laser_lv1[20]; laser laser_lv2; laser laser_lv3[128]; + } CollisionProperty, *CollisionPropertyPtr; diff -r b31bed246abd -r 3acdeb3dc3e8 property.h --- a/property.h Tue Jan 25 17:43:30 2011 +0900 +++ b/property.h Thu Jan 27 21:05:30 2011 +0900 @@ -2,12 +2,16 @@ #define INCLUDE_PROPERTY typedef struct CollisionProperty { - int collision_type; int infg_level; + + int tama_lv1_end; + int tama_lv2_end; + int laser_lv1_end; + int enemycount; - CHARACTER p; player jiki; + stge lg; stge infg; diff -r b31bed246abd -r 3acdeb3dc3e8 state_task.cc --- a/state_task.cc Tue Jan 25 17:43:30 2011 +0900 +++ b/state_task.cc Thu Jan 27 21:05:30 2011 +0900 @@ -37,23 +37,27 @@ int rinky = 0; int rinkf1 = 0, rinkf2 = 0; CHARACTER *asteroiddt[200]; -int asteroidi = 0; + int enemyfaste = 0; int fastebos = 0; +int asteroidi = 0; -int counter = 0; +static int cpu_counter = SPE_1; /* output 0~3 */ -static -int get_num() +static CPU_TYPE +get_cpunum() { - counter++; - counter %= 4; - return counter; + cpu_counter += 1; + if ((cpu_counter % SPE_5) == 0) { + cpu_counter = SPE_1; + } + + return (CPU_TYPE)cpu_counter; } -static -int power_of_two(int input) +static int +power_of_two(int input) { int value = 1; @@ -171,12 +175,13 @@ state_task->set_outData(0, p, sizeof(CHARACTER)); state_task->set_post(updateState, (void*)p, NULL); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; } +static int myrand = 1; CHARACTER* FixRandomTask(CHARACTER *p) @@ -184,14 +189,14 @@ int task_num = p->task; HTaskPtr state_task = tmanager->create_task(task_num); - state_task->set_param(0, (memaddr)get_num()); + state_task->set_param(0, (memaddr)myrand); state_task->set_inData(0, p, sizeof(CHARACTER)); state_task->set_outData(0, p, sizeof(CHARACTER)); state_task->set_post(PrintCoordinate, (void*)p, NULL); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -210,7 +215,7 @@ state_task->set_outData(0, p, sizeof(CHARACTER)); state_task->set_post(updateState, (void*)p, NULL); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -233,7 +238,7 @@ state_task->set_outData(1, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -257,7 +262,7 @@ state_task->set_outData(1, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -289,7 +294,7 @@ } else { state_task->set_post(updateState, (void*)p, NULL); } - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); asteroidi++; @@ -315,7 +320,7 @@ state_task->set_outData(2, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -342,7 +347,7 @@ state_task->set_outData(4, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -364,7 +369,7 @@ state_task->set_outData(1, &rinkf1, sizeof(int)); state_task->set_post(updateState, (void*)p, NULL); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -391,7 +396,7 @@ state_task->set_outData(2, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -425,7 +430,7 @@ state_task->set_outData(6, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -456,7 +461,7 @@ state_task->set_outData(2, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -475,7 +480,7 @@ state_task->set_param(0, (memaddr)enemy_part1->f); state_task->set_param(1, (memaddr)enemy_part5->f); - state_task->set_param(2, (memaddr)get_num()); + state_task->set_param(2, (memaddr)myrand); state_task->set_inData(0, p, sizeof(CHARACTER)); state_task->set_inData(1, &count, sizeof(int)); @@ -489,7 +494,7 @@ state_task->set_outData(4, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -512,7 +517,7 @@ state_task->set_param(3, (memaddr)enemy_part4->f); state_task->set_param(4, (memaddr)enemystate[num1].charano); state_task->set_param(5, (memaddr)enemystate[num2].charano); - state_task->set_param(6, (memaddr)get_num()); + state_task->set_param(6, (memaddr)myrand); state_task->set_inData(0, p, sizeof(CHARACTER)); state_task->set_inData(1, kyeenemyno, sizeof(CHARACTER)); @@ -524,7 +529,7 @@ state_task->set_outData(2, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -543,7 +548,7 @@ obj->flag = false; obj->length = 0; - state_task->set_param(0, (memaddr)get_num()); + state_task->set_param(0, (memaddr)myrand); state_task->set_inData(0, p, sizeof(CHARACTER)); state_task->set_inData(1, &count, sizeof(int)); @@ -553,7 +558,7 @@ state_task->set_outData(2, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p; @@ -570,7 +575,7 @@ obj->flag = false; obj->length = 0; - state_task->set_param(0, (memaddr)get_num()); + state_task->set_param(0, (memaddr)myrand); state_task->set_inData(0, p, sizeof(CHARACTER)); state_task->set_inData(1, &jiki, sizeof(player)); @@ -579,7 +584,7 @@ state_task->set_outData(1, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); + state_task->set_cpu(get_cpunum()); state_task->spawn(); return p;