# HG changeset patch # User koba # Date 1297416030 -32400 # Node ID 07bc996c8e491ec5cbbfb11436ce2ce35db20211 # Parent 3c2fc35a6b55c9dddb56c80ba43123cae8a195a8 fix t_dandy on ps3. diff -r 3c2fc35a6b55 -r 07bc996c8e49 Character.c --- a/Character.c Wed Feb 09 00:52:27 2011 +0900 +++ b/Character.c Fri Feb 11 18:20:30 2011 +0900 @@ -18,12 +18,14 @@ #include "debug_db.h" #include "Func.h" #include "StateList.h" +#include "TaskManager.h" #define CHARACTER_MAX_POOL_SIZE 2048 CHARACTER *active_chara_list; CHARACTER *free_chara_list; +extern TaskManager* tmanager; extern DebugDB dtable[DEFOBJ]; const table enemystate[] = ENEMY_STATUS_TABLE; @@ -53,7 +55,7 @@ for(i = 0; iallocate(sizeof(CHARACTER)); q[i]->f = FALSE; q[i]->state = noaction; q[i]->dt1 = 0; @@ -70,7 +72,7 @@ } q[num-1]->next = NULL; - active_chara_list = (CHARACTER*)malloc(sizeof(CHARACTER)); + active_chara_list = (CHARACTER*)tmanager->allocate(sizeof(CHARACTER)); active_chara_list->f = FALSE; active_chara_list->state = noaction; active_chara_list->collision = noaction; diff -r 3c2fc35a6b55 -r 07bc996c8e49 Makefile --- a/Makefile Wed Feb 09 00:52:27 2011 +0900 +++ b/Makefile Fri Feb 11 18:20:30 2011 +0900 @@ -13,7 +13,7 @@ @$(MAKE) -f Makefile.mac t_dandy cell: - @$(MAKE) -f Makefile.ps3 t_dandy + @$(MAKE) -f Makefile.ps3 clean: @$(MAKE) -f Makefile.mac clean diff -r 3c2fc35a6b55 -r 07bc996c8e49 Makefile.def --- a/Makefile.def Wed Feb 09 00:52:27 2011 +0900 +++ b/Makefile.def Fri Feb 11 18:20:30 2011 +0900 @@ -7,7 +7,7 @@ ABIBIT = 32 ABI = -m$(ABIBIT) CC = g++ -OPT = -g +OPT = -O9 CFLAGS = -Wall $(OPT) $(ABI) diff -r 3c2fc35a6b55 -r 07bc996c8e49 Makefile.ps3 --- a/Makefile.ps3 Wed Feb 09 00:52:27 2011 +0900 +++ b/Makefile.ps3 Fri Feb 11 18:20:30 2011 +0900 @@ -13,7 +13,7 @@ TASK_SRCS = $(filter-out $(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) TASK_OBJS = $(TASK_SRCS:.cc=.o) -TARGET = dandy spe-main +TARGET = t_dandy spe-main OBJS = StateList.o Cheat.o Character.o Bom.o tokuten.o count2.o schedule3.o tama2.o syokika.o Ss.o sound.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o #collision.o state_task.o all: $(TARGET) @@ -39,8 +39,6 @@ dandy: $(OBJS) Dandy.o collision.o Character_state.o $(CC) $(ABI) -o $@ $? $(LIBS) -cell-dandy: t_dandy spe-main - t_dandy: $(OBJS) $(TASK_OBJS) TaskDandy.o collision_task.o state_task.o $(CC) $(ABI) -o $@ $? $(LIBS) diff -r 3c2fc35a6b55 -r 07bc996c8e49 state_task.cc --- a/state_task.cc Wed Feb 09 00:52:27 2011 +0900 +++ b/state_task.cc Fri Feb 11 18:20:30 2011 +0900 @@ -94,8 +94,8 @@ printState(SchedTask *s, void *chara, void *arg) { CHARACTER *p = (CHARACTER*)chara; - printf("[COORD]x= %f y= %f vx= %f vy= %f\n", - p->x, p->y, p->vx, p->vy); + printf("[ID]%d [COORD]x= %f y= %f vx= %f vy= %f\n", + p->chara_id, p->x, p->y, p->vx, p->vy); state_check(p); } @@ -198,17 +198,22 @@ { int task_num = p->state_task; HTaskPtr state_task = tmanager->create_task(task_num); + + uint32 rand1 = random(); + uint32 rand2 = random(); + uint32 rand3 = random(); + uint32 rand4 = random(); - state_task->set_param(0, (memaddr)random()); - state_task->set_param(1, (memaddr)random()); - state_task->set_param(2, (memaddr)random()); - state_task->set_param(3, (memaddr)random()); + state_task->set_param(0, (memaddr)rand1); + state_task->set_param(1, (memaddr)rand2); + state_task->set_param(2, (memaddr)rand3); + state_task->set_param(3, (memaddr)rand4); state_task->set_inData(0, p, sizeof(CHARACTER)); state_task->set_outData(0, p, sizeof(CHARACTER)); - state_task->set_post(printState, (void*)p, NULL); + state_task->set_post(updateState, (void*)p, NULL); #ifndef PPE_ONLY state_task->set_cpu(get_cpunum());