30 switch (task->
state) {
58 for (i = 0; i < 3; i++) {
83 for (j = 0; j < 3; j++) {
119 switch (task->
state) {
147#define STAGE_CHILDREN_SIZE 0xC
188#if VERSION_US || VERSION_JP
189#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
190#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
191#define STAGE_FILE 0x6B2
193#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
194#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
195#define STAGE_FILE 0x6C1
457 { 70, 4 }, { 71, 4 }, { 70, 4 }, { 71, 4 },
461 { 0x12C, 56 }, { 85, 6 }, { 86, 6 }, { 87, 4 },
462 { 88, 4 }, { 89, 4 }, { 90, 4 }, { 88, 4 },
463 { 89, 4 }, { 90, 4 }, { 88, 4 }, { 89, 4 },
464 { 90, 4 }, { 88, 4 }, { 89, 4 }, { 90, 4 },
465 { 88, 4 }, { 89, 4 }, { 90, 4 }, { 255, 0x3E7 },
468 { 0x12C, 16 }, { 72, 4 }, { 73, 4 }, { 74, 4 },
469 { 73, 4 }, { 75, 6 }, { 76, 6 }, { 77, 14 },
470 { 78, 114 }, { 79, 6 }, { 80, 6 }, { 81, 6 },
471 { 82, 6 }, { 83, 6 }, { 84, 8 }, { 255, 0x3E7 },
486 { 28, 0, 108, 0x144 },
489 { 0, 6 }, { 1, 6 }, { 2, 68 }, { 1, 4 },
490 { 0, 4 }, { 255, 0 },
493 { 0x12C, 18 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
494 { 4, 6 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
495 { 5, 4 }, { 6, 4 }, { 7, 4 }, { 5, 4 },
496 { 6, 4 }, { 7, 4 }, { 5, 4 }, { 6, 4 },
497 { 7, 4 }, { 4, 4 }, { 3, 4 }, { 2, 4 },
498 { 1, 4 }, { 255, 0x3E7 },
501 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
502 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
503 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
504 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
505 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
506 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
507 { 0x140, 0x100, 0x176, 0x1B0, 0xD8, 0xB0, 0x160, 0x1F8 },
508 { 0x140, 0x100, 0x164, 0x1C8, 0x90, 0xC8, 0x170, 0x1F8 },
509 { 0x140, 0x100, 0x14A, 0x1B0, 0x28, 0xB0, 0x150, 0x1F7 },
510 { 0x180, 0x100, 0x194, 0x140, 0x150, 0x40, 0x160, 0x1F7 },
511 { 0x180, 0x100, 0x19C, 0x148, 0x170, 0x48, 0x170, 0x1F7 },
638 { 0, 1, 0x50, 6, 0x46, 0, 0, 0, 0, 0, 320, 186, 0, 0 },
639 { 1, 0, 0x40, 6, 0x60, 1, 0x60, 0x63, 6, 0, 324, 169, 0, 0 },
640 { 1, 0, 0x40, 6, 0x39, 2, 0, 0xB, 8, 0, 78, 233, 0, 0 },
641 { 1, 0, 0x40, 6, 0x39, 2, 0, 0xB, 8, 0, 93, 214, 0, 0 },
642 { 1, 0, 0x40, 6, 0x39, 2, 0, 0xB, 8, 0, 109, 217, 0, 0 },
643 { 1, 0, 0x40, 6, 0x3A, 2, 0, 0xB, 8, 0, 78, 221, 0, 0 },
644 { 1, 0, 0x40, 6, 0x3A, 2, 0, 0xB, 8, 0, 93, 225, 0, 0 },
645 { 1, 0, 0x40, 6, 0x3A, 2, 0, 0xB, 8, 0, 109, 205, 0, 0 },
646 { 1, 0, 0x40, 6, 0x32, 1, 0x32, 0x34, 0xA, 0, 82, 234, 0, 0 },
647 { 1, 0, 0x40, 6, 0x35, 1, 0x35, 0x37, 0xA, 0, 139, 230, 0, 0 },
648 { 0, 3, 0x50, 4, 0x55, 0, 0, 0, 0, 0, 320, 139, 206, 0 },
649 { 0, 2, 0x50, 4, 0x48, 0, 0, 0, 0, 0, 320, 139, 213, 0 },
650 { 1, 0, 0x40, 4, 0x5C, 1, 0x5C, 0x5F, 6, 0, 324, 185, 209, 0 },
651 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
654 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x26C, 0xB8, 0xB4, 7, 0, 0, 0 },
655 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH_OUT, 0x26A, 0x3C0, 0x50, 7, 0, 0, 0 },
656 { { {
CODES_END, 0 }, {
CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
StageEffect * createStageEffect(s32 x, s32 y, s32 frame)
Creates a StageEffect at (x, y) with its sprites' frames from FRAME.
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 FIELD_COMMAND_HALT_PARTNERS
The field commands, which an event script hands FIELD_TASK_COMMANDS as the first argument of a pose c...
#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 FIELD_COMMAND_PLAY_SAVEDEMO
#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 SCRIPT_WALK(id, x, y, dir)
Actor.setGoal: walks to (x, y), then faces dir.
#define FIELD_COMMAND_ICON1
the player icon's substate 1, with ITEM_GET
#define FIELD_COMMAND_ICON2
its substate 2
#define SCRIPT_WAIT_BOX
until box 0 closes
#define SLOT_LAUNCH_OUT
the same, then leaves for mode arg
#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 SCRIPT_WAIT_ANIM(id)
until its animation ends
#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 START_EVENT(index)
action: FIELDSTG_startListedEvent
#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...
void resetTileEffect(StageTileEffect *task)
Restarts the three animations of a StageTileEffect, from the stage's updateTileEffectFrames.
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define MUSIC_CHAMBER_ROOM
ENV_0024: the Chamber Rooms.
#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,...
s32 stepAnimationOnce(StageTileAnim *obj, AnimFrame *frames, s32 depth)
Steps OBJ's animation through FRAMES by the frame time (at most 4) and returns its frame,...
#define FLAG_FORCED_DIGITIZATION_SEEN
wstag750 event 860: the realize transfer limit is reached and the player is forced back to digital; s...
@ STORY_BLACK_ID_PASS
WSTAG756 (Battle Gate), event 911: the Black ID Pass.
@ STORY_WHITE_ID_PASS
WSTAG676 (Bai Hu Dome), event 901: the General says the A.o.A came on Bulbmon (the White ID Pass)
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
@ STORY_AMATERASU_BRIDGE
WSTAG206 (Amaterasu Bridge), event 922: an Attacker holds the bridge.
@ STORY_WAY_TO_AMATERASU
WSTAG305, events 893 and 895: the way into Amaterasu City, the A.o.A's headquarters,...
@ STORY_DE_KNOWLEDGE
WSTAG526 (Zhu Que UG Lake), event 760: the fight with Zanbamon (the DE Knowledge)
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
@ STORY_GENBU_BADGE
WSTAG755 (Battle Gate), event 781: the Xuen Wu Chief, who holds the Black ID Pass,...
@ STORY_REAL_WORLD
WSTAG750 (the emergency Matrix Chamber), event 820: back in the real world, for 180 seconds.
@ STORY_NETWORK_OFFLINE
WSTAG750, event 886: the news say the Optical Network is offline.
#define SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
#define FLAG_JUGGERNAUT_LAUNCH_SEEN
wstag805 event 880: the player wins but the field is gone and the Juggernaut launches; set at its end...
#define FLAG_MATRIX_CHAMBER_USED
wstag750 Chamber Room: Chamber Clark checks the 4 Leader Badges and the player goes to the Real World...
#define FLAG_JUGGERNAUT_TAKEN_SEEN
wstag750 event 883: "...they took the Juggernaut...", in the Chamber Room; set at its end,...
#define SPECIAL_STORY_GENJI_BEATEN_TO_MOVIE_BATTLES
GAME.progress is from STORY_GENJI_BEATEN to 0x2C (PROGRESS_RANGES[2]); nothing sets 0x2C,...
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)
short(* playSound)(s32 id)
returns the voice of a key-on
A sprite effect a stage creates at (x, y) with the given frame, by kind.
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)
Three map objects (animations 1 to 3) moved to (x, y) and animated once when the substate is set to 1...
void(* setSubstate)(struct StageTileEffect *task, s32 substate)
void(* nextState)(struct StageTileEffect *task)
void(* nextStep)(struct StageTileEffect *task)
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
u8 margin
how far off the view it is still drawn; 0 ends the table
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
s16 sortY
drawn sorted at this y, or 0
void * createTileEffect(void)
Creates the arrival effect (updateTileEffect) without an id; nothing in the game calls it.
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
void endEvent884(void)
After event 884, with the player: keeps it from playing again.
u16 actor0Talk0Conditions[]
u16 actor0Talk1Conditions[]
AnimFrame effectClutFrames[]
void updateTileEffect(StageTileEffect *task)
Moves its map objects to (x, y) and animates them when the substate is set to 1.
void endEvent860(void)
After event 860, with Chamber Office: keeps it from playing again.
AnimFrame * updateTileEffectFrames[]
Defined below, after the code that uses them.
void endEvent886(void)
After event 886, with the player: moves the story on to STORY_NETWORK_OFFLINE.
void endEvent820(void)
After event 820, with Chamber Officer: moves the story on to STORY_REAL_WORLD.
u16 actor0Talk3Conditions[]
FieldActorEntry * stageActors[]
AnimFrame updateTileEffectFrames_0[]
s16 tileEffectPlaces[][2]
void setupStage(void)
Sets the stage up: its map, actors and events, playing the ambience ENV_0024.
StageEffectSpot updateStageSpots[]
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
void handleCommand846(StageTileEffect *task, s32 id)
Starts the effect at the place of map 0x335.
void endEvent1245(void)
After event 1245, with Guardromon: applies 0x7C0A, an action that does nothing (applyAction's mode ch...
u16 actor0Talk2Conditions[]
AnimFrame updateTileEffectFrames_2[]
AnimFrame updateTileEffectFrames_1[]
void endEvent883(void)
After event 883, with Chamber Officer: keeps it from playing again.