19 switch (task->
state) {
24 switch (object->
anim) {
26 task->
tiles[1] = object;
27 task->
homeY[1] =
object->y;
34 task->
tiles[0] = object;
35 task->
homeY[0] =
object->y;
48 tile0 = task->
tiles[0];
49 tile1 = task->
tiles[1];
56 task->
y[0] = tile0->
y;
57 task->
y[1] = tile1->
y;
64 if (task->
timer >= 30) {
74 tile0->
y = task->
y[0] + offset;
75 tile1->
y = task->
y[1] + offset;
85 if (task->
shake >= 0xFE) {
91 tile0->
y = task->
homeY[0] - 0x7F;
92 tile1->
y = task->
homeY[1] - 0x7F;
95 task->
y[0] = tile0->
y;
96 task->
y[1] = tile1->
y;
100 }
else if (task->
shake & 1) {
104 player->
pos.
y += 0x100;
108 player->
pos.
y -= 0x100;
GfxState GFX
GFX: the graphics state and its methods.
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
#define FIELD_TASK_ACTOR
every character (FIELDSTG_createActor)
#define LIFT_DOWN
and back down to the objects' place on the map
#define LIFT_UP
The lift: the map objects 3 (always shown) and 2 (shown while it moves), which move 0x7F pixels up or...
FIELDSTG.PRO: the field mode, where the player walks around the map.
s16 FIELDSTG_liftShake[]
FIELDSTG_updateLift's shakes, up to 1000.
FieldState FIELDSTG_state
void FIELDSTG_updateLift(Lift *task)
A lift made of the map objects 3 and 2: in TASK_DONE it shakes, moves the objects and the player 0x7F...
void FIELDSTG_moveLift(Lift *task, s32 command)
Runs a script command of the lift's: moves it up or down.
Lift * FIELDSTG_createLift(s32 id)
Creates the lift, raised when flag 0x1C3D is set.
TaskRegistry TASK_REGISTRY
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define FLAG_LIFT_RAISED
lift.c / wstag261 Cargo Tower: "There's a switch here! Let's push it." sets it, "let's go downstairs"...
A character on the field (FIELDSTG_createActor): the player (kind 0) and the other characters.
StageTile * objects
the map objects, up to the first margin 0
s32(* checkCondition)(u16 code, u16 value)
s32(* getFrameTime)(void)
void(* setState)(struct Lift *task, s32 state)
void(* nextSubstate)(struct Lift *task)
s16 y[2]
the objects' y when the move started
s16 raised
the objects are 0x7F up from their place, and the next move takes them down (LIFT_DOWN; flag 0x1C3D a...
s16 shake
the step of the shake table, then a frame count
StageTile * tiles[2]
the map objects 3 and 2
void(* nextState)(struct Lift *task)
s16 homeY[2]
the objects' place on the map
short(* playSound)(s32 id)
returns the voice of a key-on
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
void *(* find)(s32 id, s32 key1, s32 key2)
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.