66 if (children[i] !=
NULL) {
83 if (childrenSize != 0) {
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
#define MEM_MODE
the current mode's: freed by main whenever the mode task ends
TaskRegistry TASK_REGISTRY
void *(* allocZeroed)(s32 size, s32 tag)
void(* remove)(struct Task *task)
void(* kill)(struct Task *task)
void(* add)(struct Task *task)
Any task, seen through its header.
void(* setCounter)(struct Task *task, s32 counter)
void(* setSubstate)(struct Task *task, s32 substate)
void(* destroy)(struct Task *task)
void(* setState)(struct Task *task, s32 state)
void(* nextSubstate)(struct Task *task)
void(* nextState)(struct Task *task)
void(* nextStep)(struct Task *task)
void(* setStep)(struct Task *task, s32 step)
void(* tickCounter)(struct Task *task)
void taskNextStep(Task *task)
Task method: goes to the next step, with its counter at 0.
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
void taskTickCounter(Task *task)
Task method: counts one more.
void * createTaskWithId(void(*update)(), s32 size, s32 childrenSize, s32 id)
Allocates a zeroed task of size bytes (header included) with room for childrenSize / 4 child tasks.
void destroyTask(Task *task)
Default destructor: kills the children, then frees the task.
void taskSetCounter(Task *task, s32 counter)
Task method: sets the counter.
void taskSetState(Task *task, s32 state)
Task method: goes to state state, from substate 0.
void taskSetStep(Task *task, s32 step)
Task method: goes to step step, with its counter at 0.
void taskSetSubstate(Task *task, s32 substate)
Task method: goes to substate substate, from step 0.
void taskNextState(Task *task)
Task method: goes to the next state, from substate 0.
void taskNextSubstate(Task *task)
Task method: goes to the next substate, from step 0.