16 if (task !=
NULL &&
id == 0x335) {
28 switch (task->
state) {
83#define STAGE_CHILDREN_SIZE 0x8
131#if VERSION_US || VERSION_JP
132#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_05)
133#define EVENT_TEXT_FILE (TEXT_EVENTS_305 - 1)
134#define STAGE_FILE 0x33C
136#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_05)
137#define EVENT_TEXT_FILE (TEXT_EVENTS_305 - 1)
138#define STAGE_FILE 0x34B
1184 { 5, 4 }, { 6, 4 }, { 7, 4 }, { 8, 4 },
1185 { 9, 4 }, { 255, 0x3E7 },
1188 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
1189 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
1190 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
1191 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
1192 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
1193 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
1194 { 0x180, 0x100, 0x1B4, 0x13C, 0x1D0, 0x3C, 0x150, 0x1FB },
1195 { 0x180, 0x100, 0x1A8, 0x152, 0x1A0, 0x52, 0x160, 0x1FB },
1196 { 0x180, 0x100, 0x180, 0x158, 0x100, 0x58, 0x170, 0x1FB },
1197 { 0x140, 0x100, 0x176, 0x18C, 0xD8, 0x8C, 0x140, 0x1FA },
1198 { 0x180, 0x100, 0x180, 0x100, 0x100, 0, 0x150, 0x1FA },
1199 { 0x180, 0x100, 0x188, 0x100, 0x120, 0, 0x160, 0x1FA },
1200 { 0, 0, 0, 0, 0, 0, 0, 0 },
1201 { 0x180, 0x100, 0x1B0, 0x114, 0x1C0, 0x14, 0x170, 0x1FA },
1202 { 0x180, 0x100, 0x180, 0x130, 0x100, 0x30, 0x140, 0x1F9 },
1203 { 0x180, 0x100, 0x188, 0x130, 0x120, 0x30, 0x150, 0x1F9 },
1204 { 0x140, 0x100, 0x178, 0x100, 0xE0, 0, 0x160, 0x1F9 },
1205 { 0x180, 0x100, 0x190, 0x130, 0x140, 0x30, 0x170, 0x1F9 },
1206 { 0x180, 0x100, 0x188, 0x158, 0x120, 0x58, 0x140, 0x1F8 },
1207 { 0x180, 0x100, 0x190, 0x158, 0x140, 0x58, 0x150, 0x1F8 },
1208 { 0x140, 0x100, 0x178, 0x130, 0xE0, 0x30, 0x160, 0x1F8 },
1209 { 0x180, 0x100, 0x198, 0x130, 0x160, 0x30, 0x170, 0x1F8 },
1210 { 0x180, 0x100, 0x1A0, 0x130, 0x180, 0x30, 0x140, 0x1F7 },
1211 { 0x180, 0x100, 0x190, 0x100, 0x140, 0, 0x150, 0x1F7 },
1212 { 0x180, 0x100, 0x198, 0x158, 0x160, 0x58, 0x160, 0x1F7 },
1213 { 0x180, 0x100, 0x1A0, 0x158, 0x180, 0x58, 0x170, 0x1F7 },
1214 { 0, 0, 0, 0, 0, 0, 0, 0 },
1215 { 0, 0, 0, 0, 0, 0, 0, 0 },
1216 { 0x180, 0x100, 0x1B0, 0x15C, 0x1C0, 0x5C, 0x140, 0x1F6 },
1217 { 0, 0, 0, 0, 0, 0, 0, 0 },
1218 { 0, 0, 0, 0, 0, 0, 0, 0 },
1219 { 0, 0, 0, 0, 0, 0, 0, 0 },
1220 { 0, 0, 0, 0, 0, 0, 0, 0 },
1221 { 0x180, 0x100, 0x1A8, 0x172, 0x1A0, 0x72, 0x150, 0x1F6 },
1222 { 0x180, 0x100, 0x180, 0x178, 0x100, 0x78, 0x160, 0x1F6 },
1223 { 0x180, 0x100, 0x198, 0x100, 0x160, 0, 0x170, 0x1F6 },
1224 { 0x180, 0x100, 0x1A0, 0x100, 0x180, 0, 0x140, 0x1F5 },
1225 { 0x180, 0x100, 0x1A8, 0x100, 0x1A0, 0, 0x150, 0x1F5 },
2003 { 1, 0, 0x40, 6, 0x32, 1, 0x32, 0x3B, 6, 0, 374, 136, 0, 0 },
2004 { 1, 0, 0x40, 6, 0x3C, 1, 0x3C, 0x45, 8, 0, 408, 105, 0, 0 },
2005 { 1, 0, 0x40, 6, 0x46, 1, 0x46, 0x57, 8, 0, 418, 102, 0, 0 },
2006 { 0, 1, 0x40, 6, 5, 0, 5, 0xA, 4, 0, 382, 196, 0, 0 },
2007 { 1, 0, 0x40, 4, 0, 0, 0, 0, 0, 0, 453, 185, 199, 0 },
2008 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 449, 190, 204, 0 },
2009 { 1, 0, 0x58, 4, 2, 0, 0, 0, 0, 0, 351, 136, 218, 0 },
2010 { 1, 0, 0x40, 4, 3, 0, 0, 0, 0, 0, 215, 302, 353, 0 },
2011 { 1, 0, 0x48, 4, 4, 0, 0, 0, 0, 0, 144, 262, 322, 0 },
2012 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
2015 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x217, 0x398, 0xCC, 1, 0, 0, 0 },
2016 { { {
SPECIAL_STORY_SINCE_DE_KNOWLEDGE, 1 }, {
SPECIAL_STORY_JUNGLE_SOUND_TO_AMATERASU_BRIDGE, 0 } },
SLOT_EVENT, 0x3C5, 0, 0, 0, 0, 0, 0 },
2017 { { {
CODES_END, 0 }, {
CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
void * createSoundTile(s32 arg)
Creates the updateSoundTile task with the id ARG.
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 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 SLOT_EVENT
starts the event arg
#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_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 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...
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define MUSIC_ADMIN_CENTER
KANRIBGM: the cities' Main Lobby, Admin Center, Digimon Arena, Master Room.
#define SOUND_COMCD115
held until SOUND.keyOff
#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,...
#define FLAG_GAME_MASTER_MEETING_SEEN
wstag305 Master Room event 350: the Game Master finds the player and Kail looking for Teddy; set at i...
#define FLAG_MASTER_ROOM_SENSOR_O_TOUCHED
wstag305 Master Room: the player touches the "O" letter sensor of MONSTER; all sensor flags are clear...
#define FLAG_MASTER_ROOM_SENSOR_S_TOUCHED
wstag305 Master Room: the player touches the "S" letter sensor of MONSTER; all sensor flags are clear...
#define FLAG_AMATERASU_PLAN_SEEN
wstag305 event 890: Lisa and Nick plan how to get into Amaterasu City past the Knightmon Guard System...
#define SPECIAL_STORY_JUNGLE_SOUND_TO_AMATERASU_BRIDGE
GAME.progress is from STORY_JUNGLE_SOUND to STORY_AMATERASU_BRIDGE (PROGRESS_RANGES[0x12])
@ 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_BLUE_ID_PASS
WSTAG421 (Qing Long City), event 743: with the Blue ID Pass a Trooper takes the player for the Qing L...
@ STORY_CONTROL_ROOM
WSTAG325 (Control Room, Asuka City), event 560: a Soldier guards the way.
@ STORY_BULBMON_BEATEN
WSTAG521 (Zhu Que Hall), event 751: Bulbmon is beaten (the Red ID Pass); its hole leads on to the Ama...
@ STORY_JUNGLE_SOUND
WSTAG545 (Bug Maze Pit), event 711: Patamon heard a weird sound from the jungle, where its leader wen...
@ 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_GENBU_BADGE
WSTAG755 (Battle Gate), event 781: the Xuen Wu Chief, who holds the Black ID Pass,...
@ STORY_AGUMON_DISGUISE
WSTAG237 (Underground Path), event 300: in the Agumon Suit; Kail goes on ahead alone.
@ STORY_GAME_MASTER_CAUGHT
WSTAG305 (Master Room), event 661: the Game Master is caught, but Vemmon takes over the Optical Netwo...
@ 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 SPECIAL_STORY_SINCE_DE_KNOWLEDGE
GAME.progress is STORY_DE_KNOWLEDGE or later (PROGRESS_RANGES[0xD], to 0x63)
#define SPECIAL_MASTER_ROOM_LAST_SENSOR_LEFT
exactly one of the Master Room's sensors is untouched
#define FLAG_MASTER_ROOM_SENSOR_T_TOUCHED
wstag305 Master Room: the player touches the "T" letter sensor of MONSTER; all sensor flags are clear...
#define FLAG_MASTER_ROOM_SENSOR_E_IN_ORDER
wstag305 Master Room: set when the "E" sensor is touched right after the previous letters of MONSTER ...
#define FLAG_MASTER_ROOM_SENSOR_S_IN_ORDER
wstag305 Master Room: set when the "S" sensor is touched right after the previous letters of MONSTER ...
#define SPECIAL_MASTER_ROOM_SENSOR_TOUCHED
one of the Master Room's sensors or more is touched
#define FLAG_RESISTANCE_CHUCK_MET
wstag656 Mirage Room: Leader Chuck recognises the player and an event starts; Lisa (Master Room) then...
#define SPECIAL_STORY_SINCE_KNIGHTMON_REPROGRAMMED
GAME.progress is STORY_KNIGHTMON_REPROGRAMMED or later (PROGRESS_RANGES[8], to 0x63)
#define FLAG_MASTER_ROOM_SENSOR_O_IN_ORDER
wstag305 Master Room: set when the "O" sensor is touched right after the previous letters of MONSTER ...
#define SPECIAL_MASTER_ROOM_SENSORS_LEFT
two of the Master Room's sensors or more are still untouched
#define FLAG_MASTER_ROOM_SENSOR_T_IN_ORDER
wstag305 Master Room: set when the "T" sensor is touched right after the previous letters of MONSTER ...
#define FLAG_MASTER_ROOM_SENSORS_ALL_TOUCHED
wstag305 Master Room: "OK, I touched all the sensors, so now what?" (letter flags cleared,...
#define FLAG_MASTER_ROOM_SENSOR_M_IN_ORDER
wstag305 Master Room: set when the "M" sensor is touched right after the previous letters of MONSTER ...
#define SPECIAL_STORY_KNIGHTMON_REPROGRAMMED_TO_BULBMON_FOUND
GAME.progress is from STORY_KNIGHTMON_REPROGRAMMED to STORY_BULBMON_FOUND (PROGRESS_RANGES[0x11])
#define FLAG_MASTER_ROOM_SENSOR_R_TOUCHED
wstag305 Master Room: the player touches the "R" letter sensor of MONSTER; all sensor flags are clear...
#define FLAG_MASTER_ROOM_SENSOR_E_TOUCHED
wstag305 Master Room: the player touches the "E" letter sensor of MONSTER; all sensor flags are clear...
#define FLAG_LISA_RESISTANCE_REPORT_SEEN
wstag305 Master Room event 894: the player tells Lisa he met the Resistance; set at its end,...
#define FLAG_MASTER_ROOM_SENSOR_N_TOUCHED
wstag305 Master Room: the player touches the "N" letter sensor of MONSTER; all sensor flags are clear...
#define FLAG_MASTER_ROOM_SENSOR_M_TOUCHED
wstag305 Master Room: the player touches the "M" letter sensor of MONSTER; all sensor flags are clear...
#define FLAG_MASTER_ROOM_SENSOR_N_IN_ORDER
wstag305 Master Room: set when the "N" sensor is touched right after the previous letters of MONSTER ...
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
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
The map object with animation 1, played once with a sound when the substate is set to 1 (frame 5 befo...
void(* setSubstate)(struct StageSoundTile *task, s32 substate)
s16 voice
what SOUND.playSound returned
The task a stage starts (startStage), updated by its updateStage.
void(* nextState)(struct StageTask *task)
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
u16 actor41Talk0Actions[]
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
void endEvent894(void)
After event 894, with Lisa, Nick and Keith: keeps it from playing again.
u16 actor45Talk2Actions[]
u16 actor45Talk1Conditions[]
u16 actor8Talk1Conditions[]
u16 actor51Talk0Conditions[]
u16 actor39Talk0Actions[]
u16 actor8Talk3Conditions[]
u16 actor51Talk2Actions[]
u16 actor47Talk4Actions[]
u16 actor51Talk1Conditions[]
u16 actor57Talk0Conditions[]
void endEvent351(void)
After event 351, with Game Master and Kail: sets flag 0x1C0E.
u16 actor53Talk4Conditions[]
u16 actor47Talk2Actions[]
u16 actor40Talk0Conditions[]
u16 actor47Talk0Conditions[]
u16 actor55Talk2Conditions[]
u16 actor55Talk4Conditions[]
u16 actor57Talk3Conditions[]
u16 actor45Talk2Conditions[]
void endEvent660(void)
After event 660, with the player: clears flag 0x1C36.
u16 actor45Talk4Actions[]
u16 actor8Talk2Conditions[]
u16 actor13Talk1Actions[]
u16 actor55Talk0Conditions[]
u16 actor45Talk3Actions[]
void endEvent893(void)
After event 893, with Lisa, Nick, Keith and Teddy: moves the story on to STORY_WAY_TO_AMATERASU.
FieldActorEntry * stageActors[]
void endEvent895(void)
After event 895, with Lisa, Keith, Nick and Teddy: moves the story on to STORY_WAY_TO_AMATERASU.
u16 actor57Talk4Conditions[]
u16 actor39Talk1Conditions[]
void endEvent960(void)
After event 960, with Oinkmon: keeps it from playing again.
u16 actor37Talk0Conditions[]
u16 actor53Talk4Actions[]
void endEvent350(void)
After event 350, with Kail, Game Master and DO Guard: keeps it from playing again.
u16 actor35Talk1Conditions[]
u16 actor38Talk0Conditions[]
u16 actor55Talk3Conditions[]
u16 actor51Talk3Actions[]
u16 actor39Talk0Conditions[]
u16 actor57Talk2Actions[]
u16 actor47Talk3Conditions[]
u16 actor51Talk4Conditions[]
void endEvent661(void)
After event 661, with the player: moves the story on to STORY_GAME_MASTER_CAUGHT.
u16 actor13Talk0Conditions[]
u16 actor53Talk3Conditions[]
u16 actor35Talk0Actions[]
u16 actor57Talk1Actions[]
void endEvent890(void)
After event 890, with Lisa, Teddy, Keith and Nick: keeps it from playing again.
u16 actor57Talk4Actions[]
u16 actor53Talk1Actions[]
void setupStage(void)
Sets the stage up: its map, actors and events, playing KANRIBGM.
u16 actor40Talk0Actions[]
u16 actor53Talk0Conditions[]
u16 actor53Talk1Conditions[]
u16 actor55Talk4Actions[]
u16 actor45Talk3Conditions[]
u16 actor38Talk1Conditions[]
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
u16 actor57Talk3Actions[]
u16 actor41Talk0Conditions[]
u16 actor55Talk1Actions[]
u16 actor38Talk0Actions[]
u16 actor51Talk2Conditions[]
u16 actor41Talk1Conditions[]
u16 actor51Talk3Conditions[]
u16 actor55Talk2Actions[]
u16 actor47Talk1Conditions[]
u16 actor35Talk0Conditions[]
u16 actor53Talk3Actions[]
u16 actor37Talk0Actions[]
u16 actor8Talk4Conditions[]
u16 actor53Talk2Actions[]
AnimFrame updateSoundTileFrames[]
Defined below, after the code that uses them.
u16 actor51Talk1Actions[]
u16 actor57Talk2Conditions[]
u16 actor57Talk1Conditions[]
u16 actor47Talk4Conditions[]
u16 actor45Talk0Conditions[]
u16 actor53Talk2Conditions[]
u16 actor40Talk1Conditions[]
u16 actor13Talk1Conditions[]
u16 actor47Talk2Conditions[]
u16 actor37Talk1Conditions[]
u16 actor47Talk1Actions[]
u16 actor55Talk1Conditions[]
u16 actor45Talk4Conditions[]
u16 actor45Talk1Actions[]
u16 actor47Talk3Actions[]
void handleCommand850(StageSoundTile *task, s32 id)
Plays the sound and starts the animation when map object 0x335 is triggered.
u16 actor55Talk3Actions[]
u16 actor8Talk0Conditions[]
u16 actor51Talk4Actions[]