64 switch (task->
state) {
68 for (i = 0; i < 20; i++) {
85#define STAGE_CHILDREN_SIZE 0x58
111#if VERSION_US || VERSION_JP
112#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
113#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
114#define STAGE_FILE 0x6C0
116#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
117#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
118#define STAGE_FILE 0x6CF
206 { 68, 0, 0x11B, 0x154 },
207 { 68, 0, 0x13C, 0x1C4 },
208 { 68, 0, 0x15C, 0x1F4 },
209 { 68, 0, 0x15C, 0x234 },
210 { 68, 0, 0x1BC, 0x104 },
211 { 68, 0, 0x1BC, 0x184 },
212 { 68, 0, 0x1DC, 0x1B4 },
213 { 68, 0, 0x1DC, 0x2B4 },
214 { 68, 0, 0x1FC, 0x224 },
215 { 68, 0, 0x1FC, 0x264 },
216 { 68, 0, 0x23C, 0x144 },
217 { 68, 0, 0x25C, 0x1B4 },
218 { 68, 0, 0x27C, 0x224 },
219 { 68, 0, 0x29C, 0x294 },
220 { 68, 0, 0x2BC, 0x2C4 },
221 { 68, 0, 0x2DC, 0x234 },
222 { 68, 0, 0x2FC, 0x1A4 },
223 { 68, 0, 0x31C, 0x1D4 },
224 { 68, 0, 0x31C, 0x214 },
225 { 20, 0, 0x3AC, 0x2A4 },
228 { 0, 6 }, { 1, 6 }, { 2, 68 }, { 1, 4 },
229 { 0, 4 }, { 255, 0 },
232 { 0x12C, 18 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
233 { 4, 6 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
234 { 5, 4 }, { 6, 4 }, { 7, 4 }, { 5, 4 },
235 { 6, 4 }, { 7, 4 }, { 5, 4 }, { 6, 4 },
236 { 7, 4 }, { 4, 4 }, { 3, 4 }, { 2, 4 },
237 { 1, 4 }, { 255, 0x3E7 },
295 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
296 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
297 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
298 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
299 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
300 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
301 { 0x140, 0x100, 0x178, 0x100, 0xE0, 0, 0x170, 0x1FB },
302 { 0x140, 0x100, 0x170, 0x180, 0xC0, 0x80, 0x150, 0x1FA },
303 { 0x140, 0x100, 0x140, 0x160, 0, 0x60, 0x160, 0x1FA },
382 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 208, 361, 0, 0 },
383 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 240, 473, 0, 0 },
384 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 368, 409, 0, 0 },
385 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 400, 521, 0, 0 },
386 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 432, 633, 0, 0 },
387 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 496, 345, 0, 0 },
388 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 528, 457, 0, 0 },
389 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 560, 569, 0, 0 },
390 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 592, 681, 0, 0 },
391 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 656, 393, 0, 0 },
392 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 688, 505, 0, 0 },
393 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 720, 617, 0, 0 },
394 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 752, 729, 0, 0 },
395 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 848, 553, 0, 0 },
396 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
399 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x2D3, 0xD0, 0x33C, 5, 0, 0, 0 },
400 { { {
FLAG_DARK_MASTER_WIN_SEEN, 0 }, {
SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA, 0 } },
SLOT_EVENT, 0x511, 0, 0, 0, 0, 0, 0 },
401 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x1F40, 0, 0, 0, 0, 0, 0 },
402 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x1F41, 0, 0, 0, 0, 0, 0 },
403 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x1F42, 0, 0, 0, 0, 0, 0 },
404 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
405 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
406 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
407 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
408 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
409 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
410 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
411 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
412 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
413 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
414 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
415 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
416 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
417 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
418 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
419 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
420 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
421 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
422 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2D4, 0x3C0, 0x2B0, 7, 0, 0, 0 },
423 { { {
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 SLOT_LAUNCH
sends the player flying (FIELDSTG_launchActor)
#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 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 FIELD_MAP_AREAS
a cell's value: its battle area (FieldBattles), or 0
#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 EVENT_BATTLE(id)
action: FIELDSTG_battleFuncs.startEventBattle
#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...
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 MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
#define MUSIC_DUNGEON
BGM_0023: the Ice, Fire and Dark Dungeons.
#define MUSIC(bank, n)
A field's or a battle's music (FieldState.music, Battle.music): track (SEP) n of the first sequence o...
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
#define MUSIC_BOSS_1
BOSS_001: the Digimon Arena's, the cities', the dungeons' and the A.o.A's boss battles.
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
#define FLAG_DARK_MASTER_WIN_SEEN
wstag746 event 1297: Dark Master loses and gives the EXP Adaptor; set at its end, tested 0 to start i...
@ 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_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
#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_JUNGLE_SOUND_TO_BLACK_ID_PASS
GAME.progress is from STORY_JUNGLE_SOUND to STORY_BLACK_ID_PASS (PROGRESS_RANGES[0x15])
#define SPECIAL_STORY_SINCE_KNIGHTMON_REPROGRAMMED
GAME.progress is STORY_KNIGHTMON_REPROGRAMMED or later (PROGRESS_RANGES[8], to 0x63)
#define SPECIAL_SHOW_ITEM_GET_ICON
an action: the player's icon plays its animation 3 with SOUND_ITEM_GET (FIELD_COMMAND_ICON3); the tal...
#define FLAG_DARK_DUNGEON_HAZARD_ARMOR_FOUND
wstag746: chest that gives the Hazard Armor, "I got" text; its conditions test it 0
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 battle of an area's BattleList, which can start on the field (see FIELDSTG_startEncounter); FIGHTST...
The battles of an area of the map (its cells' value at FieldMap.files[4]), one picked at random.
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
The battles of a place (FieldState.battles), by area of the map: the fourth area's are also the ones ...
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)
void(* setState)(struct StageTask *task, s32 state)
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
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.
void updateDarkness(StageTask *task)
The darkness: the screen drawn black (a white quad subtracted from it, blend mode 2) while in TASK_DO...
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
u16 actor3Talk3Conditions[]
u16 actor4Talk3Conditions[]
void endEvent1297(void)
After event 1297, with Dark Master: starts the stage's event battle 0 and keeps it from playing again...
void * startEvent8001(void)
Brings the darkness back (TASK_DONE)
AnimFrame effectClutFrames[]
u16 actor3Talk0Conditions[]
FieldActorEntry * stageActors[]
void * startEvent8002(void)
Lifts the darkness and starts its countdown back (TASK_RUN, key1 = 1)
u16 actor4Talk1Conditions[]
u16 actor3Talk2Conditions[]
u16 actor3Talk1Conditions[]
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing BGM_0023, with the Dark Dungeon's dar...
u16 actor4Talk0Conditions[]
StageEffectSpot updateStageSpots[]
Defined below, after the code that uses them.
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
void * createDarkness(void)
Creates the darkness task (id 0x19)
void * startEvent8000(void)
Lifts the darkness (TASK_RUN)
void endEvent1298(void)
After event 1298, with Dark Master: gives the player the EXP Adapter and keeps it from playing again.
u16 actor4Talk2Conditions[]
FieldBattles stageBattles[]