32 if (frame->
frame == 0xFF) {
35 }
else if (frame->
frame == 0xFF) {
56 switch (task->
state) {
62 if (object->
anim >= 1 && object->
anim <= 4) {
85 for (i = 0; i < 4; i++) {
131 switch (task->
state) {
146#define STAGE_CHILDREN_SIZE 0x8
158#if VERSION_US || VERSION_JP
159#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
160#define EVENT_TEXT_FILE (TEXT_EVENTS_600 - 1)
161#define STAGE_FILE 0x47C
163#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
164#define EVENT_TEXT_FILE (TEXT_EVENTS_600 - 1)
165#define STAGE_FILE 0x48C
302 { 0, 6 }, { 1, 6 }, { 2, 6 }, { 1, 6 },
303 { 0, 6 }, { 1, 6 }, { 2, 6 }, { 1, 6 },
307 { 0, 6 }, { 0, 6 }, { 0, 6 }, { 1, 6 },
308 { 2, 6 }, { 3, 6 }, { 4, 6 }, { 5, 6 },
309 { 6, 6 }, { 7, 6 }, { 6, 6 }, { 5, 6 },
310 { 4, 6 }, { 3, 6 }, { 2, 6 }, { 1, 6 },
311 { 0, 6 }, { 0, 6 }, { 255, 0x3E7 },
314 { 0, 6 }, { 1, 6 }, { 2, 6 }, { 1, 6 },
315 { 0, 6 }, { 1, 6 }, { 2, 6 }, { 1, 6 },
319 { 0, 12 }, { 1, 12 }, { 2, 12 }, { 1, 12 },
323 { 2, 12 }, { 3, 12 }, { 4, 12 }, { 5, 12 },
324 { 6, 12 }, { 7, 12 }, { 8, 12 }, { 9, 12 },
325 { 10, 12 }, { 255, 0x3E7 },
328 { 9, 12 }, { 10, 12 }, { 9, 12 }, { 8, 12 },
332 { 0x12C, 90 }, { 0, 6 }, { 1, 6 }, { 2, 6 },
333 { 3, 6 }, { 4, 6 }, { 3, 6 }, { 4, 6 },
334 { 3, 6 }, { 4, 6 }, { 3, 6 }, { 2, 6 },
335 { 1, 6 }, { 2, 6 }, { 1, 6 }, { 2, 6 },
336 { 1, 6 }, { 255, 0x3E7 },
339 { 0x12C, 108 }, { 50, 6 }, { 51, 6 }, { 52, 6 },
340 { 53, 6 }, { 54, 6 }, { 56, 6 }, { 57, 6 },
341 { 58, 6 }, { 59, 6 }, { 255, 0x3E7 },
344 { {
NULL, 0, 0 }, {
updateTileSeqsSteps_0_0, 0, 0 }, {
updateTileSeqsSteps_0_1, 1, 3 }, {
updateTileSeqsSteps_0_2, 0, 0 } },
345 { {
NULL, 0, 0 }, {
updateTileSeqsSteps_1_0, 0, 0 }, {
updateTileSeqsSteps_1_1, 1, 3 }, {
updateTileSeqsSteps_1_2, 0, 0 } },
346 { {
NULL, 0, 0 }, {
updateTileSeqsSteps_2, 1, 0 }, {
NULL, 0, 0 }, {
NULL, 0, 0 } },
347 { {
NULL, 0, 0 }, {
updateTileSeqsSteps_3, 1, 0 }, {
NULL, 0, 0 }, {
NULL, 0, 0 } },
350 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
351 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
352 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
353 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
354 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
355 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
356 { 0x140, 0x100, 0x162, 0x190, 0x88, 0x90, 0x160, 0x1F6 },
357 { 0x140, 0x100, 0x174, 0x150, 0xD0, 0x50, 0x160, 0x1F5 },
358 { 0x140, 0x100, 0x14C, 0x178, 0x30, 0x78, 0x170, 0x1F5 },
359 { 0x140, 0x100, 0x152, 0x178, 0x48, 0x78, 0x140, 0x1F4 },
360 { 0x140, 0x100, 0x16A, 0x190, 0xA8, 0x90, 0x160, 0x1F4 },
361 { 0x140, 0x100, 0x140, 0x198, 0, 0x98, 0x170, 0x1F4 },
362 { 0x140, 0x100, 0x15A, 0x198, 0x68, 0x98, 0x140, 0x1F3 },
363 { 0x140, 0x100, 0x152, 0x1A0, 0x48, 0xA0, 0x160, 0x1F3 },
434 { 0, 1, 0x40, 2, 0x3D, 0, 0, 0, 0, 0, 335, 351, 0, 0 },
435 { 0, 2, 0x40, 2, 0x3E, 0, 0, 0, 0, 0, 345, 372, 0, 0 },
436 { 0, 3, 0x40, 2, 0x3C, 0, 0, 0, 0, 0, 477, 356, 0, 0 },
437 { 0, 4, 0x40, 2, 0x32, 0, 0, 0, 0, 0, 489, 350, 0, 0 },
438 { 1, 0, 0x40, 2, 0x5F, 2, 0, 3, 6, 0, 521, 212, 0, 0 },
439 { 1, 0, 0x40, 2, 0x5F, 2, 0, 3, 6, 0, 569, 236, 0, 0 },
440 { 1, 0, 0x40, 2, 0x60, 2, 0, 3, 6, 0, 617, 260, 0, 0 },
441 { 1, 0, 0x40, 2, 0x62, 2, 0, 5, 6, 0, 392, 163, 0, 0 },
442 { 1, 0, 0x40, 2, 0x63, 2, 0, 5, 6, 0, 369, 205, 0, 0 },
443 { 1, 0, 0x40, 6, 0x5E, 2, 0, 3, 6, 0, 360, 389, 0, 0 },
444 { 1, 0, 0x40, 6, 0x61, 2, 0, 5, 6, 0, 361, 186, 0, 0 },
445 { 1, 0, 0x40, 4, 0, 0, 0, 0, 0, 0, 377, 371, 399, 0 },
446 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
449 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x254, 0x2D4, 0xC4, 7, 0, 0, 0 },
450 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_CLIMB_DOWN, 5, 0x1D0, 0xF8, 0, 0, 0, 0 },
451 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_CLIMB_UP, 5, 0x1E0, 0x150, 0, 0, 0, 0 },
452 { { {
CODES_END, 0 }, {
CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
GfxState GFX
GFX: the graphics state and its methods.
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#define SCRIPT_WAIT_WALK(id)
until the character gets to its goal
#define SCRIPT_END
The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind...
#define SCRIPT_LOOK_AT(snap, x, y)
FIELDSTG_pointCamera.
#define SCRIPT_LEAVE(mode, x, y, dir)
FIELDSTG_leaveField; ends the event.
#define SCRIPT_COMMAND(id, command, arg)
the same word for a script command's id: FIELDSTG_setEventPose creates its task if none runs and hand...
#define SCRIPT_FOLLOW(snap, id)
FIELDSTG_followWithCamera.
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
#define FIELD_COMMAND_ICON3
its substate 3, with ITEM_GET
#define SCRIPT_WALK(id, x, y, dir)
Actor.setGoal: walks to (x, y), then faces dir.
#define SCRIPT_WAIT_BOX
until box 0 closes
#define SLOT_EXIT
The kinds of StageSlot (type).
#define SCRIPT_POSE(id, set, dir)
Actor.setPose: its animation set, facing dir.
#define FIELD_MAP_TRIGGERS
a cell's value: a direction (3 bits) and a StageSlot (5)
#define SCRIPT_WAIT(frames)
#define FIELD_TASK_COMMANDS
script command 813 (FIELDSTG_startCommandTask): the field commands
#define SCRIPT_PLACE(id, x, y)
puts a character at (x, y)
#define SCRIPT_TALK(box, entry, id, kind)
box of the event's boxes shows the event text's entry: a talk box at the corner kind next to the char...
FieldState FIELDSTG_state
#define ITEM(kind, id)
an item, in the bag or equipped; kind (bits 9-11) isn't read, and the scripts set it after the item's...
#define PROGRESS(n)
GAME.progress is n.
#define FLAG(group, id)
The codes of the (code, value) pairs that FLAGS_00 checks as conditions and applies as actions (event...
#define MUSIC_SECRET_ROOM
BGM_0019: the Secret Room, the rebels' hideout.
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
@ STORY_CONTROL_ROOM
WSTAG325 (Control Room, Asuka City), event 560: a Soldier guards the way.
@ STORY_STAFF_PASS
WSTAG620, event 551: Nick finds a Staff Pass for the player.
#define SPECIAL_STORY_BYAKKO_LEADER_FOUGHT_TO_GAME_MASTER_CAUGHT
GAME.progress is from STORY_BYAKKO_LEADER_FOUGHT to STORY_GAME_MASTER_CAUGHT (PROGRESS_RANGES[3])
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
One frame of a sprite animation; frame 0xFF ends it (or loops it)
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts.
void(* setFile)(s32 index, s32 file)
FIELDSTG_setMapFile.
void(* setFirstMap)(s32 index)
FIELDSTG_setFirstMap: the map the player starts on (GAME.mapIndex), when the mode is new.
s32 sheetEntry
the stage's sprite sheet, loaded before the field starts, or 0
FieldEvent * events
up to the first id -1
s32 soundBank
SOUND.loadBank's, or 0.
StageTile * objects
the map objects, up to the first margin 0
s32 imageFile
or an image archive file, or 0
Vec2 start
where the player starts
StageSlot * slots
up to the first type 0
ActorImage * actors
then the actors', from actors[2]
s32 mapFile
the file of the map's tiles (FIELDSTG_createMapStreamer)
s32 startDir
and its direction
s32 textFile
the stage's text file, for the talks
union FieldState::@12 images
s32 music
SOUND.playSound's, or 0.
What a character says (FIELDSTG_runActorAction): the first whose conditions hold, or the last,...
void(* applyAction)(s32 code, s32 value)
s32(* checkCondition)(u16 code, u16 value)
s32(* getFrameTime)(void)
A step of a StageTileSeq: its animation, and the step after it ends.
s16 next
0: hide the map object
s16 once
play once, then go to next
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
The task a stage starts (startStage), updated by its updateStage.
void(* nextState)(struct StageTask *task)
A map object played through a sequence of animations.
s16 seq
the step playing, 0 when finished
s16 setFrame
0: the animation sets clutRow, else frame
The map objects with animations 1 to 4, sequenced.
void(* nextState)(struct StageTileSeqs *task)
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 * 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(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
AnimFrame updateTileSeqsSteps_2[]
AnimFrame updateTileSeqsSteps_1_1[]
void * createTileSeqs(s32 arg)
Creates the map objects' steps (updateTileSeqs) with an id; nothing in the game calls it.
StageSeqStep updateTileSeqsSteps[4][4]
Defined below, after the code that uses them.
void endEvent552(void)
After event 552, with Keith, Nick, Lisa and Kail: gives the player the Staff Pass and keeps it from p...
void updateTileSeqs(StageTileSeqs *task)
Plays the steps of updateTileSeqsSteps on the map objects with animations 1 to 4, which go on to thei...
AnimFrame updateTileSeqsSteps_1_2[]
FieldActorEntry * stageActors[]
AnimFrame updateTileSeqsSteps_0_1[]
AnimFrame updateTileSeqsSteps_1_0[]
void setupStage(void)
Sets the stage up: its map, actors and events, playing BGM_0019.
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
AnimFrame updateTileSeqsSteps_3[]
AnimFrame updateTileSeqsSteps_0_0[]
AnimFrame updateTileSeqsSteps_0_2[]
s32 stepTileAnimation(StageTileSeq *obj, AnimFrame *frames, s32 once, s32 depth)
stepTileAnimation (common/step_tile_animation.inc.c) for a StageTileSeq: steps OBJ's animation throug...