Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag640.c
Go to the documentation of this file.
1/*
2 * WSTAG640: Mobius Desert, West Sector: the looping part. Off WSTAG635: its
3 * exits loop back into itself, its other ways lead to WSTAG630 and 635.
4 */
5
6#include "common.h"
7#include "field/stage.h"
8/* Defined below, after the code that uses them */
12
14
16
18
20
22
23#define STAGE_CHILDREN_SIZE 4
25
26#if VERSION_US || VERSION_JP
27#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
28#define STAGE_FILE 0x490
29#elif VERSION_EU
30#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_06)
31#define STAGE_FILE 0x4A0
32#endif
33/* Sets the stage up: its map, actors and battles, playing the ambience ENV_0016 */
52
54 { 50, 8 }, { 51, 8 }, { 52, 8 }, { 53, 8 },
55 { 54, 8 }, { 55, 8 }, { 56, 8 }, { 57, 8 },
56 { 58, 8 }, { 59, 8 }, { 60, 8 }, { 82, 160 },
57 { 255, 0 },
58};
60 { 61, 8 }, { 62, 8 }, { 63, 8 }, { 64, 8 },
61 { 65, 8 }, { 66, 8 }, { 67, 8 }, { 68, 8 },
62 { 69, 8 }, { 70, 8 }, { 71, 8 }, { 82, 160 },
63 { 255, 0 },
64};
66 { 72, 8 }, { 73, 8 }, { 74, 8 }, { 75, 8 },
67 { 76, 8 }, { 77, 8 }, { 78, 8 }, { 79, 8 },
68 { 80, 8 }, { 81, 8 }, { 82, 160 }, { 255, 0 },
69};
70StagePoint placePoints1_1Point3 = { 0x258, 1, 1, 0x368, 0x2EC, 3, NULL };
71StagePoint placePoints1_1Point2 = { 0x258, 1, 3, 0x340, 240, 1, &placePoints1_1Point3 };
72StagePoint placePoints1_1Point1 = { 0x258, 1, 2, 0x110, 0x108, 7, &placePoints1_1Point2 };
73StagePoint placePoints1_1Point0 = { 0x257, 0, 0, 0x100, 0x278, 5, &placePoints1_1Point1 };
75StagePoint placePoints1_2Point3 = { 0x258, 1, 2, 0x368, 0x2EC, 3, NULL };
76StagePoint placePoints1_2Point2 = { 0x258, 1, 4, 0x340, 240, 1, &placePoints1_2Point3 };
77StagePoint placePoints1_2Point1 = { 0x258, 1, 1, 0x110, 0x108, 7, &placePoints1_2Point2 };
78StagePoint placePoints1_2Point0 = { 0x257, 0, 0, 0x100, 0x278, 5, &placePoints1_2Point1 };
80StagePoint placePoints1_3Point3 = { 0x258, 1, 4, 0x368, 0x2EC, 3, NULL };
81StagePoint placePoints1_3Point2 = { 0x258, 1, 5, 0x340, 240, 1, &placePoints1_3Point3 };
82StagePoint placePoints1_3Point1 = { 0x258, 1, 3, 0x110, 0x108, 7, &placePoints1_3Point2 };
83StagePoint placePoints1_3Point0 = { 0x258, 1, 1, 0x128, 0x2F4, 5, &placePoints1_3Point1 };
85StagePoint placePoints1_4Point3 = { 0x258, 1, 3, 0x368, 0x2EC, 3, NULL };
86StagePoint placePoints1_4Point2 = { 0x258, 1, 6, 0x340, 240, 1, &placePoints1_4Point3 };
87StagePoint placePoints1_4Point1 = { 0x258, 1, 4, 0x110, 0x108, 7, &placePoints1_4Point2 };
88StagePoint placePoints1_4Point0 = { 0x258, 1, 2, 0x128, 0x2F4, 5, &placePoints1_4Point1 };
90StagePoint placePoints1_5Point3 = { 0x258, 1, 5, 0x368, 0x2EC, 3, NULL };
91StagePoint placePoints1_5Point2 = { 0x258, 1, 7, 0x340, 240, 1, &placePoints1_5Point3 };
92StagePoint placePoints1_5Point1 = { 0x258, 1, 6, 0x110, 0x108, 7, &placePoints1_5Point2 };
93StagePoint placePoints1_5Point0 = { 0x258, 1, 3, 0x128, 0x2F4, 5, &placePoints1_5Point1 };
95StagePoint placePoints1_6Point3 = { 0x258, 1, 6, 0x368, 0x2EC, 3, NULL };
96StagePoint placePoints1_6Point2 = { 0x258, 1, 8, 0x340, 240, 1, &placePoints1_6Point3 };
97StagePoint placePoints1_6Point1 = { 0x258, 1, 5, 0x110, 0x108, 7, &placePoints1_6Point2 };
98StagePoint placePoints1_6Point0 = { 0x258, 1, 4, 0x128, 0x2F4, 5, &placePoints1_6Point1 };
100StagePoint placePoints1_7Point3 = { 0x258, 1, 8, 0x368, 0x2EC, 3, NULL };
101StagePoint placePoints1_7Point2 = { 0x258, 1, 1, 0x340, 240, 1, &placePoints1_7Point3 };
102StagePoint placePoints1_7Point1 = { 0x258, 1, 7, 0x110, 0x108, 7, &placePoints1_7Point2 };
103StagePoint placePoints1_7Point0 = { 0x258, 1, 5, 0x128, 0x2F4, 5, &placePoints1_7Point1 };
105StagePoint placePoints1_8Point3 = { 0x258, 1, 7, 0x368, 0x2EC, 3, NULL };
106StagePoint placePoints1_8Point2 = { 0x258, 1, 2, 0x340, 240, 1, &placePoints1_8Point3 };
107StagePoint placePoints1_8Point1 = { 0x258, 1, 8, 0x110, 0x108, 7, &placePoints1_8Point2 };
108StagePoint placePoints1_8Point0 = { 0x258, 1, 6, 0x128, 0x2F4, 5, &placePoints1_8Point1 };
129AreaBattle area1Battle0 = { 0, 0, MUSIC(1, 0) };
130AreaBattle area1Battle1 = { 0, 0, MUSIC(1, 0) };
131AreaBattle area1Battle2 = { 0, 0, MUSIC(1, 0) };
132AreaBattle area1Battle3 = { 0, 0, MUSIC(1, 0) };
133AreaBattle area1Battle4 = { 0, 0, MUSIC(1, 0) };
134AreaBattle area1Battle5 = { 0, 0, MUSIC(1, 0) };
135AreaBattle area1Battle6 = { 0, 0, MUSIC(1, 0) };
136AreaBattle area1Battle7 = { 0, 0, MUSIC(1, 0) };
142AreaBattle area2Battle0 = { 0, 0, MUSIC(1, 0) };
143AreaBattle area2Battle1 = { 0, 0, MUSIC(1, 0) };
144AreaBattle area2Battle2 = { 0, 0, MUSIC(1, 0) };
145AreaBattle area2Battle3 = { 0, 0, MUSIC(1, 0) };
146AreaBattle area2Battle4 = { 0, 0, MUSIC(1, 0) };
147AreaBattle area2Battle5 = { 0, 0, MUSIC(1, 0) };
148AreaBattle area2Battle6 = { 0, 0, MUSIC(1, 0) };
149AreaBattle area2Battle7 = { 0, 0, MUSIC(1, 0) };
155AreaBattle area3Battle0 = { 0, 0, MUSIC(1, 0) };
156AreaBattle area3Battle1 = { 0, 0, MUSIC(1, 0) };
157AreaBattle area3Battle2 = { 0, 0, MUSIC(1, 0) };
158AreaBattle area3Battle3 = { 0, 0, MUSIC(1, 0) };
159AreaBattle area3Battle4 = { 0, 0, MUSIC(1, 0) };
160AreaBattle area3Battle5 = { 0, 0, MUSIC(1, 0) };
161AreaBattle area3Battle6 = { 0, 0, MUSIC(1, 0) };
162AreaBattle area3Battle7 = { 0, 0, MUSIC(1, 0) };
172 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
173 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
174 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
175 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
176 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
177 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
178};
180 { 1, 3, 0xC8, 2, 0x48, 0, 0, 0, 0, 0, 384, 97, 0, 0 },
181 { 1, 3, 0xC8, 2, 0x48, 0, 0, 0, 0, 0, 384, 871, 0, 0 },
182 { 1, 3, 0xC8, 2, 0x48, 0, 0, 0, 0, 0, 916, 384, 0, 0 },
183 { 1, 0, 0x40, 2, 8, 1, 8, 0xD, 4, 0, 328, 532, 0, 0 },
184 { 1, 0, 0x40, 2, 8, 1, 8, 0xD, 4, 0, 375, 220, 0, 0 },
185 { 1, 0, 0x40, 2, 8, 1, 8, 0xD, 4, 0, 519, 660, 0, 0 },
186 { 1, 0, 0x40, 2, 8, 1, 8, 0xD, 4, 0, 536, 283, 0, 0 },
187 { 1, 0, 0x40, 2, 8, 1, 8, 0xD, 4, 0, 583, 454, 0, 0 },
188 { 1, 0, 0x40, 2, 8, 1, 8, 0xD, 4, 0, 711, 612, 0, 0 },
189 { 1, 0, 0x40, 2, 8, 1, 8, 0xD, 4, 0, 728, 267, 0, 0 },
190 { 1, 0, 0x40, 2, 8, 1, 8, 0xD, 4, 0, 791, 460, 0, 0 },
191 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 166, 937, 0, 0 },
192 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 171, 489, 0, 0 },
193 { 1, 1, 0x40, 6, 0x32, 0, 0, 0, 0, 0, 184, 363, 0, 0 },
194 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 335, 801, 0, 0 },
195 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 933, 296, 0, 0 },
196 { 1, 2, 0x40, 6, 0x3D, 0, 0, 0, 0, 0, 968, 498, 0, 0 },
197 { 1, 0, 0x60, 4, 0, 0, 0, 0, 0, 0, 724, 631, 721, 0 },
198 { 1, 0, 0x60, 4, 1, 0, 0, 0, 0, 0, 532, 679, 769, 0 },
199 { 1, 0, 0x60, 4, 2, 0, 0, 0, 0, 0, 340, 551, 641, 0 },
200 { 1, 0, 0x60, 4, 3, 0, 0, 0, 0, 0, 804, 479, 569, 0 },
201 { 1, 0, 0x60, 4, 4, 0, 0, 0, 0, 0, 596, 471, 562, 0 },
202 { 1, 0, 0x60, 4, 5, 0, 0, 0, 0, 0, 740, 287, 378, 0 },
203 { 1, 0, 0x60, 4, 6, 0, 0, 0, 0, 0, 548, 303, 393, 0 },
204 { 1, 0, 0x60, 4, 7, 0, 0, 0, 0, 0, 388, 239, 329, 0 },
205 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
206};
208 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x259, 0x358, 0xFC, 5, 0, 0, 0 },
209 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x259, 0x350, 0x2F8, 7, 0, 0, 0 },
210 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x259, 0x118, 0x2EC, 1, 0, 0, 0 },
211 { { { CODES_END, 0 }, { CODES_END, 0 } }, SLOT_EXIT, 0x259, 0x120, 0x100, 3, 0, 0, 0 },
212 { { { CODES_END, 0 }, { CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
213};
214void (*stageFuncs[])(void) = {
216};
#define NULL
Definition common.h:17
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
Definition field_map.h:85
#define SLOT_EXIT
The kinds of StageSlot (type).
Definition field_map.h:255
#define FIELD_MAP_AREAS
a cell's value: its battle area (FieldBattles), or 0
Definition field_map.h:87
#define FIELD_MAP_TRIGGERS
a cell's value: a direction (3 bits) and a StageSlot (5)
Definition field_map.h:88
FieldMap FIELDSTG_map
Definition fieldstg.c:3660
FieldState FIELDSTG_state
Definition fieldstg.c:2641
#define CODES_END
Definition game_state.h:83
#define MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
Definition sound.h:76
#define MUSIC_DESERT
ENV_0016: the West Sector's deserts and the Mirage Tower.
Definition sound.h:132
#define MUSIC(bank, n)
A field's or a battle's music (FieldState.music, Battle.music): track (SEP) n of the first sequence o...
Definition sound.h:70
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
Definition sound.h:148
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
One frame of a sprite animation; frame 0xFF ends it (or loops it)
Definition gfx.h:296
A battle of an area's BattleList, which can start on the field (see FIELDSTG_startEncounter); FIGHTST...
Definition field_map.h:402
The battles of an area of the map (its cells' value at FieldMap.files[4]), one picked at random.
Definition field_map.h:411
The battles of a place (FieldState.battles), by area of the map: the fourth area's are also the ones ...
Definition field_map.h:422
void(* setFile)(s32 index, s32 file)
FIELDSTG_setMapFile.
Definition field_map.h:100
void(* setFirstMap)(s32 index)
FIELDSTG_setFirstMap: the map the player starts on (GAME.mapIndex), when the mode is new.
Definition field_map.h:104
s32 sheetEntry
the stage's sprite sheet, loaded before the field starts, or 0
Definition field_map.h:445
s32 soundBank
SOUND.loadBank's, or 0.
Definition field_map.h:459
StageTile * objects
the map objects, up to the first margin 0
Definition field_map.h:446
s32 imageFile
or an image archive file, or 0
Definition field_map.h:449
FieldBattles * battles
Definition field_map.h:450
Vec2 start
where the player starts
Definition field_map.h:456
StageSlot * slots
up to the first type 0
Definition field_map.h:447
ActorImage * actors
then the actors', from actors[2]
Definition field_map.h:454
s32 mapFile
the file of the map's tiles (FIELDSTG_createMapStreamer)
Definition field_map.h:444
s32 startDir
and its direction
Definition field_map.h:457
s32 textFile
the stage's text file, for the talks
Definition field_map.h:461
union FieldState::@12 images
s32 music
SOUND.playSound's, or 0.
Definition field_map.h:460
Where an exit (StageSlot) leads: copyPlacePoints copies a place's points to the stage's first slots,...
Definition stage.h:50
The points of a place (GAME.place and GAME.placeArg, which the exit the player came through set)
Definition stage.h:62
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
Definition field_map.h:276
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
Definition gfx.h:352
AreaBattle area2Battle7
Definition wstag640.c:149
StagePoints placePoints1_5
Definition wstag640.c:94
StagePoint placePoints1_7Point3
Definition wstag640.c:100
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
Definition wstag640.c:214
AnimFrame updateTileAnimsFrames2[]
Definition wstag640.c:65
StagePoint placePoints1_3Point3
Definition wstag640.c:80
StagePoints placePoints1_7
Definition wstag640.c:104
StagePoint placePoints1_1Point0
Definition wstag640.c:73
StagePoint placePoints1_5Point3
Definition wstag640.c:90
AreaBattle area2Battle6
Definition wstag640.c:148
StagePoint placePoints1_5Point2
Definition wstag640.c:91
StagePoint placePoints1_7Point0
Definition wstag640.c:103
StagePoints placePoints1_2
Definition wstag640.c:79
StagePoint placePoints1_8Point1
Definition wstag640.c:107
AreaBattle area1Battle6
Definition wstag640.c:135
StagePoint placePoints1_6Point2
Definition wstag640.c:96
StagePoint placePoints1_5Point0
Definition wstag640.c:93
AreaBattle area0Battle7
Definition wstag640.c:123
AreaBattle area3Battle4
Definition wstag640.c:159
AreaBattle area3Battle3
Definition wstag640.c:158
StagePoint placePoints1_3Point0
Definition wstag640.c:83
AreaBattle area0Battle1
Definition wstag640.c:117
StagePoint placePoints1_2Point0
Definition wstag640.c:78
AreaBattle area2Battle0
Definition wstag640.c:142
StagePoints placePoints1_8
Definition wstag640.c:109
AreaBattle area1Battle2
Definition wstag640.c:131
StagePoint placePoints1_2Point2
Definition wstag640.c:76
AreaBattle area3Battle0
Definition wstag640.c:155
AreaBattle area0Battle6
Definition wstag640.c:122
AreaBattle area3Battle2
Definition wstag640.c:157
StagePoint placePoints1_4Point1
Definition wstag640.c:87
StagePoint placePoints1_4Point3
Definition wstag640.c:85
StagePoint placePoints1_6Point3
Definition wstag640.c:95
StagePoint placePoints1_2Point3
Definition wstag640.c:75
AreaBattle area3Battle1
Definition wstag640.c:156
StagePoint placePoints1_1Point2
Definition wstag640.c:71
AreaBattle area0Battle3
Definition wstag640.c:119
AreaBattle area3Battle6
Definition wstag640.c:161
AnimFrame updateTileAnimsFrames1[]
Definition wstag640.c:59
StagePoint placePoints1_6Point1
Definition wstag640.c:97
StagePoints placePoints1_1
Definition wstag640.c:74
StagePoint placePoints1_1Point1
Definition wstag640.c:72
ActorImage stageImages[]
Definition wstag640.c:171
void setupStage(void)
Sets the stage up: its map, actors and battles, playing the ambience ENV_0016.
Definition wstag640.c:34
StagePoints * placePoints[]
Names some stages define.
Definition wstag640.c:111
AreaBattle area2Battle4
Definition wstag640.c:146
StagePoint placePoints1_8Point3
Definition wstag640.c:105
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Definition wstag640.c:179
StagePoint placePoints1_5Point1
Definition wstag640.c:92
StagePoint placePoints1_4Point2
Definition wstag640.c:86
BattleList area3Battles
Definition wstag640.c:163
AreaBattle area3Battle5
Definition wstag640.c:160
AreaBattle area0Battle5
Definition wstag640.c:121
BattleList area1Battles
Definition wstag640.c:137
StagePoints placePoints0_0
Definition wstag640.c:110
StagePoint placePoints1_7Point1
Definition wstag640.c:102
StagePoint placePoints1_2Point1
Definition wstag640.c:77
BattleList area2Battles
Definition wstag640.c:150
StagePoint placePoints1_4Point0
Definition wstag640.c:88
AreaBattle area1Battle4
Definition wstag640.c:133
AreaBattle area2Battle2
Definition wstag640.c:144
AreaBattle area1Battle5
Definition wstag640.c:134
StagePoint placePoints1_3Point1
Definition wstag640.c:82
StageSlot stageSlots[]
Definition wstag640.c:207
AreaBattle area2Battle1
Definition wstag640.c:143
StagePoints placePoints1_4
Definition wstag640.c:89
AreaBattle area1Battle3
Definition wstag640.c:132
AreaBattle area1Battle0
Definition wstag640.c:129
StagePoint placePoints1_1Point3
Definition wstag640.c:70
StagePoint placePoints1_8Point0
Definition wstag640.c:108
AnimFrame updateTileAnimsFrames0[]
Defined below, after the code that uses them.
Definition wstag640.c:53
AreaBattle area0Battle0
Definition wstag640.c:116
AreaBattle area0Battle2
Definition wstag640.c:118
#define STAGE_FILE
Definition wstag640.c:31
AreaBattle area2Battle5
Definition wstag640.c:147
AreaBattle area1Battle1
Definition wstag640.c:130
StagePoint placePoints1_6Point0
Definition wstag640.c:98
AreaBattle area2Battle3
Definition wstag640.c:145
StagePoint placePoints1_8Point2
Definition wstag640.c:106
StagePoint placePoints1_7Point2
Definition wstag640.c:101
AreaBattle area0Battle4
Definition wstag640.c:120
#define STAGE_TEXT
Definition wstag640.c:30
StagePoint placePoints1_3Point2
Definition wstag640.c:81
StagePoints placePoints1_6
Definition wstag640.c:99
AreaBattle area3Battle7
Definition wstag640.c:162
BattleList area0Battles
Definition wstag640.c:124
AreaBattle area1Battle7
Definition wstag640.c:136
StagePoints placePoints1_3
Definition wstag640.c:84
FieldBattles stageBattles[]
Definition wstag640.c:168