27 switch (task->
state) {
55 for (i = 0; i < 3; i++) {
80 for (j = 0; j < 3; j++) {
130 switch (task->
state) {
145#define STAGE_CHILDREN_SIZE 4
153#if VERSION_US || VERSION_JP
154#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_05)
155#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
156#define STAGE_FILE 0x191
157#define STAGE_ARCHIVE 0x3BD
159#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_05)
160#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
161#define STAGE_FILE 0x19F
162#define STAGE_ARCHIVE 0x3CD
248 { 70, 4 }, { 71, 4 }, { 70, 4 }, { 71, 4 },
252 { 0x12C, 56 }, { 85, 6 }, { 86, 6 }, { 87, 4 },
253 { 88, 4 }, { 89, 4 }, { 90, 4 }, { 88, 4 },
254 { 89, 4 }, { 90, 4 }, { 88, 4 }, { 89, 4 },
255 { 90, 4 }, { 88, 4 }, { 89, 4 }, { 90, 4 },
256 { 88, 4 }, { 89, 4 }, { 90, 4 }, { 255, 0x3E7 },
259 { 0x12C, 16 }, { 72, 4 }, { 73, 4 }, { 74, 4 },
260 { 73, 4 }, { 75, 6 }, { 76, 6 }, { 77, 14 },
261 { 78, 114 }, { 79, 6 }, { 80, 6 }, { 81, 6 },
262 { 82, 6 }, { 83, 6 }, { 84, 8 }, { 255, 0x3E7 },
274 { 0x150, 0x112 }, { 112, 0x112 },
277 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
278 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
279 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
280 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
281 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
282 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
283 { 0x140, 0x100, 0x152, 0x1D0, 0x48, 0xD0, 0x170, 0x1FE },
284 { 0x140, 0x100, 0x170, 0x1B0, 0xC0, 0xB0, 0x160, 0x1FD },
285 { 0x140, 0x100, 0x14A, 0x1B8, 0x28, 0xB8, 0x170, 0x1FD },
286 { 0x140, 0x100, 0x162, 0x1D0, 0x88, 0xD0, 0x150, 0x1FC },
287 { 0x140, 0x100, 0x15A, 0x1D0, 0x68, 0xD0, 0x160, 0x1FC },
393 { 0, 1, 0x50, 6, 0x46, 0, 0, 0, 0, 0, 112, 274, 0, 0 },
394 { 1, 0, 0x40, 6, 0x3F, 1, 0x3F, 0x42, 6, 0, 116, 258, 0, 0 },
395 { 1, 0, 0x40, 6, 0x3F, 1, 0x3F, 0x42, 6, 0, 228, 282, 0, 0 },
396 { 1, 0, 0x40, 6, 0x3F, 1, 0x3F, 0x42, 6, 0, 340, 258, 0, 0 },
397 { 1, 0, 0x40, 6, 0x3F, 1, 0x3F, 0x42, 6, 0, 355, 346, 0, 0 },
398 { 0, 2, 0x50, 4, 0x48, 0, 0, 0, 0, 0, 112, 227, 301, 0 },
399 { 0, 3, 0x50, 4, 0x55, 0, 0, 0, 0, 0, 112, 227, 294, 0 },
400 { 1, 0, 0x40, 4, 0x3B, 1, 0x3B, 0x3E, 6, 0, 116, 274, 300, 0 },
401 { 1, 0, 0x40, 4, 0x3B, 1, 0x3B, 0x3E, 6, 0, 228, 298, 324, 0 },
402 { 1, 0, 0x40, 4, 0x3B, 1, 0x3B, 0x3E, 6, 0, 340, 274, 300, 0 },
403 { 1, 0, 0x40, 4, 0x3B, 1, 0x3B, 0x3E, 6, 0, 355, 362, 388, 0 },
404 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
407 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x203, 0x2DA, 0x17E, 1, 0, 0, 0 },
408 { { {
CODES_END, 0 }, {
CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
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 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 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 PROGRESS(n)
GAME.progress is n.
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_DIGIMON_LAB
ENV_0011: Asuka's Digimon Lab and Login Room.
#define MUSIC_CITY_CRISIS
BGM_0029: the cities and their streets instead of their music while the story is at a crisis (Knightm...
#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 SPECIAL_STORY_JUNGLE_SOUND_TO_AMATERASU_BRIDGE
GAME.progress is from STORY_JUNGLE_SOUND to STORY_AMATERASU_BRIDGE (PROGRESS_RANGES[0x12])
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
@ STORY_LOGGED_IN
WSTAG225 (Login Room, Asuka City), event 5: the first login, where the account clerk explains Digimon...
@ STORY_BYAKKO_LEADER_FOUGHT
WSTAG620 (the rebels' hideout), event 534: the Byakko Leader takes the player for the A....
@ STORY_CONTROL_ROOM
WSTAG325 (Control Room, Asuka City), event 560: a Soldier guards the way.
@ STORY_GUNSLINGER
WSTAG810 (Gunslinger 1F), event 1035.
@ STORY_GENJI_BEATEN
WSTAG200, event 52: after the first battle, won against Tamer Genji (event 50), the Digimon Navi give...
@ STORY_KNIGHTMON_REPROGRAMMED
WSTAG210 (Main Lobby, Asuka City), event 685: the A.o.A have reprogrammed Knightmon,...
@ STORY_TEDDY_FOUND
WSTAG212, event 352: Teddy is found; MAGAMI is part of the A.o.A, and the player sets off to beat the...
@ STORY_LOOKING_FOR_TEDDY
WSTAG212, event 273: Kail and the player will put on the Agumon Suits to look for Teddy.
@ STORY_ACCOUNT_REGISTERED
WSTAG785, event 1: the account is registered, and the clerk sends Junior to the Chamber Room.
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
@ STORY_ASUKA_HEADQUARTERS
WSTAG310 (A.o.A Headquarters, Asuka City), event 961.
@ STORY_AGUMON_DISGUISE
WSTAG237 (Underground Path), event 300: in the Agumon Suit; Kail goes on ahead alone.
#define SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
#define SPECIAL_STORY_DE_SINCERITY_TO_LISA_SAVED
GAME.progress is from STORY_DE_SINCERITY to STORY_LISA_SAVED (PROGRESS_RANGES[0xF])
#define SPECIAL_STORY_SEIRYU_BADGE_TO_ZANBAMON_DRIVEN_OFF
GAME.progress is from STORY_SEIRYU_BADGE to STORY_ZANBAMON_DRIVEN_OFF (PROGRESS_RANGES[0xE])
#define SPECIAL_STORY_KNIGHTMON_REPROGRAMMED_TO_BULBMON_FOUND
GAME.progress is from STORY_KNIGHTMON_REPROGRAMMED to STORY_BULBMON_FOUND (PROGRESS_RANGES[0x11])
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,...
short(* playSound)(s32 id)
returns the voice of a key-on
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 * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
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...
void handleCommand815(StageTileEffect *task, s32 id)
Starts the effect at the place of map object 0x346 or 0x347.
void * createCommand815(s32 arg)
Command 815 of the event scripts: the effect of event 5, the player's arrival at the Asuka Server.
void endEvent5(void)
After event 5, with Account Clerk: moves the story on to STORY_LOGGED_IN.
void updateTileEffect(StageTileEffect *task)
Once the substate is set to 1, moves the map objects of animations 1-3 to (x, y), plays a sound and a...
AnimFrame * updateTileEffectFrames[]
Defined below, after the code that uses them.
FieldActorEntry * stageActors[]
AnimFrame updateTileEffectFrames_0[]
s16 tileEffectPlaces[][2]
void setupStage(void)
Sets the stage up: its map, actors and events, playing the ambience ENV_0011; BGM_0029 instead at sto...
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
AnimFrame updateTileEffectFrames_2[]
void * createTileEffect(void)
Creates the arrival effect (updateTileEffect) without an id; nothing in the game calls it.
AnimFrame updateTileEffectFrames_1[]