Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
field_mode.h
Go to the documentation of this file.
1#ifndef FIELDSTG_H
2#define FIELDSTG_H
3
4/*
5 * FIELDSTG.PRO: the field mode, where the player walks around the map.
6 *
7 * The stage overlays (AAA/PRO/WSTAG###.PRO, see stage.h) load on top of it
8 * at 0x800A4CA4 and call into it; what they and the executable use of it is
9 * in field_map.h. This header has the rest: the types, by the module
10 * (in src/field/field_mode) that owns them, in an order that defines each before
11 * its use; the functions, by module in the order they link; and the data
12 * (data/fieldstg.c) in its order.
13 */
14
15#include "engine/game.h"
16#include "field/field_map.h"
17
18/* Names the functions of the src/shared files it shares */
19#define OVL_NAME(name) FIELDSTG_##name
20
21/* --- Shared: the types several modules use --- */
22
23/* Where the field keeps its textures in VRAM: the two images of
24 FIELD_SPRITES_FILE (its entries 2 and 3, for the sprite sheets of its
25 entries 0 and 1), the stage's map objects (FIELDSTG_loadFieldFiles) and a
26 cutscene's frames (FIELDSTG_playCutsceneAnim) */
27#define FIELD_SPRITES_X 0x200
28#define FIELD_SPRITES2_X 0x240
29#define FIELD_SPRITES_Y 0x100
30#define FIELD_OBJECTS_X 0x140
31#define FIELD_OBJECTS_Y 0x100
32#define FIELD_OBJECTS_CLUT_Y 0x1F0
33#define FIELD_CUTSCENE_X 0x280
34#define FIELD_CUTSCENE_CLUT_Y 0xF0
35#define FIELD_MENU_SPRITES_X 0x140 /* the executable's FILE_MENU_SPRITES */
36
37/*
38 * The sounds only FIELDSTG plays (SOUND.playSound), by their SOUNDTST names.
39 * Those that other overlays play too are in engine/sound.h.
40 */
41#define SOUND_DIG_DEMO 0x40003
42#define SOUND_DIGIMENT 0x40004 /* a warp's effect */
43#define SOUND_ENCOUNTS 0x40005 /* the transition to a battle */
44#define SOUND_FUKIDASH 0x40007 /* a balloon */
45#define SOUND_ITEM_GET 0x40009
46#define SOUND_PIYOPIYO 0x40013
47#define SOUND_SAVEDEMO 0x40015
48#define SOUND_SUB_DEMO 0x40018
49#define SOUND_BULB_003 0x440001
50#define SOUND_TRAP_OFF 0x700001
51#define SOUND_INFO_SIG 0xB80001
52#define SOUND_BM_ERASE 0x1100000
53#define SOUND_LD_ERASE 0x1100002
54#define SOUND_DEMO_BGM 0x60040002
55#define SOUND_COMCD111 0x80042DC7
56#define SOUND_COMCD201 0x800430BD
57#define SOUND_PLAYER00 0x8004583C
58#define SOUND_PLAYER01 0x800458BD
59#define SOUND_PLAYER02 0x8004593E
60#define SOUND_PLAYER08 0x80045C44
61#define SOUND_PLAYER09 0x80045CC5
62#define SOUND_PLAYER10 0x80045D46
63#define SOUND_TRESUREB 0x80045DC7
64#define SOUND_DIG_MOVE 0x80045FCB
65#define SOUND_MASK_SET 0x803C503C
66#define SOUND_BEAM_SHT 0x805458BD
67#define SOUND_WEAR_OFF 0x80E8383C
68#define SOUND_SN_ENTRY 0x8110303C
69#define SOUND_SN_ERASE 0x81103240
70#define SOUND_COMCD203 0xA00431BF /* held while the camera shakes */
71#define SOUND_SUB_MOVE 0xA0045F4A /* held */
72#define SOUND_BEAM_HIT 0xA054583C /* held */
73#define SOUND_TRAP_ICE 0xA064683C /* held */
74#define SOUND_GAYALOOP 0xA10C703C /* held */
75
76/* --- actor.c --- */
77
78/* The animation sets that the actions play (FIELDSTG_setActorAnim), by the
79 substate that plays them */
80#define ACTOR_ANIM_STAND 1
81#define ACTOR_ANIM_WALK 4
82#define ACTOR_ANIM_RUN 5
83#define ACTOR_ANIM_STOP 6
84#define ACTOR_ANIM_SEARCH 8
85#define ACTOR_ANIM_GAUGE_START 0x11
86#define ACTOR_ANIM_GAUGE_RESULT 0x12 /* after the game, with a balloon */
87#define ACTOR_ANIM_GAUGE_PLAY 0x13 /* with PLAYER09 */
88#define ACTOR_ANIM_GAUGE_WAIT 0x14 /* with PLAYER10, until the game ends */
89#define ACTOR_ANIM_GAUGE_END 0x15
90#define ACTOR_ANIM_DROP_OFF 0x16
91#define ACTOR_ANIM_FALL 0x17
92#define ACTOR_ANIM_FALL_FAR 0x18 /* once the fall is more than 0x1800 */
93#define ACTOR_ANIM_LAND 0x19
94#define ACTOR_ANIM_CLIMB_UP 0x1A
95#define ACTOR_ANIM_CLIMB_DOWN 0x1B
96#define ACTOR_ANIM_GET_ON_WALL 0x1C
97#define ACTOR_ANIM_CLIMB_OFF_TOP 0x1D
98#define ACTOR_ANIM_GET_OVER_EDGE 0x1E
99#define ACTOR_ANIM_CLIMB_OFF_BOTTOM 0x1F
100#define ACTOR_ANIM_CLIMB 0x20
101#define ACTOR_ANIM_OPEN 0x41 /* a treasure's, when it is talked to */
102#define ACTOR_ANIM_USE 0x45
103#define ACTOR_ANIM_USED 0x54 /* the object's */
104
105/*
106 * Flight (FIELDSTG_controlFlight, FIELDSTG_checkFlightProbe): an actor's z
107 * against the floor map's cells. Cell 1 is open; a wall, cell n from 2 to
108 * 6, stands up to FLIGHT_LEVEL(n); a ceiling, cell 24 - n from 18 to 22,
109 * hangs from FLIGHT_LEVEL(n) up.
110 */
111#define FLIGHT_OPEN 1
112#define FLIGHT_WALL(n) (n)
113#define FLIGHT_CEILING(n) (24 - (n))
114#define FLIGHT_LEVEL(n) ((n) << 12) /* n * 16 pixels, in z's 1/256 pixels */
115#define FLIGHT_LANDING 0xC /* how far above a wall's top a descent stops */
116#define FLIGHT_Z_MIN 0x1800
117#define FLIGHT_Z_MAX 0x7000
118#define FLIGHT_SPEED_MAX 0x200
119#define FLIGHT_SPEED_MAX_PAL 0x266 /* FLIGHT_SPEED_MAX * 6 / 5, for 50 frames a second */
120
121/* Actor and its substates (ACTOR_POSED...) are in field_map.h, where the stages see them too */
122
123/* The last TRAIL_STEPS steps of the actor that another one follows
124 (Actor.trail), a ring from tail to head */
125#define TRAIL_STEPS 64 /* a power of two */
126
127typedef struct TrailStep {
128 /* 0x0 */ s32 x;
129 /* 0x4 */ s32 y;
130 /* 0x8 */ s32 dir;
131} TrailStep;
132
133typedef struct Trail {
134 /* 0x000 */ Actor *leader;
135 /* 0x004 */ s32 head;
136 /* 0x008 */ s32 tail;
138} Trail;
139
140/* The children of an actor (FIELDSTG_updateActor) */
141typedef struct ActorChildren {
142 /* 0x0 */ struct ActorIcon *icon; /* FIELDSTG_createActorIcon's */
143 /* 0x4 */ struct Balloon *balloon; /* FIELDSTG_createBalloon's */
144 /* 0x8 */ void *action; /* a gauge game or a launch */
145 /* 0xC */ struct Speech *speech; /* FIELDSTG_createTalk's */
147
148/* --- actor_icon.c --- */
149
150/* An offset of the icon from the player's tile along a climb over an edge
151 (FIELDSTG_iconPath), x away from the climb's side */
152typedef struct IconOffset {
153 /* 0x0 */ s16 x;
154 /* 0x2 */ s16 y;
155} IconOffset;
156
157/* The player's icon (FIELD_TASK_ICON, FIELDSTG_createActorIcon): the field
158 commands FIELD_COMMAND_ICON1 to 3 and a special condition set its
159 substate, the animation it plays */
160typedef struct ActorIcon {
162 /* 0x50 */ Actor *actor;
163 /* 0x54 */ s32 frame;
164 /* 0x58 */ s32 animStep;
165 /* 0x5C */ s32 animTime;
166 /* 0x60 */ u8 (*anim)[2]; /* (frame, time) pairs; 0xFF loops to a step */
167} ActorIcon;
168
169/* --- balloon.c --- */
170
171/* A balloon over an actor's head (FIELDSTG_createBalloon): it pops up, plays its
172 FIELDSTG_triggerAnims row (key2) and pops down when closed */
173typedef struct Balloon {
175 /* 0x50 */ Actor *actor; /* the player when NULL */
176 /* 0x54 */ s32 popStart; /* the pop-up's sprites, times 4: it opens from here */
177 /* 0x58 */ s32 popOpen; /* to here */
178 /* 0x5C */ s32 popEnd; /* and closes to here */
179 /* 0x60 */ s32 pop; /* the pop-up's sprite, times 4 */
180 /* 0x64 */ s32 frame; /* into its FIELDSTG_triggerAnims row */
181 /* 0x68 */ s32 time;
182} Balloon;
183
184/* A character that another answers for when the player talks to it
185 (FIELDSTG_talkToActorAt, FIELDSTG_standIns) */
186typedef struct StandIn {
187 /* 0x0 */ s16 character; /* Actor.key1 */
188 /* 0x2 */ s16 answerer; /* the key1 of the actor that answers */
189} StandIn;
190
191/* --- speech.c --- */
192
193/* A message box, or a talk box that follows an actor (FIELDSTG_createSpeech,
194 FIELDSTG_createTalk) */
195typedef struct Speech {
197 /* 0x50 */ Actor *actor;
198 /* 0x54 */ s32 entry; /* the text's entry */
199 /* 0x58 */ s32 type; /* the talk box's (createTalkBox), its corner */
200 /* 0x5C */ s32 isMessage; /* a message box */
201 /* 0x60 */ void *text; /* FILE_CACHE.getEntry's */
202} Speech;
203
204/* --- launch.c --- */
205
206/* Launches an actor, spinning, from the nearest launcher (FIELD_TASK_LAUNCHER)
207 to a tile (FIELDSTG_createLaunch, Actor.launch) */
208typedef struct Launch {
210 /* 0x50 */ Actor *actor;
211 /* 0x54 */ SlotDest *dest; /* the tile it lands on */
212 /* 0x58 */ Task *from; /* the nearest FIELD_TASK_LAUNCHER */
213 /* 0x5C */ Vec2 start;
214 /* 0x64 */ Vec2 dist;
215 /* 0x6C */ s32 negX;
216 /* 0x70 */ s32 negY;
217} Launch;
218
219/* --- gauge.c --- */
220
221/* A gauge game (FIELDSTG_createGauge, FIELDSTG_runGauge) */
222#define GAUGE_ROWS 8 /* the random rows of FIELDSTG_gaugeRows */
223#define GAUGE_EMPTY_ROW 8 /* the European version's, all zeros */
224#define GAUGE_CURSOR_MAX 0x3000 /* the row's 48 pixels, in 1/256 pixels */
225#define GAUGE_START_DELAY 0x5A /* frames before the cursor runs */
226#define GAUGE_RESULT_DELAY 0x3C /* frames on the stopped cursor */
227#define GAUGE_X 0x18 /* where it is drawn, on the screen */
228#define GAUGE_Y 0xC0
229#define GAUGE_FRAME 0x3C /* its sprites, of FIELD_SPRITES_FILE's sheet 1 */
230#define GAUGE_CURSOR_FRAME 0x3D
231#define GAUGE_ROW_FRAMES 0x3E /* + the row */
232
233/* The steps of a running gauge */
234#define GAUGE_RUNNING 0 /* until cross is pressed */
235#define GAUGE_STOPPING 1
236#define GAUGE_STOPPING_SLOWLY 2 /* one time in four */
237#define GAUGE_STOPPED 3
238
239typedef struct GaugeGame {
241 /* 0x50 */ Vec2 pos;
242 /* 0x58 */ s32 row; /* of FIELDSTG_gaugeRows */
243 /* 0x5C */ s32 cursor; /* along the row, 0-GAUGE_CURSOR_MAX */
244 /* 0x60 */ s32 speed;
245 /* 0x64 */ s32 back; /* the cursor goes back */
246} GaugeGame;
247
248/* --- camera.c --- */
249
250/* The camera (FIELD_TASK_CAMERA, FIELDSTG_createCamera): it centers the field's
251 layer on an actor or a spot, panning there unless it snaps, and shakes */
252typedef struct Camera {
254 /* 0x50 */ Actor *target; /* the actor it follows (substate 0) */
255 /* 0x54 */ Vec2 center; /* where it looks */
256 /* 0x5C */ s32 shaking;
257 /* 0x60 */ s32 shake; /* the step of the shake, 0-3 */
258 /* 0x64 */ s16 voice; /* of the shaking sound, or -1 */
259 /* 0x68 */ Vec2 pan; /* where it looks while it pans to center */
260 /* 0x70 */ s32 hasBounds;
261 /* 0x74 */ Vec2 bounds; /* the map's size */
262 /* 0x7C */ s32 unk7C; /* cleared with each new target; nothing reads it */
263 /* 0x80 */ s32 snap; /* goes to center at once instead of panning */
264 /* 0x84 */ s32 targetId; /* the target's character (Actor.key1) */
265 /* 0x88 */ s32 spotX; /* the spot it looks at (substate 1) */
266 /* 0x8C */ s32 spotY;
267} Camera;
268
269/* --- event.c --- */
270
271/*
272 * An event (FIELDSTG_runEvent, made by FIELDSTG_startEvent): it runs a script
273 * of 16-bit words, each command a word of its kind << 8 | its variant followed
274 * by its arguments, until a command waits; or, without a script, a task of
275 * its own (start) until it ends.
276 */
277typedef struct EventTask {
279 /* 0x050 */ s32 event; /* its id */
280 /* 0x054 */ s16 *pc;
281 /* 0x058 */ void *(*start)(void);
282 /* 0x05C */ void (*end)(void);
283 /* 0x060 */ s32 wait; /* frames left of a wait command */
284 /* 0x064 */ struct {
285 s32 id; /* 0 ends the list */
286 struct Actor *actor;
287 } entries[30]; /* the characters, held while the event runs */
288} EventTask;
289
290/* The children of an EventTask */
291typedef struct EventChildren {
292 /* 0x00 */ struct Task *task; /* start's */
293 /* 0x04 */ struct Speech *boxes[3]; /* the script's message boxes */
294 /* 0x10 */ s32 scripts[10]; /* FIELDSTG_createScriptCommand's tasks */
296
297/* --- script.c --- */
298
299/* An entry of the script command table FIELDSTG_scriptCommands (ids from 0x320) */
300typedef struct ScriptCommand {
301 /* 0x0 */ s32 id;
302 /* 0x4 */ s32 (*create)(s32 id); /* creates the command's task; FIELDSTG's own return
303 nothing or a Lift, so the table casts them */
304 /* 0x8 */ void (*handle)(); /* (task, command, arg): each command's task has its own type */
306
307/* A wait timer for the scripts (FIELDSTG_waitScriptTime) */
308typedef struct ScriptTimer {
309 /* 0x0 */ s32 time;
310 /* 0x4 */ s32 active;
311 /* 0x8 */ void (*reset)(void);
312 /* 0xC */ Actor *(*findActor)(s32 character);
314
315/* --- lift.c --- */
316
317/* Lift is in field_map.h: WSTAG261 and WSTAG934 have a copy of the lift */
318
319/* --- story.c --- */
320
321/* The story events of the field (FIELDSTG_createStoryEvents) */
322typedef struct StoryEvents {
324 /* 0x50 */ void *owner; /* the field's task, as a stage's init gets it */
325 /* 0x54 */ s32 script; /* the script to run next, or 0 */
327
328typedef struct StoryEventsChildren {
329 /* 0x0 */ Lift *lift;
330 /* 0x4 */ EventTask *script;
332
333/* A story event (FIELDSTG_progressEvents): at a progress, while a flag is clear and a
334 condition holds, a script runs, and then another one */
335typedef struct ProgressEvent {
336 /* 0x0 */ s32 progress; /* -1 ends the list */
337 /* 0x4 */ s32 flag;
338 /* 0x8 */ s32 condition;
339 /* 0xC */ s16 script;
340 /* 0xE */ s16 nextScript;
342
343/* --- choice.c --- */
344
345/* A yes/no question of the story (FIELDSTG_runChoice); its children are a
346 ChoiceChildren (field_map.h) */
347typedef struct ChoiceTask {
349 /* 0x50 */ s32 type; /* FIELDSTG_choices's */
350 /* 0x54 */ s32 selection;
351 /* 0x58 */ PanelAnim tween; /* the panel's width */
352} ChoiceTask;
353
354/* A question of a ChoiceTask */
355typedef struct ChoiceText {
356 /* 0x0 */ s32 text; /* the file counted from TEXT_FILE(1) << 16 | its
357 entry: the question, then the answers */
358 /* 0x4 */ s16 events[2]; /* FIELDSTG_startEvent's, for each answer */
359} ChoiceText;
360
361/* --- cutscene.c --- */
362
363/* A cutscene's animation over the field (FIELDSTG_createCutsceneAnim) */
364typedef struct CutsceneAnim {
366 /* 0x50 */ s32 kind; /* 0: file 0x88C (0x87B in the USA), 1: file 0x88D (0x87C) */
367 /* 0x54 */ s32 frame;
368 /* 0x58 */ s32 index; /* into the animation */
369 /* 0x5C */ s32 timer;
370 /* 0x60 */ s32 frame2; /* kind 1's second animation */
371 /* 0x64 */ s32 index2;
372 /* 0x68 */ s32 timer2;
374
375/* The two animations of FIELDSTG_playCutsceneAnim, kind 0's file and kind 1's after it:
376 the discs number their files differently */
377#if VERSION_US || VERSION_JP
378#define FIELD_ANIM_FILE 0x87B
379#elif VERSION_EU
380#define FIELD_ANIM_FILE 0x88C
381#endif
382
383/* --- effect.c --- */
384
385/* An animation of an FieldEffect (FIELDSTG_stepEffectAnim) */
386typedef struct EffectAnim {
387 /* 0x0 */ s32 active;
388 /* 0x4 */ AnimState anim;
389} EffectAnim;
390
391/* An effect of up to four animations at a spot (FIELDSTG_createEffect) */
392typedef struct FieldEffect {
394 /* 0x50 */ s32 x;
395 /* 0x54 */ s32 y;
396 /* 0x58 */ s16 set; /* the row of FIELDSTG_effectAnims */
397 /* 0x5C */ EffectAnim anims[4];
399
400/* --- map.c --- */
401
402/* A rectangle, edges included */
403typedef struct Box {
404 /* 0x0 */ s32 left;
405 /* 0x4 */ s32 right;
406 /* 0x8 */ s32 top;
407 /* 0xC */ s32 bottom;
408} Box;
409
410/* --- stream.c --- */
411
412/* A sprite of a StreamTask's frame */
413typedef struct StreamSprite {
414 /* 0x00 */ s32 visible;
415 /* 0x04 */ s32 x;
416 /* 0x08 */ s32 y;
417 /* 0x0C */ s32 u;
418 /* 0x10 */ s32 v;
419 /* 0x14 */ s32 w;
420 /* 0x18 */ s32 h;
422
423/* A task that reads the frames of a file from the disc (FIELDSTG_createStream) */
424typedef struct StreamTask {
426 /* 0x050 */ s32 time;
427 /* 0x054 */ s32 loadedTime; /* when its read ended, 0 while reading */
428 /* 0x058 */ s32 frame;
429 /* 0x05C */ s32 sector;
430 /* 0x060 */ s32 file;
431 /* 0x064 */ s32 frameSectors;
432 /* 0x068 */ void *buffer;
433 /* 0x06C */ s32 loaded;
434 /* 0x070 */ s32 loadedSlot; /* the slot its image is loaded into, or -1 */
435 /* 0x074 */ s32 imageX;
436 /* 0x078 */ s32 imageY;
437 /* 0x07C */ s32 clutX;
438 /* 0x080 */ s32 clutY;
439 /* 0x084 */ StreamSprite sprites[3][5];
440 /* 0x228 */ s32 slot;
441 /* 0x22C */ Decompressor *source; /* what it reads its sprites from (FIELDSTG_setStreamSource) */
442 /* 0x230 */ s32 *data; /* the decompressed tile: its sprites, then its image */
443 /* 0x234 */ void (*seek)(struct StreamTask *task, s32 frame, s32 size);
444 /* 0x238 */ s32 (*isLoaded)(struct StreamTask *task);
445 /* 0x23C */ void (*draw)(struct StreamTask *task, Layer *layer, s32 x, s32 y);
446 /* 0x240 */ void (*setSource)(struct StreamTask *task, s32 slot, Decompressor *source);
447 /* 0x244 */ s32 (*getFrame)(struct StreamTask *task);
448 /* 0x248 */ s32 (*getSlot)(struct StreamTask *task);
449 /* 0x24C */ void (*clearSlot)(struct StreamTask *task);
450 /* 0x250 */ void (*updateTime)(struct StreamTask *task);
451} StreamTask;
452
453/* The StreamTasks of a task's children (FIELDSTG_requestTiles) */
454typedef struct StreamPool {
456 /* 0x04 */ StreamTask *tasks[30];
457} StreamPool;
458
459/* --- map_streamer.c --- */
460
461/* The first sector of a map's tile file (MapStreamer.header) */
462typedef struct MapFileHeader {
463 /* 0x00 */ s32 tileCount; /* the tiles with data (tileSizes not 0); nothing reads it */
464 /* 0x04 */ s32 width; /* in 128-pixel tiles */
465 /* 0x08 */ s32 height;
466 /* 0x0C */ s32 tileBytes; /* the room of a tile on the CD */
467 /* 0x10 */ u16 tileSizes[FLEXIBLE]; /* width * height: each tile's bytes, 0 for none */
469
470/* A tile of the map that MapStreamer streams */
471typedef struct MapTile {
472 /* 0x0 */ s32 size; /* its bytes on the CD, 0 for none */
473 /* 0x4 */ s32 sectors; /* what it reads (StreamTask.seek) */
474} MapTile;
475
476/* One of the 12 VRAM slots the map's tiles are loaded into (FIELDSTG_slotImages) */
477typedef struct MapImage {
478 /* 0x0 */ s32 frame; /* the tile it holds, or -1 */
479 /* 0x4 */ s32 time; /* when it was last drawn */
480 /* 0x8 */ s32 cover; /* the level of the cover over a new tile (8.8), 0 for none */
481} MapImage;
482
483/*
484 * The task that streams the map's tiles from the CD around the view
485 * (FIELDSTG_runMapStreamer, id 4, created by FIELDSTG_createMapStreamer)
486 */
487typedef struct MapStreamer {
489 /* 0x050 */ s32 pad50; /* never read or written */
490 /* 0x054 */ MapFileHeader *header; /* the map file's, while it is read */
491 /* 0x058 */ Vec2 scroll;
492 /* 0x060 */ s32 pad60; /* never read or written */
493 /* 0x064 */ s32 file; /* the map's tiles, read from the CD (FieldState.mapFile) */
494 /* 0x068 */ s32 width; /* in 128-pixel tiles */
495 /* 0x06C */ s32 height;
496 /* 0x070 */ s32 frameSectors; /* a tile's sectors on the CD */
497 /* 0x074 */ MapImage images[12];
498 /* 0x104 */ MapTile *tiles; /* width * height */
499 /* 0x108 */ u8 viewTiles[30]; /* by the slots around the view, their tiles */
500 /* 0x128 */ s32 viewX; /* the tile column of the slots' left edge */
501 /* 0x12C */ s32 viewY; /* their top row */
502 /* 0x130 */ Vec2 *(*getSize)(struct MapStreamer *); /* in pixels (FIELDSTG_getMapSize) */
504
505/* --- map_objects.c --- */
506
507/* Animates and draws the map's objects (FIELDSTG_createMapObjects) */
508typedef struct MapObjects {
510 /* 0x50 */ s32 sprites; /* their sprite file and entry */
511 /* 0x54 */ struct StageTile *objects;
512} MapObjects;
513
514/* --- trigger.c --- */
515
516/* The map's triggers (FIELDSTG_createTriggers): on a trigger's cell (layer
517 7: index and direction) the player sets it off at once or, with a balloon,
518 on the action button */
519typedef struct Triggers {
521 /* 0x50 */ s32 sheetEntry; /* the stage's sprite sheet (FieldState.sheetEntry); nothing reads it */
522 /* 0x54 */ StageSlot *entries; /* FieldState.slots */
523 /* 0x58 */ Actor *actor; /* the player */
524 /* 0x5C */ s32 index; /* the trigger under it */
525 /* 0x60 */ s32 dir; /* the trigger's direction */
526 /* 0x64 */ StageSlot *entry;
527} Triggers;
528
529/* The children of an Triggers */
530typedef struct TriggerChildren {
531 /* 0x0 */ struct Balloon *balloon;
532 /* 0x4 */ EventTask *script;
534
535/* --- hidden_spots.c --- */
536
537/* The hint of a hidden spot that held nothing (FIELDSTG_createSpotHint): its sprite
538 and its palette cycle tell how far the prize is */
539typedef struct SpotHint {
541 /* 0x50 */ s32 time;
542 /* 0x54 */ s32 speed; /* frames per palette step */
543 /* 0x58 */ s32 frame;
544 /* 0x5C */ Vec2 from;
545 /* 0x64 */ Vec2 to;
546} SpotHint;
547
548/* A hidden spot: a map object with anim 0xFF */
549typedef struct HiddenSpot {
550 /* 0x00 */ s32 frame; /* its object's */
551 /* 0x04 */ s32 object; /* its index in FieldState.objects */
552 /* 0x08 */ Vec2 pos;
553 /* 0x10 */ s32 hasPrize; /* the one picked at random (GAME.prizeSpot) */
554} HiddenSpot;
555
556/* The map's hidden spots (FIELD_TASK_HIDDEN_SPOTS, FIELDSTG_createHiddenSpots):
557 one of them, picked at random, holds the prize */
558typedef struct HiddenSpots {
560 /* 0x50 */ s32 count;
561 /* 0x54 */ HiddenSpot *entries;
562 /* 0x58 */ s32 selected; /* the spot searched */
563 /* 0x5C */ s32 forEvent; /* an event's search, without the prize or a hint */
564 /* 0x60 */ Vec2 pos; /* the prize's */
566
567/* The children of an HiddenSpots */
568typedef struct HiddenSpotsChildren {
569 /* 0x0 */ struct SpotEffect *effect;
570 /* 0x4 */ struct SpotHint *hint;
572
573/* The effect of searching a hidden spot, in front of the actor that searches
574 (FIELDSTG_createSpotEffect) */
575typedef struct SpotEffect {
577 /* 0x50 */ s32 x;
578 /* 0x54 */ s32 y;
579 /* 0x58 */ s32 dir;
580 /* 0x5C */ s32 frame;
581 /* 0x60 */ u8 *anim;
582} SpotEffect;
583
584/* --- file_loader.c --- */
585
586/* The field's effect sprites (FIELDSTG_drawSpotEffect): the discs number their files
587 differently */
588#if VERSION_US || VERSION_JP
589#define FIELD_SPRITES_FILE 0x152
590#elif VERSION_EU
591#define FIELD_SPRITES_FILE 0x160
592#endif
593
594/* The files of the player's actions, which FIELDSTG_requestSlotFiles loads
595 when the map has slots for them: the discs number their files differently */
596#if VERSION_US || VERSION_JP
597#define FIELD_ACTION_FILES 0x3B9
598#elif VERSION_EU
599#define FIELD_ACTION_FILES 0x3C9
600#endif
601#define FIELD_DROP_FILE FIELD_ACTION_FILES
602#define FIELD_GAUGE_FILE (FIELD_ACTION_FILES + 1)
603#define FIELD_SEARCH_FILE (FIELD_ACTION_FILES + 2) /* the hidden spots' */
604#define FIELD_CLIMB_FILE (FIELD_ACTION_FILES + 3)
605
606/* --- banner.c --- */
607
608/* The name of a mode's area (FIELDSTG_showAreaName), up to the first mode 0: the
609 strings of the two windows, from text files 0xAA and 0xB8 */
610typedef struct AreaName {
611 /* 0x0 */ u8 area;
612 /* 0x1 */ u8 place;
613 /* 0x2 */ s16 mode;
614} AreaName;
615
616/* The windows of FIELDSTG_showAreaName */
617typedef struct AreaNameWindows {
618 /* 0x0 */ TextWindow *area;
619 /* 0x4 */ TextWindow *place;
621
622/* A rectangle of an AreaBanner, which can stretch to a new range */
623typedef struct BannerBox {
624 /* 0x00 */ s32 visible;
625 /* 0x04 */ DVECTOR pos;
626 /* 0x08 */ DVECTOR size;
627 /* 0x0C */ s32 color;
628 /* 0x10 */ s32 stretch; /* 1: horizontally, 2: vertically */
629 /* 0x14 */ s32 from;
630 /* 0x18 */ s32 to;
631 /* 0x1C */ s32 speed;
632 /* 0x20 */ s32 pad20; /* 0 in every box; never read: FIELDSTG_bannerBoxes' entries are 0x24 bytes */
633} BannerBox;
634
635/* The area name banner (FIELD_TASK_BANNER, FIELDSTG_createBanner) */
636typedef struct AreaBanner {
638 /* 0x050 */ BannerBox boxes[10];
639 /* 0x1B8 */ RECT clip; /* the layer's, closing in TASK_DONE */
640} AreaBanner;
641
642/* --- state.c --- */
643
644/* An entry of the stage tables (FIELDSTG_pickStage): the stage overlay of a mode,
645 up to the first mode 0 */
646typedef struct StageEntry {
647 /* 0x0 */ s32 mode;
648 /* 0x4 */ s32 file;
649 /* 0x8 */ struct Task *(*init)(void *owner);
650} StageEntry;
651
652/* --- field.c --- */
653
654/* The player's FLAGS_00 codes (FIELDSTG_controlPlayer) */
655#define FIELD_FLAG_TALK_AHEAD 0x12 /* the player talks to what it faces, and clears it */
656#define FIELD_SEARCH_ITEM ITEM(0, 4) /* item 4, which the player needs to search the hidden spots */
657
658/* The flag set when the field of a mode is entered: FLAGS_00's group 0x20,
659 flag mode - 0x200 */
660#define FIELD_VISITED_FLAG(mode) (0x2000 + (mode) - 0x200)
661
662/* The modes of two fields that keep the file cache (FIELDSTG_keepsFileCache) */
663#define FIELD_MODE_WSTAG415 0x22D /* where the player's run doesn't check the probes
664 ahead (FIELDSTG_checkFlightProbes) */
665#define FIELD_MODE_WSTAG815 0x2DE
666
667/* The fighters whose battles always give an item (FIELDSTG_startEncounter) */
668#define FIELD_PRIZE_FIGHTERS 0x1C9
669#define FIELD_PRIZE_FIGHTER_COUNT 8
670
671/* FIELDSTG_playBattleTransition's tiles: a copy of the screen at
672 TRANSITION_IMAGE_X in VRAM, cut into columns and rows */
673#define TRANSITION_COLUMNS 5
674#define TRANSITION_ROWS 6
675#define TRANSITION_TILE_WIDTH (SCREEN_WIDTH / TRANSITION_COLUMNS)
676#define TRANSITION_TILE_HEIGHT (SCREEN_HEIGHT / TRANSITION_ROWS)
677#define TRANSITION_IMAGE_X 0x280
678#define TRANSITION_SPEED 40 /* pixels a frame */
679#define TRANSITION_GONE 0x200 /* a tile's coordinate once it has slid off */
680#define TRANSITION_WAIT 0x10 /* the steps after the last tile, before the mode */
681#define TRANSITION_DONE 0x1000 /* the step once the mode is requested */
682
683/* A step of FIELDSTG_playBattleTransition's spiral: one coordinate of a tile moves by dir
684 * until it passes limit */
685typedef struct TileMove {
686 /* 0x0 */ s32 *value;
687 /* 0x4 */ s32 dir; /* 1, -1, or 0 at the end */
688 /* 0x8 */ s32 limit;
689} TileMove;
690
691/* The field's own image (FieldState.images) and its actors' after it */
692typedef struct FieldImages {
693 /* 0x00 */ FieldImage field;
694 /* 0x20 */ ActorImage actors[20];
696
697/* The field's main task (FIELDSTG_updateField, FIELD_TASK_FIELD); its children follow */
698typedef struct FieldTask {
700 /* 0x50 */ s32 fade; /* FIELDSTG_drawCover's level */
701 /* 0x54 */ s32 width; /* of the clip rectangle */
702 /* 0x58 */ s32 height;
703 /* 0x5C */ s32 nextMode; /* the mode it leaves for (FIELDSTG_leaveFieldAfter) */
704 /* 0x60 */ s32 nextModeArg;
705 /* 0x64 */ void *highBuffer; /* a buffer at the end of the heap */
706 /* 0x68 */ s32 leaveDelay; /* the frames left before it closes the field */
707 /* 0x6C */ s32 centerOnPlayer; /* the closing clip shrinks onto the player */
708 /* 0x70 */ s32 warpKind; /* the effect and cutscene of a warp (FIELDSTG_startWarp) */
709 /* 0x74 */ Vec2 warpPos; /* where the warp's effect plays */
710 /* 0x7C */ SlotDest *warp; /* where it leads */
711} FieldTask;
712
713/* The children of the field's main task (FieldTask, FIELDSTG_updateField) */
714typedef struct FieldChildren {
715 /* 0x00 */ struct FieldEffect *effect; /* FIELDSTG_createEffect's */
716 /* 0x04 */ ScreenFade *fade;
717 /* 0x08 */ struct CutsceneAnim *cutscene; /* FIELDSTG_createCutsceneAnim's */
718 /* 0x0C */ EventTask *event;
719 /* 0x10 */ union {
720 Task *fileLoader; /* FIELDSTG_createFileLoader's, as the field starts */
721 struct Inn *inn; /* createInn's (FIELDSTG_openInn) */
722 } awaited; /* the task the field waits for, until it ends */
723 /* 0x14 */ Task *banner; /* FIELDSTG_createBanner's */
724 /* 0x18 */ struct Actor *actors[4]; /* the player and the partners */
725 /* 0x28 */ struct Camera *camera;
726 /* 0x2C */ struct Actor *npcs[15]; /* FieldState.actors's other characters */
727 /* 0x68 */ struct Triggers *triggers; /* FIELDSTG_createTriggers's */
728 /* 0x6C */ Task *stage; /* FieldState.stageInit's */
729 /* 0x70 */ struct MapStreamer *mapStreamer; /* FIELDSTG_createMapStreamer's */
730 /* 0x74 */ FieldMenu *menu; /* createFieldMenu's */
731 /* 0x78 */ struct MapObjects *mapObjects; /* FIELDSTG_createMapObjects's */
733
734/* An encounter of FIELDSTG_encounters, which FIELDSTG_startEncounter starts: its enemies and
735 the bytes it copies to BATTLE_SETUP.ambushChance on */
736typedef struct Encounter {
737 /* 0x00 */ BattleEnemy *enemies[3];
738 /* 0x0C */ u8 ambushChance;
739 /* 0x0D */ u8 kind; /* copied to BATTLE_SETUP.encounterKind: 1 for nearly all the maps'
740 random battles (some enemies' battle table actions, condition 13, run
741 away in them), 4 for the Digimon Arena's, 2, 3 and 5 mostly for the
742 event battles */
743 /* 0x0E */ u8 blocks[12]; /* copied to BATTLE_SETUP.blocks */
744} Encounter;
745
746/* The functions, by module in the order they link */
747
748/* commands.c */
750void FIELDSTG_handleFieldCommand(Task *task, s32 command);
752
753/* lift.c */
754void FIELDSTG_updateLift(Lift *task);
755void FIELDSTG_moveLift(Lift *task, s32 command);
757
758/* choice.c */
759void FIELDSTG_runChoice(ChoiceTask *task, ChoiceChildren *children);
764
765/* story.c */
768
769/* event.c */
772void FIELDSTG_runEvent(EventTask *task, EventChildren *children);
773
774/* cutscene.c */
777
778/* effect.c */
779s32 FIELDSTG_stepEffectAnim(EffectAnim *anim, AnimFrame *frames, s32 depth);
782
783/* map_streamer.c */
786void FIELDSTG_drawCoverBlock(Layer *layer, s32 x, s32 y, s32 level);
793void FIELDSTG_drawCover(s32 id, s32 level);
794
795/* stream.c */
797void FIELDSTG_seekStream(StreamTask *task, s32 frame, s32 size);
799void FIELDSTG_drawStream(StreamTask *task, Layer *layer, s32 x, s32 y);
800void FIELDSTG_setStreamSource(StreamTask *task, s32 slot, Decompressor *source);
807
808/* start.c */
809void FIELDSTG_updateRoot(Task *task, Task **children);
810
811/* banner.c */
814void FIELDSTG_drawBannerBox(AreaBanner *task, u_long *ot, DVECTOR pos, DVECTOR size, s32 color);
817
818/* balloon.c */
820void FIELDSTG_drawBalloon(Balloon *task);
822Balloon *FIELDSTG_createBalloon(s32 kind, s32 anim, s32 id);
824void FIELDSTG_balloonCommand(Balloon *task, s32 command, s32 id);
825
826/* trigger.c */
831Triggers *FIELDSTG_createTriggers(s32 sheetEntry, StageSlot *slots);
832
833/* speech.c */
834void FIELDSTG_getSpeechPos(Speech *task, Vec2 *out);
835void FIELDSTG_updateSpeech(Speech *task, void **box);
836Speech *FIELDSTG_createSpeech(Actor *actor, s32 entry, s32 type, s32 isMessage);
837Speech *FIELDSTG_createTalk(Actor *actor, s32 entry);
838
839/* map_objects.c */
840void FIELDSTG_drawMapObject(MapObjects *task, Layer *layer, s32 index);
841void FIELDSTG_updateMapObjects(MapObjects *task, HiddenSpots **children);
843
844/* file_loader.c */
848void FIELDSTG_runFileLoader(Task *task);
850
851/* actor_icon.c */
854
855/* field.c */
857void FIELDSTG_closeField(FieldTask *task, FieldChildren *children);
859void FIELDSTG_updateField(FieldTask *task, FieldChildren *children);
861void FIELDSTG_leaveFieldAfter(s32 mode, s32 arg, s32 x, s32 y, s32 dir, s32 delay);
862void FIELDSTG_startEncounter(s32 encounter);
863void FIELDSTG_startWarp(s32 kind, Vec2 *pos, SlotDest *dest);
864
865/* launch.c */
866s32 FIELDSTG_scaleSin(s32 angle, s32 radius);
867void FIELDSTG_runLaunch(Launch *task);
869
870/* hidden_spots.c */
877void FIELDSTG_searchEventSpot(void);
878void FIELDSTG_drawSpotEffect(SpotEffect *task, Layer *layer);
881
882/* gauge.c */
883void FIELDSTG_runGauge(GaugeGame *task);
885
886/* camera.c */
887void FIELDSTG_scrollCamera(Camera *task);
888void FIELDSTG_updateCamera(Camera *task);
890void FIELDSTG_followWithCamera(s32 snap, s32 id);
891void FIELDSTG_pointCamera(s32 snap, s32 x, s32 y);
892void FIELDSTG_shakeCamera(s32 shaking);
893
894/* actor_control.c */
895s32 FIELDSTG_checkFlightProbe(Actor *actor, s32 x, s32 y, Vec2 offset);
897void FIELDSTG_moveByPad(Actor *actor, s32 pad);
900void FIELDSTG_controlFlight(Actor *actor);
901void FIELDSTG_controlPlayer(Actor *actor);
902void FIELDSTG_controlClimb(Actor *actor);
903void FIELDSTG_followLeader(Actor *actor);
904void FIELDSTG_drainTrail(Actor *actor);
905void FIELDSTG_walkToGoal(Actor *actor);
906void FIELDSTG_setActorGoal(Actor *actor, s32 x, s32 y, s32 dir);
908void FIELDSTG_startActorWalk(Actor *actor);
910void FIELDSTG_walkActorInDir(Actor *actor, s32 dir);
911void FIELDSTG_startActorSlide(Actor *actor, s32 dir);
912void FIELDSTG_stopActorSlide(Actor *actor);
913void FIELDSTG_startClimbUp(Actor *actor, s32 dir, s32 x, s32 y, s32 height);
914void FIELDSTG_startClimbDown(Actor *actor, s32 dir, s32 x, s32 y, s32 height);
915void FIELDSTG_startDrop(Actor *actor, s32 dir, Vec2 pos, s32 height);
916void FIELDSTG_startActorGauge(Actor *actor, s32 dir, Vec2 offset);
917void FIELDSTG_warpActor(Actor *actor, SlotDest *dest, s32 kind);
918void FIELDSTG_launchActor(Actor *actor, SlotDest *dest);
919void FIELDSTG_setActorAnim(Actor *actor, s32 set);
920void FIELDSTG_setActorPose(Actor *actor, s32 set, s32 dir);
922void FIELDSTG_drawActor(void *data, void *drawLayer); /* (actor, layer) */
923void FIELDSTG_setActorDir(Actor *actor, s32 dir);
924void FIELDSTG_animateActor(Actor *actor);
926void FIELDSTG_playStepSounds(Actor *actor, s32 moving, s32 canBattle);
928void FIELDSTG_runActorAction(Actor *actor, ActorChildren *children);
929
930/* actor.c */
931void FIELDSTG_haltPartners(void);
932void FIELDSTG_resumePartners(void);
933void FIELDSTG_getFacingTile(Actor *actor, Vec2 *out);
934void FIELDSTG_updateActor(Actor *actor, ActorChildren *children);
935Actor *FIELDSTG_createActor(s32 key1, s32 kind, s32 image, FieldActorEntry *entry);
936
937/* field_stage.c */
946void FIELDSTG_setupField(void);
947
948/* tween.c */
951
952/* state.c */
955void FIELDSTG_pickStage(void);
957
958/* script.c */
960Actor *FIELDSTG_findActor(s32 character);
961void FIELDSTG_waitScriptTime(s32 time, s32 *pc);
962void FIELDSTG_waitAnimDone(s32 id, s32 *pc);
963void FIELDSTG_waitWalkDone(s32 id, s32 *pc);
964void FIELDSTG_toScreenPos(Vec2 *pos);
965void FIELDSTG_clearScriptFlag(void);
968void FIELDSTG_handleScriptCommand(s32 task, s32 id, s32 command, s32 arg);
969
970/* battle.c */
971void FIELDSTG_rollBattleSteps(void);
972void FIELDSTG_startAreaBattle(void);
975
976/* map.c */
978void FIELDSTG_setMapFile(s32 index, s32 value);
979void FIELDSTG_setFirstMap(s32 index);
980void FIELDSTG_setMap(s32 index);
981s32 FIELDSTG_getMapCell(s32 index, Vec2 *pos);
983void FIELDSTG_getWalkStep(Vec2 *pos, s32 scale, s32 index, Vec2 *out);
984void FIELDSTG_getFlyStep(Vec2 *pos, s32 scale, s32 index, Vec2 *out);
985
986/* FIELDSTG's data (fieldstg.c), in its order */
988extern s16 FIELDSTG_liftShake[]; /* FIELDSTG_updateLift's shakes, up to 1000 */
991extern AnimFrame FIELDSTG_cutsceneAnim[]; /* FIELDSTG_playCutsceneAnim's animations: kind 0's, */
992extern AnimFrame FIELDSTG_cutsceneLoopAnim[]; /* and kind 1's two */
994extern AnimFrame *FIELDSTG_effectAnims[][4]; /* FIELDSTG_updateEffect's animations of each set */
995extern u8 FIELDSTG_slotLayouts[][4][5][6]; /* FIELDSTG_pickViewTiles's slot layouts: [layout][quadrant][row][column] */
996extern u8 FIELDSTG_dirLayouts[][2]; /* the layout and its flips for each direction */
997extern u8 FIELDSTG_slotOffsets[][2][2]; /* the slots' offset in tiles: [quadrant][x, y][unflipped, flipped] */
998extern s32 FIELDSTG_spriteDepths[]; /* depth of each layer of a StreamTask's sprites */
999extern Vec2 FIELDSTG_slotImages[]; /* VRAM position of each StreamTask slot's image */
1001extern BannerBox FIELDSTG_bannerBoxes[10]; /* FIELDSTG_updateBanner's boxes */
1002extern u8 FIELDSTG_triggerAnims[][9]; /* FIELDSTG_stepBalloonAnim's animations: (frame, time) pairs up to 0xFF */
1003extern u8 FIELDSTG_nearDirs[][8]; /* whether two directions are at most 45 degrees apart */
1004extern s16 FIELDSTG_file5DModes[]; /* the modes that load the field file 0x5D (FIELDSTG_requestInnNames) */
1005extern u8 (*FIELDSTG_iconAnims[])[2]; /* FIELDSTG_updateActorIcon's animation of each substate */
1006extern IconOffset FIELDSTG_iconPath[]; /* up to (0, 0) */
1007extern s32 FIELDSTG_iconPathStep; /* the step in FIELDSTG_iconPath */
1009extern s16 FIELDSTG_eventIds[]; /* the events FIELDSTG_startListedEvent starts */
1010extern u8 FIELDSTG_spotAnim[][2]; /* animation of FIELDSTG_updateHiddenSpots: (frame, time) pairs up to 0xFF */
1011extern u8 *FIELDSTG_dirAnims[]; /* FIELDSTG_updateSpotEffect's animation for each direction */
1012extern s32 FIELDSTG_dirDepths[]; /* and its depth offset */
1013extern u8 *FIELDSTG_gaugeRows[];
1014extern Vec2 FIELDSTG_shakeOffsets[]; /* the camera's shake offsets */
1015extern u8 FIELDSTG_probes[][5]; /* the probes of each direction (FIELDSTG_checkFlightProbes) */
1016extern Vec2 FIELDSTG_probePos[]; /* a probe's position */
1017extern u8 FIELDSTG_probeSteps[][2]; /* a probe's offset: bit 0 set, bit 7 negative */
1018extern s32 FIELDSTG_padDirs[]; /* the direction of each combination of the pad directions */
1019extern StandIn FIELDSTG_standIns[]; /* up to character 0 */
1020/* the partners' kinds (Actor.key2): the ones FIELDSTG_startActorGauge turns, FIELDSTG_haltPartners
1021 stops and FIELDSTG_resumePartners makes follow again */
1025extern Vec2 FIELDSTG_dirSteps[]; /* tile offset of each direction */
1026/* the field's own stage (FIELDSTG_setupField) */
1030extern StageSlot FIELDSTG_slots[];
1031extern void (*FIELDSTG_initFuncs[])(void);
1032extern void (*FIELDSTG_tweenStart)(PanelAnim *tween, s32 in); /* FIELDSTG_startTween */
1033extern s32 (*FIELDSTG_tweenUpdate)(PanelAnim *tween); /* FIELDSTG_updateTween */
1035extern s32 FIELDSTG_fileEntries[]; /* by character (Actor.key1) */
1036extern u8 FIELDSTG_actorWidths[]; /* by character, in pixels (FieldState.getActorWidth) */
1037#if VERSION_EU || VERSION_JP
1038extern StageEntry FIELDSTG_extraStages[]; /* the extra chapter's, which run on into FIELDSTG_stages */
1039#endif
1042extern void (*FIELDSTG_scriptHelpers[])(); /* the script helpers (FIELDSTG_toScreenPos...) */
1044extern void (*FIELDSTG_checkBattle)(); /* FIELDSTG_countBattleSteps */
1045extern s32 FIELDSTG_battleRates[]; /* how much each area lowers GAME.battleSteps, the steps to the next battle */
1046extern s32 FIELDSTG_boxFrame; /* the frame FIELDSTG_boxes was filled in */
1047extern Vec2 FIELDSTG_dirVectors[][8]; /* a direction's vector, scaled by 4096 */
1048extern u8 FIELDSTG_mirrorDirs[];
1049extern s16 FIELDSTG_slideVoice; /* the voice of the slide's sound (ACTOR_SLIDE, SOUND_TRAP_ICE) */
1050extern s16 FIELDSTG_heldVoice; /* the voice of FIELDSTG_handleFieldCommand's held sound */
1051extern Vec2 FIELDSTG_mapSize; /* FIELDSTG_getMapSize's */
1052extern StageTile *FIELDSTG_objectCursor; /* FIELDSTG_findNextObject's search of the map objects */
1053extern s32 FIELDSTG_objectId; /* and the id it looks for */
1054extern Vec2 FIELDSTG_tiles[TRANSITION_COLUMNS][TRANSITION_ROWS]; /* FIELDSTG_playBattleTransition's */
1055extern s32 FIELDSTG_battleFileStep; /* FIELDSTG_playBattleTransition's: 0 and 1 wait for the CD, 2 the battle's files are asked for */
1056extern RECT FIELDSTG_screenRect;
1057extern Box FIELDSTG_boxes[20]; /* the characters' boxes (FIELDSTG_isTileFree) */
1058extern s32 FIELDSTG_boxCount; /* and their number */
1059
1060/* Starts a battle: its fight stage, its music and its encounter */
1061static inline void FIELDSTG_startBattle(AreaBattle *battle) {
1062 BATTLE_SETUP.stage = battle->stage;
1063 BATTLE_SETUP.music = battle->music;
1065}
1066
1067#endif /* FIELDSTG_H */
signed int s32
Definition common.h:11
#define FLEXIBLE
The length of an array that ends a struct and runs as far as each object of it needs: s32 seps[FLEXIB...
Definition common.h:29
signed short s16
Definition common.h:9
unsigned short u16
Definition common.h:10
unsigned char u8
Definition common.h:8
#define TASK_HEADER(Type)
Definition task.h:39
What the stage overlays and the executable use of FIELDSTG (fieldstg.h has the rest): its layers and ...
FieldEvent FIELDSTG_events[]
The story events (FIELDSTG_setupField), up to the first id -1: the scripts are WSTAG260's,...
Definition fieldstg.c:2572
void FIELDSTG_updateBalloon(Balloon *task)
A balloon's update: it pops open over the player (or another actor), stays while the trigger is on of...
Definition balloon.c:38
void FIELDSTG_getFlyStep(Vec2 *pos, s32 scale, s32 index, Vec2 *out)
A step of scale in a direction, on the flat (FieldMap.getFlyStep)
Definition map.c:164
void FIELDSTG_runChoice(ChoiceTask *task, ChoiceChildren *children)
choice.c
Definition choice.c:10
void FIELDSTG_followLeader(Actor *actor)
A partner's control: records the leader's steps in the trail while it moves, and follows them.
u8 FIELDSTG_spotAnim[][2]
animation of FIELDSTG_updateHiddenSpots: (frame, time) pairs up to 0xFF
Definition fieldstg.c:1931
Speech * FIELDSTG_createTalk(Actor *actor, s32 entry)
Creates the talk box of an actor's text entry, on the side of the screen away from where it faces and...
Definition speech.c:77
void FIELDSTG_runMapStreamer(MapStreamer *task, StreamPool *pool)
The map streamer's update: reads the map's header and creates the 30 stream tasks,...
void * FIELDSTG_askChoice13(void)
s32 FIELDSTG_boxCount
and their number
Definition fieldstg.c:3771
s32 FIELDSTG_stepEffectAnim(EffectAnim *anim, AnimFrame *frames, s32 depth)
effect.c
Definition effect.c:7
void FIELDSTG_warpActor(Actor *actor, SlotDest *dest, s32 kind)
Warps the player (SLOT_WARP0 and SLOT_WARP1): the field task plays the warp's effect and cutscene of ...
s16 FIELDSTG_file5DModes[]
the modes that load the field file 0x5D (FIELDSTG_requestInnNames)
Definition fieldstg.c:1804
void FIELDSTG_endChoice6Answer1(void)
void FIELDSTG_runGauge(GaugeGame *task)
gauge.c
Definition gauge.c:52
void FIELDSTG_setMapFile(s32 index, s32 value)
Sets the file of map index (FieldMap.setFile)
Definition map.c:46
s32 FIELDSTG_haltedPartners[]
Definition fieldstg.c:2107
void FIELDSTG_updateCamera(Camera *task)
The camera's update: it follows its target actor (substate 0) or looks at a spot (1),...
Definition camera.c:61
void FIELDSTG_endChoice2Answer1(void)
void FIELDSTG_updateCommandTask(Task *task)
commands.c
Definition commands.c:10
void FIELDSTG_resetScriptTimer(void)
script.c
Definition script.c:6
void FIELDSTG_waitScriptTime(s32 time, s32 *pc)
A script's wait: counts time down, then moves the script on.
Definition script.c:16
s32 FIELDSTG_getActorWidth(s32 index)
The width of character index.
Definition state.c:12
s32 FIELDSTG_isTileFree(Vec2 *pos)
Whether nothing stands at pos: no character's box (gathered once a frame) and no object.
Definition map.c:103
void FIELDSTG_controlFlight(Actor *actor)
The player's flight: it rises unless triangle is held (ACTOR_FLY), left and right turn,...
void FIELDSTG_drawActor(void *data, void *drawLayer)
(actor, layer)
void FIELDSTG_endChoice12Answer1(void)
IconOffset FIELDSTG_iconPath[]
up to (0, 0)
Definition fieldstg.c:1839
s16 FIELDSTG_eventIds[]
the events FIELDSTG_startListedEvent starts
Definition fieldstg.c:1910
ProgressEvent FIELDSTG_progressEvents[]
Definition fieldstg.c:1328
void FIELDSTG_endChoice4Answer0(void)
void FIELDSTG_endChoice7Answer1(void)
Definition field_stage.c:26
FieldActorEntry * FIELDSTG_actorList[]
Definition fieldstg.c:2501
void FIELDSTG_endChoice3Answer1(void)
Definition field_stage.c:22
void FIELDSTG_endChoice5Answer0(void)
void FIELDSTG_updateLift(Lift *task)
lift.c
Definition lift.c:12
void FIELDSTG_endChoice14Answer1(void)
void FIELDSTG_loadStreamSprites(StreamTask *task)
Takes a decompressed tile's sprites and loads its image into its slot's VRAM.
Definition stream.c:83
s32 FIELDSTG_getFileEntry(s32 index)
state.c
Definition state.c:7
s32 FIELDSTG_isStreamLoaded(StreamTask *task)
Whether a stream task's read is done.
Definition stream.c:25
u8 FIELDSTG_mirrorDirs[]
Definition fieldstg.c:3751
void FIELDSTG_endChoice11Answer1(void)
Definition field_stage.c:30
void FIELDSTG_endChoice2Answer0(void)
void FIELDSTG_updateSpeech(Speech *task, void **box)
A speech's update: opens its message box or talk box, moves the talk box with its actor,...
Definition speech.c:31
AnimFrame FIELDSTG_cutsceneLoopAnim2[]
Definition fieldstg.c:1359
void FIELDSTG_stretchBannerBox(AreaBanner *task, BannerBox *box)
Stretches a box toward from-to along one axis.
Definition banner.c:28
void FIELDSTG_updateStream(StreamTask *task)
A stream task's update: takes its tile once decompressed, and notes when its read ends.
Definition stream.c:137
Vec2 FIELDSTG_shakeOffsets[]
the camera's shake offsets
Definition fieldstg.c:2027
StageTile * FIELDSTG_objectCursor
FIELDSTG_findNextObject's search of the map objects.
Definition fieldstg.c:3756
void FIELDSTG_startActorGauge(Actor *actor, s32 dir, Vec2 offset)
Starts the gauge game at an offset from an actor, turning the partners its way.
void FIELDSTG_setActorPose(Actor *actor, s32 set, s32 dir)
Puts an actor in an event's pose: an animation set and a direction (ACTOR_POSED)
void FIELDSTG_handleScriptCommand(s32 task, s32 id, s32 command, s32 arg)
Hands the task of script command id a command and its argument, through the command's handle.
Definition script.c:93
s32 FIELDSTG_updateTween(PanelAnim *tween)
u8 FIELDSTG_slotOffsets[][2][2]
the slots' offset in tiles: [quadrant][x, y][unflipped, flipped]
Definition fieldstg.c:1496
u8(*[] FIELDSTG_iconAnims)[2]
FIELDSTG_updateActorIcon's animation of each substate.
Definition fieldstg.c:1836
void FIELDSTG_toScreenPos(Vec2 *pos)
Turns a map position into a screen one.
Definition script.c:48
void FIELDSTG_startDrop(Actor *actor, s32 dir, Vec2 pos, s32 height)
Starts a drop from a ledge of height.
void FIELDSTG_walkToGoal(Actor *actor)
Walks an actor to its goal tile (FIELDSTG_setActorGoal) as the pad would, then faces it the goal's wa...
void FIELDSTG_playClimbSounds(Actor *actor)
The player's climbing sound, every 16 frames.
s32 FIELDSTG_findTrigger(Triggers *task)
trigger.c
Definition trigger.c:9
s32 FIELDSTG_getStreamFrame(StreamTask *task)
A stream task's frame, the tile it holds.
Definition stream.c:131
void FIELDSTG_endChoice15Answer0(void)
s32 FIELDSTG_followingPartners[]
Definition fieldstg.c:2110
StageTile FIELDSTG_mapObjects[]
The field's map objects (FieldState.objects), up to the first margin 0.
Definition fieldstg.c:2534
s32 FIELDSTG_loadFieldFiles(Task *task)
Loads the field's files, a step at a time: 1 once done.
Definition file_loader.c:56
void(* FIELDSTG_initFuncs[])(void)
Definition fieldstg.c:2559
s32(* FIELDSTG_tweenUpdate)(PanelAnim *tween)
FIELDSTG_updateTween.
Definition fieldstg.c:2561
void * FIELDSTG_askChoice12(void)
void FIELDSTG_getWalkStep(Vec2 *pos, s32 scale, s32 index, Vec2 *out)
A step of scale in a direction on the map the player is on, along the slope of its cell (FieldMap....
Definition map.c:150
Actor * FIELDSTG_findEventActor(EventTask *task, s32 id)
event.c
Definition event.c:9
s16 FIELDSTG_slideVoice
the voice of the slide's sound (ACTOR_SLIDE, SOUND_TRAP_ICE)
Definition fieldstg.c:3762
void FIELDSTG_drawCoverBlock(Layer *layer, s32 x, s32 y, s32 level)
Draws a 128-pixel block of the cover at (x, y), at a shade of level (8.8)
void FIELDSTG_scrollCamera(Camera *task)
camera.c
Definition camera.c:7
GaugeGame * FIELDSTG_createGauge(Vec2 pos)
Creates the gauge game at a tile.
Definition gauge.c:158
ScriptCommand FIELDSTG_scriptCommands[]
The script commands (FIELDSTG_findScriptCommand), up to the first id 0.
Definition fieldstg.c:3590
ScriptCommand * FIELDSTG_findScriptCommand(s32 id)
The script command id of FIELDSTG_scriptCommands, or NULL.
Definition script.c:69
void FIELDSTG_runEvent(EventTask *task, EventChildren *children)
Runs an event: in TASK_INIT it waits for the event's text file and the field (FIELD_TASK_FIELD) and h...
Definition event.c:82
void FIELDSTG_endChoice13Answer0(void)
void * FIELDSTG_askChoice8(void)
void FIELDSTG_followWithCamera(s32 snap, s32 id)
Points the camera at the actor id, at once if snap.
Definition camera.c:147
void FIELDSTG_touchStream(StreamTask *task)
stream.c
Definition stream.c:6
void FIELDSTG_moveByPad(Actor *actor, s32 pad)
Walks or runs an actor in the direction of the pad's arrows (an index of FIELDSTG_padDirs),...
void FIELDSTG_endChoice13Answer1(void)
Definition field_stage.c:32
void FIELDSTG_resumePartners(void)
Makes the partners follow the player again (FIELDSTG_followLeader)
Definition actor.c:20
StreamTask * FIELDSTG_findOldestStream(StreamPool *pool)
map_streamer.c
Definition map_streamer.c:7
void FIELDSTG_setOffTrigger(Triggers *task)
Sets off the slot the player pressed cross on.
Definition trigger.c:144
Actor * FIELDSTG_createActor(s32 key1, s32 kind, s32 image, FieldActorEntry *entry)
Creates a character (FIELD_TASK_ACTOR): key1 is the character, key2 its kind (0 the player,...
Definition actor.c:128
void FIELDSTG_endChoice9Answer1(void)
Definition field_stage.c:28
void FIELDSTG_shakeCamera(s32 shaking)
Starts or stops the camera's shake.
Definition camera.c:175
void FIELDSTG_runFileLoader(Task *task)
The file loader's update: loads the field's files from its first step on (FIELDSTG_loadFieldFiles)
SpotHint * FIELDSTG_createSpotHint(Vec2 from, Vec2 to)
Creates the hint for a search at to, from the prize at from.
void FIELDSTG_endChoice6Answer0(void)
MapObjects * FIELDSTG_createMapObjects(s32 sprites, StageTile *objects)
Creates the map's objects, with their sprites.
void FIELDSTG_updateRoot(Task *task, Task **children)
start.c
Definition start.c:7
s32 FIELDSTG_boxFrame
the frame FIELDSTG_boxes was filled in
Definition fieldstg.c:3678
s32 FIELDSTG_battleRates[]
how much each area lowers GAME.battleSteps, the steps to the next battle
Definition fieldstg.c:3656
void FIELDSTG_runActorAction(Actor *actor, ActorChildren *children)
Runs an actor's action, its substate (ACTOR_STAND...): the walks, the climbs and the drop from ACTOR_...
Vec2 FIELDSTG_mapSize
FIELDSTG_getMapSize's.
Definition fieldstg.c:3755
StageEntry FIELDSTG_extraStages[]
the extra chapter's, which run on into FIELDSTG_stages
Definition fieldstg.c:2977
RECT FIELDSTG_screenRect
Definition fieldstg.c:3761
void FIELDSTG_endChoice8Answer1(void)
Vec2 FIELDSTG_slotImages[]
VRAM position of each StreamTask slot's image.
Definition fieldstg.c:1505
void FIELDSTG_endChoice15Answer1(void)
Definition field_stage.c:34
#define TRAIL_STEPS
The last TRAIL_STEPS steps of the actor that another one follows (Actor.trail), a ring from tail to h...
Definition field_mode.h:125
void FIELDSTG_requestInnNames(Task *task)
file_loader.c
Definition file_loader.c:6
void FIELDSTG_waitWalkDone(s32 id, s32 *pc)
A script's wait for the actor id to reach its goal.
Definition script.c:39
Triggers * FIELDSTG_createTriggers(s32 sheetEntry, StageSlot *slots)
Creates the triggers.
Definition trigger.c:239
void * FIELDSTG_askChoice10(void)
BannerBox FIELDSTG_bannerBoxes[10]
FIELDSTG_updateBanner's boxes.
Definition fieldstg.c:1761
ChoiceText FIELDSTG_choices[16]
Definition fieldstg.c:1309
s32 FIELDSTG_checkFlightProbes(Actor *actor)
Whether a flying actor runs into the map at any of the five probes ahead of it (FIELDSTG_checkFlightP...
void(* FIELDSTG_checkBattle)()
FIELDSTG_countBattleSteps.
Definition fieldstg.c:3652
s32 FIELDSTG_spriteDepths[]
depth of each layer of a StreamTask's sprites
Definition fieldstg.c:1502
void FIELDSTG_updateField(FieldTask *task, FieldChildren *children)
The field's update: sets up the stage, creates the characters and the NPCs, then runs the field and o...
Definition field.c:573
s16 FIELDSTG_liftShake[]
FIELDSTG_updateLift's shakes, up to 1000.
Definition fieldstg.c:1286
void FIELDSTG_drainTrail(Actor *actor)
A follower's update while its trail runs out: it finds the leader (FIELD_TASK_ACTOR) if it has none,...
void FIELDSTG_endChoice5Answer1(void)
Definition field_stage.c:24
void FIELDSTG_launchActor(Actor *actor, SlotDest *dest)
Sends the player flying to the tile at dest from the nearest launcher (FIELDSTG_createLaunch)
#define TRANSITION_ROWS
Definition field_mode.h:674
void FIELDSTG_endChoice1Answer1(void)
Definition field_stage.c:20
void FIELDSTG_clearScriptFlag(void)
A script helper: clears the script flag of character 1, or else of character 2.
Definition script.c:59
s32 FIELDSTG_turnedPartners[]
the partners' kinds (Actor.key2): the ones FIELDSTG_startActorGauge turns, FIELDSTG_haltPartners stop...
Definition fieldstg.c:2104
void * FIELDSTG_askChoice3(void)
Definition choice.c:123
void * FIELDSTG_askChoice4(void)
void FIELDSTG_setStreamSource(StreamTask *task, s32 slot, Decompressor *source)
Decompresses a stream task's tile into slot.
Definition stream.c:74
void FIELDSTG_updateEffect(FieldEffect *task)
An effect's update: draws its animations at its spot until they end.
Definition effect.c:30
void * FIELDSTG_askChoice11(void)
Definition choice.c:131
void FIELDSTG_startTween(PanelAnim *tween, s32 in)
tween.c
u8 * FIELDSTG_dirAnims[]
FIELDSTG_updateSpotEffect's animation for each direction.
Definition fieldstg.c:1980
u8 FIELDSTG_probeSteps[][2]
a probe's offset: bit 0 set, bit 7 negative
Definition fieldstg.c:2062
void * FIELDSTG_askChoice7(void)
Definition choice.c:127
void FIELDSTG_updateActor(Actor *actor, ActorChildren *children)
An actor's update: waits for its animation file (and gives the player its icon), then runs its contro...
Definition actor.c:43
Box FIELDSTG_boxes[20]
the characters' boxes (FIELDSTG_isTileFree)
Definition fieldstg.c:3770
StandIn FIELDSTG_standIns[]
up to character 0
Definition fieldstg.c:2086
void FIELDSTG_pointCamera(s32 snap, s32 x, s32 y)
Points the camera at the spot (x, y), at once if snap.
Definition camera.c:161
void FIELDSTG_endChoice7Answer0(void)
StoryEvents * FIELDSTG_createStoryEvents(void *owner)
Creates the story events, and loads the field's sound bank and files.
Definition story.c:72
s32 FIELDSTG_objectId
and the id it looks for
Definition fieldstg.c:3757
void * FIELDSTG_askChoice9(void)
s32 FIELDSTG_scaleSin(s32 angle, s32 radius)
launch.c
Definition launch.c:7
void FIELDSTG_closeField(FieldTask *task, FieldChildren *children)
Closes the field for the next mode: the view shrinks to nothing, the cover fades in,...
Definition field.c:200
Encounter FIELDSTG_encounters[]
FIELDSTG's data (fieldstg.c), in its order.
Definition fieldstg.c:948
s32 FIELDSTG_stepBalloonAnim(Balloon *task)
balloon.c
Definition balloon.c:6
void * FIELDSTG_askChoice15(void)
Definition choice.c:135
void FIELDSTG_hidePrize(HiddenSpots *task)
Hides the prize in one of the hidden spots at random (GAME.prizeSpot keeps it)
Task * FIELDSTG_createBanner(s32 show)
Creates the area name banner, which closes at once unless show; the player is frozen until it ends.
Definition banner.c:241
AreaName FIELDSTG_areaNames[]
Definition fieldstg.c:1519
StageEntry FIELDSTG_stages[]
Definition fieldstg.c:3337
HiddenSpots * FIELDSTG_findHiddenSpot(Vec2 *pos, s32 select)
The hidden spots, when one is within 10 pixels of pos (selecting it if select), or NULL.
void FIELDSTG_showAreaName(AreaBanner *task, AreaNameWindows *windows)
banner.c
Definition banner.c:9
void * FIELDSTG_askChoice0(void)
void FIELDSTG_handleFieldCommand(Task *task, s32 command)
Runs a field command (FIELD_COMMAND_*) of an event script: halts the partners through the command tas...
Definition commands.c:164
void FIELDSTG_endChoice12Answer0(void)
void FIELDSTG_startWarp(s32 kind, Vec2 *pos, SlotDest *dest)
Starts a warp from pos: the field task plays the effect and the cutscene of kind, then leaves for the...
Definition field.c:1039
void FIELDSTG_runStoryEvents(StoryEvents *task, StoryEventsChildren *children)
story.c
Definition story.c:10
s32 FIELDSTG_offerTrigger(Triggers *task, TriggerChildren *children)
Acts at once on a slot that does (SLOT_DEPTH...), or shows the balloon of one that waits for a button...
Definition trigger.c:42
void FIELDSTG_endChoice11Answer0(void)
void FIELDSTG_playStepSounds(Actor *actor, s32 moving, s32 canBattle)
The player's footsteps, every 8 frames when it moves (every 32 for the characters 0x146 and 0x147) or...
void FIELDSTG_drawSpotEffect(SpotEffect *task, Layer *layer)
The layer's sorted callback that draws a search's effect.
void FIELDSTG_countBattleSteps(void)
Counts down to the next battle at each step by the area's rate (FIELDSTG_battleRates),...
Definition battle.c:35
HiddenSpots * FIELDSTG_createHiddenSpots(s32 count)
Creates the hidden spots, the map objects of animation 0xFF, and hides the prize in one (or where it ...
void * FIELDSTG_askChoice5(void)
void FIELDSTG_endChoice14Answer0(void)
Vec2 FIELDSTG_dirVectors[][8]
a direction's vector, scaled by 4096
Definition fieldstg.c:3679
void FIELDSTG_updateMapObjects(MapObjects *task, HiddenSpots **children)
Animates and draws the map's objects that are in view.
Definition map_objects.c:30
void FIELDSTG_endChoice9Answer0(void)
void FIELDSTG_pickStage(void)
Picks the stage overlay of the mode (FIELDSTG_stages, in the European version's extra chapter FIELDST...
Definition state.c:19
Launch * FIELDSTG_createLaunch(Actor *actor, SlotDest *dest)
Creates the flight of an actor to the tile at dest; two stages' modes (0x26C, 0x2D4) set theirs up.
Definition launch.c:166
TileMove FIELDSTG_tileMoves[]
Definition fieldstg.c:1846
void FIELDSTG_resetActorControl(Actor *actor)
Gives an actor its kind's control back: the pad for the player, none for kind 1, the trail for the pa...
void FIELDSTG_setFirstMap(s32 index)
Puts the player on map index when the mode is new (FieldMap.setFirstMap)
Definition map.c:51
void FIELDSTG_walkActorInDir(Actor *actor, s32 dir)
Walks an actor out through an exit, in a direction (ACTOR_WALK_OUT)
void FIELDSTG_drawMapObject(MapObjects *task, Layer *layer, s32 index)
map_objects.c
Definition map_objects.c:6
void FIELDSTG_requestTiles(MapStreamer *task, StreamPool *pool)
Streams the map's tiles while the CD reader is free: a tile of viewTiles (0xFF for none) that a strea...
void * FIELDSTG_askChoice1(void)
AnimFrame FIELDSTG_cutsceneLoopAnim[]
and kind 1's two
Definition fieldstg.c:1354
void FIELDSTG_endChoice3Answer0(void)
u8 FIELDSTG_probes[][5]
the probes of each direction (FIELDSTG_checkFlightProbes)
Definition fieldstg.c:2034
s32 FIELDSTG_fileEntries[]
by character (Actor.key1)
Definition fieldstg.c:2761
void FIELDSTG_startActorSlide(Actor *actor, s32 dir)
Starts an actor sliding in a direction (SLOT_SLIDE)
s32 FIELDSTG_createScriptCommand(s32 id)
Creates the task of script command id, or returns 0.
Definition script.c:81
void * FIELDSTG_askChoice14(void)
void FIELDSTG_controlClimb(Actor *actor)
The player's control on a wall: up and down climb, nothing held holds on.
FieldImages FIELDSTG_images
the field's own stage (FIELDSTG_setupField)
Definition fieldstg.c:2124
void FIELDSTG_createPlayerBalloon(s32 id)
The balloon over the player: script commands 803 to 806 (FIELDSTG_scriptCommands)
Definition balloon.c:108
void FIELDSTG_moveLift(Lift *task, s32 command)
Runs a script command of the lift's: moves it up or down.
Definition lift.c:125
void FIELDSTG_setupField(void)
The setup of the field's own stage (FIELDSTG_initFuncs), which fills FIELDSTG_state as the stage over...
Definition field_stage.c:51
StageSlot FIELDSTG_slots[]
What the player can trigger on the field's map (FieldState.slots), up to type 0.
Definition fieldstg.c:2552
void FIELDSTG_runLaunch(Launch *task)
Sends an actor from the nearest FIELD_TASK_LAUNCHER (y counts twice in the distance) to its dest tile...
Definition launch.c:72
void FIELDSTG_endChoice0Answer1(void)
Actor * FIELDSTG_findActor(s32 character)
The actor of a character (Actor.key1), or NULL.
Definition script.c:11
void(* FIELDSTG_tweenStart)(PanelAnim *tween, s32 in)
FIELDSTG_startTween.
Definition fieldstg.c:2560
StreamTask * FIELDSTG_createStream(s32 size, s32 file)
Creates a stream task of a file, with a buffer of size.
Definition stream.c:168
void FIELDSTG_updateActorIcon(ActorIcon *task)
actor_icon.c
Definition actor_icon.c:7
void FIELDSTG_drawBannerBox(AreaBanner *task, u_long *ot, DVECTOR pos, DVECTOR size, s32 color)
Draws one of the banner's boxes, a flat quad of a color.
Definition banner.c:106
AnimFrame FIELDSTG_cutsceneAnim[]
FIELDSTG_playCutsceneAnim's animations: kind 0's,.
Definition fieldstg.c:1347
SpotEffect * FIELDSTG_createSpotEffect(s32 forEvent)
Creates a search's effect, over the event's actor 0x11B if forEvent, else over the player.
void FIELDSTG_rollBattleSteps(void)
battle.c
Definition battle.c:7
void FIELDSTG_leaveFieldAfter(s32 mode, s32 arg, s32 x, s32 y, s32 dir, s32 delay)
Leaves the field for a mode after a delay: the field task (FIELD_TASK_FIELD) goes to TASK_DONE,...
Definition field.c:687
void FIELDSTG_playCutsceneAnim(CutsceneAnim *task)
cutscene.c
Definition cutscene.c:8
StreamTask * FIELDSTG_findStream(StreamPool *pool, s32 frame)
The stream task that holds a frame (a tile of the map), or NULL.
void FIELDSTG_startEventBattle(s32 index)
Starts battle index of the fourth area, the one events start.
Definition battle.c:61
FieldEffect * FIELDSTG_createEffect(s32 x, s32 y, s32 set)
Creates the effect of a set at (x, y)
Definition effect.c:79
CutsceneAnim * FIELDSTG_createCutsceneAnim(s32 kind)
Creates a cutscene animation of a kind.
Definition cutscene.c:124
void FIELDSTG_seekStream(StreamTask *task, s32 frame, s32 size)
Reads a frame of the map file, a tile, from the CD, unless it has it already.
Definition stream.c:12
s32 FIELDSTG_selectMap(s32 index)
map.c
Definition map.c:19
void FIELDSTG_endChoice10Answer1(void)
void FIELDSTG_getFacingTile(Actor *actor, Vec2 *out)
The tile in front of an actor, one step in its direction.
Definition actor.c:33
Task * FIELDSTG_createFileLoader(s32 step)
Creates the file loader, which starts at a step.
s32 FIELDSTG_checkFlightProbe(Actor *actor, s32 x, s32 y, Vec2 offset)
actor_control.c
void FIELDSTG_showSpotHint(SpotHint *task)
hidden_spots.c
Definition hidden_spots.c:7
s32 FIELDSTG_isActorWalking(Actor *actor)
Whether an actor is still walking to its goal.
Balloon * FIELDSTG_createBalloon(s32 kind, s32 anim, s32 id)
Creates a balloon of a kind (its sprites) with an animation, under a task id.
Definition balloon.c:99
void FIELDSTG_startClimbDown(Actor *actor, s32 dir, s32 x, s32 y, s32 height)
Starts the climb down a wall of height from its top, at (x, y)
void FIELDSTG_requestSlotFiles(Task *task)
Requests the files of the actions the map's slots offer: climbs, drops and the gauge game.
Definition file_loader.c:24
void FIELDSTG_updateSpotEffect(SpotEffect *task)
A search's effect, over the player or, for an event, its actor 0x11B.
s32 FIELDSTG_keepsFileCache(void)
Whether the mode is FIELD_MODE_WSTAG415 or FIELD_MODE_WSTAG815, whose field keeps the file cache and ...
Definition field.c:296
void FIELDSTG_endChoice0Answer0(void)
field_stage.c
void FIELDSTG_endChoice1Answer0(void)
Vec2 * FIELDSTG_getMapSize(MapStreamer *task)
The map's size in pixels.
void FIELDSTG_playBattleTransition(FieldTask *task, FieldChildren *children)
field.c
Definition field.c:102
void FIELDSTG_balloonCommand(Balloon *task, s32 command, s32 id)
A balloon's script commands: 0x325 and 0x327 put it over the actor id with animation 0 or 1,...
Definition balloon.c:114
s16 FIELDSTG_heldVoice
the voice of FIELDSTG_handleFieldCommand's held sound
Definition fieldstg.c:3754
Camera * FIELDSTG_createCamera(void)
Creates the camera.
Definition camera.c:139
void FIELDSTG_startActorWalk(Actor *actor)
Starts an actor walking to its goal.
void FIELDSTG_startEncounter(s32 encounter)
Starts encounter FIELDSTG_encounters[encounter]: the field task (FIELD_TASK_FIELD) leaves for the bat...
Definition field.c:968
void FIELDSTG_updateBanner(AreaBanner *task, AreaNameWindows *windows)
The area name banner: in TASK_INIT it copies its ten boxes from FIELDSTG_bannerBoxes and opens the ar...
Definition banner.c:131
void FIELDSTG_getSpeechPos(Speech *task, Vec2 *out)
speech.c
Definition speech.c:7
void(* FIELDSTG_scriptHelpers[])()
the script helpers (FIELDSTG_toScreenPos...)
Definition fieldstg.c:3581
void FIELDSTG_searchEventSpot(void)
Searches the hidden spots off the map (x 1000 and up), for an event.
Task * FIELDSTG_createField(void)
Creates the field's main task.
Definition field.c:677
s32 FIELDSTG_getStreamSlot(StreamTask *task)
A stream task's slot, or -1.
Definition stream.c:126
Speech * FIELDSTG_createSpeech(Actor *actor, s32 entry, s32 type, s32 isMessage)
Creates the speech of an event's text entry: a message box, or a talk box of a type.
Definition speech.c:64
MapStreamer * FIELDSTG_createMapStreamer(s32 file)
Creates the map streamer of a file.
s32 FIELDSTG_getMapCell(s32 index, Vec2 *pos)
The cell of map index at pos, down the tree from the grid to the pixel (FieldMap.getCell); 1 without ...
Definition map.c:64
Vec2 FIELDSTG_dirSteps[]
tile offset of each direction
Definition fieldstg.c:2113
Vec2 FIELDSTG_tiles[5][6]
FIELDSTG_playBattleTransition's.
Definition fieldstg.c:3758
u8 FIELDSTG_dirLayouts[][2]
the layout and its flips for each direction
Definition fieldstg.c:1492
void FIELDSTG_endChoice4Answer1(void)
s32 FIELDSTG_battleFileStep
FIELDSTG_playBattleTransition's: 0 and 1 wait for the CD, 2 the battle's files are asked for.
Definition fieldstg.c:3759
void FIELDSTG_setActorAnim(Actor *actor, s32 set)
Starts an actor's animation set from its first frame.
void FIELDSTG_drawStream(StreamTask *task, Layer *layer, s32 x, s32 y)
Draws a stream task's tile at (x, y) on a layer: its sprites at the three depths.
Definition stream.c:31
void FIELDSTG_clearStreamSlot(StreamTask *task)
Forgets a stream task's slot.
Definition stream.c:121
void FIELDSTG_drawMapTiles(MapStreamer *task, StreamPool *pool)
Draws the map's tiles in view, under a cover that fades from the new ones, and while the decompressor...
Vec2 FIELDSTG_probePos[]
a probe's position
Definition fieldstg.c:2044
void FIELDSTG_startCommandTask(void)
Creates the task of script command 813 (the create of FIELDSTG_scriptCommands)
Definition commands.c:207
s32 FIELDSTG_dirDepths[]
and its depth offset
Definition fieldstg.c:1984
u8 FIELDSTG_actorWidths[]
by character, in pixels (FieldState.getActorWidth)
Definition fieldstg.c:2920
s32 FIELDSTG_padDirs[]
the direction of each combination of the pad directions
Definition fieldstg.c:2080
s32 FIELDSTG_iconPathStep
the step in FIELDSTG_iconPath
Definition fieldstg.c:1845
u8 FIELDSTG_slotLayouts[][4][5][6]
FIELDSTG_pickViewTiles's slot layouts: [layout][quadrant][row][column].
Definition fieldstg.c:1400
void FIELDSTG_controlPlayer(Actor *actor)
The player's update while it walks (Actor.control) when no menu, event or transition is running: the ...
void * FIELDSTG_askChoice6(void)
void FIELDSTG_pickViewTiles(MapStreamer *task)
Points the slots around the view at the map's tiles: viewTiles gets, for each of the 30 slots,...
s32 FIELDSTG_setEventPose(EventTask *task, s16 *op, EventChildren *children)
An event's pose command (SCRIPT_POSE): puts its actor in a pose, or, for an id of the script commands...
Definition event.c:28
u8 FIELDSTG_triggerAnims[][9]
FIELDSTG_stepBalloonAnim's animations: (frame, time) pairs up to 0xFF.
Definition fieldstg.c:1773
#define TRANSITION_COLUMNS
FIELDSTG_playBattleTransition's tiles: a copy of the screen at TRANSITION_IMAGE_X in VRAM,...
Definition field_mode.h:673
void FIELDSTG_drawCover(s32 id, s32 level)
Covers the screen on the layer id at a shade of level (8.8)
Actor * FIELDSTG_findActorAt(Vec2 *pos)
The first actor (task id 5) whose box holds the tile pos: halfWidth to each side of it,...
ActorIcon * FIELDSTG_createActorIcon(Actor *actor)
Creates the player's icon, in the modes before MODE_NEW_GAME only.
Definition actor_icon.c:94
u8 FIELDSTG_nearDirs[][8]
whether two directions are at most 45 degrees apart
Definition fieldstg.c:1794
void FIELDSTG_setActorDir(Actor *actor, s32 dir)
Turns an actor to a direction.
FieldBattles * FIELDSTG_findBattles(FieldBattles *list, s32 id)
The battles of the place id in a stage's list, or NULL.
Definition state.c:51
void FIELDSTG_haltPartners(void)
actor.c
Definition actor.c:7
void FIELDSTG_animateActor(Actor *actor)
Plays an actor's animation: when its set (animSet) changes, it loads the set's animations for the fiv...
void FIELDSTG_endChoice8Answer0(void)
s32 FIELDSTG_isActorAnimDone(Actor *actor)
Whether an actor's animation has played to its end.
void FIELDSTG_setMap(s32 index)
Puts the player on map index (FieldMap.setMap)
Definition map.c:58
void FIELDSTG_startAreaBattle(void)
Starts one of the eight battles of the player's battle area, at random.
Definition battle.c:18
AnimFrame * FIELDSTG_effectAnims[][4]
FIELDSTG_updateEffect's animations of each set.
Definition fieldstg.c:1396
void FIELDSTG_waitAnimDone(s32 id, s32 *pc)
A script's wait for the animation of the actor id to end.
Definition script.c:30
u8 * FIELDSTG_gaugeRows[]
The rows of FIELDSTG_runGauge's gauges, 2 bits a cell.
Definition fieldstg.c:2020
void * FIELDSTG_askChoice2(void)
void FIELDSTG_startClimbUp(Actor *actor, s32 dir, s32 x, s32 y, s32 height)
The climbs (SLOT_CLIMB_UP and SLOT_CLIMB_DOWN) and the drop (SLOT_DROP): the actor goes onto the wall...
void FIELDSTG_endChoice10Answer0(void)
void FIELDSTG_updateTriggers(Triggers *task, TriggerChildren *children)
The triggers' update: offers the slot under the player while the field isn't busy,...
Definition trigger.c:194
s32 FIELDSTG_talkToActorAt(Actor *actor, Vec2 *pos)
Talks to the character standing at pos, or to the one it stands in for (FIELDSTG_standIns): it answer...
static void FIELDSTG_startBattle(AreaBattle *battle)
Starts a battle: its fight stage, its music and its encounter.
Lift * FIELDSTG_createLift(s32 id)
Creates the lift, raised when flag 0x1C3D is set.
Definition lift.c:141
void FIELDSTG_updateHiddenSpots(HiddenSpots *task, HiddenSpotsChildren *children)
The hidden spots' update: a search plays its effect, then starts a battle where the prize is (and hid...
void FIELDSTG_drawBalloon(Balloon *task)
Draws a balloon over its actor: its frame, and once open, its animation.
Definition balloon.c:19
void FIELDSTG_stopActorSlide(Actor *actor)
Stops a sliding actor (SLOT_STOP_SLIDE)
void FIELDSTG_setActorGoal(Actor *actor, s32 x, s32 y, s32 dir)
Sets the tile an actor walks to and the direction it ends facing (FIELDSTG_walkToGoal)
void FIELDSTG_restorePlayerControl(Actor *actor)
Gives the player its pad control back, off any wall.
ScriptTimer FIELDSTG_scriptTimer
Definition fieldstg.c:3580
BattleSetup BATTLE_SETUP
Definition items.c:886
The children of an actor (FIELDSTG_updateActor)
Definition field_mode.h:141
struct ActorIcon * icon
FIELDSTG_createActorIcon's.
Definition field_mode.h:142
struct Balloon * balloon
FIELDSTG_createBalloon's.
Definition field_mode.h:143
void * action
a gauge game or a launch
Definition field_mode.h:144
struct Speech * speech
FIELDSTG_createTalk's.
Definition field_mode.h:145
The player's icon (FIELD_TASK_ICON, FIELDSTG_createActorIcon): the field commands FIELD_COMMAND_ICON1...
Definition field_mode.h:160
Actor * actor
Definition field_mode.h:162
u8(* anim)[2]
(frame, time) pairs; 0xFF loops to a step
Definition field_mode.h:166
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
Definition field_map.h:114
A character on the field (FIELDSTG_createActor): the player (kind 0) and the other characters.
Definition field_map.h:334
One frame of a sprite animation; frame 0xFF ends it (or loops it)
Definition gfx.h:296
The area name banner (FIELD_TASK_BANNER, FIELDSTG_createBanner)
Definition field_mode.h:636
BannerBox boxes[10]
Definition field_mode.h:638
RECT clip
the layer's, closing in TASK_DONE
Definition field_mode.h:639
A battle of an area's BattleList, which can start on the field (see FIELDSTG_startEncounter); FIGHTST...
Definition field_map.h:402
s32 encounter
of FIELDSTG_encounters
Definition field_map.h:403
s32 stage
the fight stage, for BATTLE_SETUP.stage
Definition field_map.h:404
s32 music
for BATTLE_SETUP.music (MUSIC_); the empty slots, { 0, 0, MUSIC(1, 0) }, keep the bare MUSIC(1,...
Definition field_map.h:405
The windows of FIELDSTG_showAreaName.
Definition field_mode.h:617
TextWindow * area
Definition field_mode.h:618
TextWindow * place
Definition field_mode.h:619
The name of a mode's area (FIELDSTG_showAreaName), up to the first mode 0: the strings of the two win...
Definition field_mode.h:610
A balloon over an actor's head (FIELDSTG_createBalloon): it pops up, plays its FIELDSTG_triggerAnims ...
Definition field_mode.h:173
s32 popOpen
to here
Definition field_mode.h:177
s32 frame
into its FIELDSTG_triggerAnims row
Definition field_mode.h:180
s32 popEnd
and closes to here
Definition field_mode.h:178
Actor * actor
the player when NULL
Definition field_mode.h:175
s32 popStart
the pop-up's sprites, times 4: it opens from here
Definition field_mode.h:176
s32 pop
the pop-up's sprite, times 4
Definition field_mode.h:179
A rectangle of an AreaBanner, which can stretch to a new range.
Definition field_mode.h:623
DVECTOR pos
Definition field_mode.h:625
s32 stretch
1: horizontally, 2: vertically
Definition field_mode.h:628
s32 pad20
0 in every box; never read: FIELDSTG_bannerBoxes' entries are 0x24 bytes
Definition field_mode.h:632
DVECTOR size
Definition field_mode.h:626
An enemy of a battle (FIELDSTG's encounter table points to these)
Definition game_state.h:353
s32 music
the battle's music
Definition game_state.h:385
s32 stage
the battle's fight stage
Definition game_state.h:383
A rectangle, edges included.
Definition field_mode.h:403
s32 left
Definition field_mode.h:404
s32 bottom
Definition field_mode.h:407
s32 top
Definition field_mode.h:406
s32 right
Definition field_mode.h:405
The camera (FIELD_TASK_CAMERA, FIELDSTG_createCamera): it centers the field's layer on an actor or a ...
Definition field_mode.h:252
s32 shake
the step of the shake, 0-3
Definition field_mode.h:257
s32 snap
goes to center at once instead of panning
Definition field_mode.h:263
s32 spotY
Definition field_mode.h:266
Vec2 center
where it looks
Definition field_mode.h:255
s32 unk7C
cleared with each new target; nothing reads it
Definition field_mode.h:262
s16 voice
of the shaking sound, or -1
Definition field_mode.h:258
Vec2 pan
where it looks while it pans to center
Definition field_mode.h:259
s32 shaking
Definition field_mode.h:256
Vec2 bounds
the map's size
Definition field_mode.h:261
Actor * target
the actor it follows (substate 0)
Definition field_mode.h:254
s32 spotX
the spot it looks at (substate 1)
Definition field_mode.h:265
s32 hasBounds
Definition field_mode.h:260
s32 targetId
the target's character (Actor.key1)
Definition field_mode.h:264
The children of a yes/no question at the bottom of the screen: FIELDSTG's ChoiceTask and the stages' ...
Definition field_map.h:483
A yes/no question of the story (FIELDSTG_runChoice); its children are a ChoiceChildren (field_map....
Definition field_mode.h:347
s32 type
FIELDSTG_choices's.
Definition field_mode.h:349
PanelAnim tween
the panel's width
Definition field_mode.h:351
A question of a ChoiceTask.
Definition field_mode.h:355
s32 text
the file counted from TEXT_FILE(1) << 16 | its entry: the question, then the answers
Definition field_mode.h:356
s16 events[2]
FIELDSTG_startEvent's, for each answer.
Definition field_mode.h:358
A cutscene's animation over the field (FIELDSTG_createCutsceneAnim)
Definition field_mode.h:364
s32 frame2
kind 1's second animation
Definition field_mode.h:370
s32 kind
0: file 0x88C (0x87B in the USA), 1: file 0x88D (0x87C)
Definition field_mode.h:366
s32 index
into the animation
Definition field_mode.h:368
Expands "RLEN" data (a run-length encoding: a byte n < 0x80 copies n bytes, n | 0x80 repeats the next...
Definition file.h:110
An animation of an FieldEffect (FIELDSTG_stepEffectAnim)
Definition field_mode.h:386
AnimState anim
Definition field_mode.h:388
An encounter of FIELDSTG_encounters, which FIELDSTG_startEncounter starts: its enemies and the bytes ...
Definition field_mode.h:736
u8 ambushChance
Definition field_mode.h:738
BattleEnemy * enemies[3]
Definition field_mode.h:737
u8 kind
copied to BATTLE_SETUP.encounterKind: 1 for nearly all the maps' random battles (some enemies' battle...
Definition field_mode.h:739
u8 blocks[12]
copied to BATTLE_SETUP.blocks
Definition field_mode.h:743
The children of an EventTask.
Definition field_mode.h:291
struct Speech * boxes[3]
the script's message boxes
Definition field_mode.h:293
s32 scripts[10]
FIELDSTG_createScriptCommand's tasks.
Definition field_mode.h:294
struct Task * task
start's
Definition field_mode.h:292
An event (FIELDSTG_runEvent, made by FIELDSTG_startEvent): it runs a script of 16-bit words,...
Definition field_mode.h:277
void(* end)(void)
Definition field_mode.h:282
struct Actor * actor
Definition field_mode.h:286
s32 id
0 ends the list
Definition field_mode.h:278
struct EventTask::@13 entries[30]
the characters, held while the event runs
s32 wait
frames left of a wait command
Definition field_mode.h:283
s32 event
its id
Definition field_mode.h:279
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
Definition field_map.h:194
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
The children of the field's main task (FieldTask, FIELDSTG_updateField)
Definition field_mode.h:714
struct Actor * actors[4]
the player and the partners
Definition field_mode.h:724
struct Camera * camera
Definition field_mode.h:725
struct MapStreamer * mapStreamer
FIELDSTG_createMapStreamer's.
Definition field_mode.h:729
EventTask * event
Definition field_mode.h:718
Task * fileLoader
FIELDSTG_createFileLoader's, as the field starts.
Definition field_mode.h:720
FieldMenu * menu
createFieldMenu's
Definition field_mode.h:730
struct Inn * inn
createInn's (FIELDSTG_openInn)
Definition field_mode.h:721
union FieldChildren::@14 awaited
the task the field waits for, until it ends
ScreenFade * fade
Definition field_mode.h:716
struct Triggers * triggers
FIELDSTG_createTriggers's.
Definition field_mode.h:727
Task * banner
FIELDSTG_createBanner's.
Definition field_mode.h:723
Task * stage
FieldState.stageInit's.
Definition field_mode.h:728
struct FieldEffect * effect
FIELDSTG_createEffect's.
Definition field_mode.h:715
struct CutsceneAnim * cutscene
FIELDSTG_createCutsceneAnim's.
Definition field_mode.h:717
struct Actor * npcs[15]
FieldState.actors's other characters.
Definition field_mode.h:726
struct MapObjects * mapObjects
FIELDSTG_createMapObjects's.
Definition field_mode.h:731
An effect of up to four animations at a spot (FIELDSTG_createEffect)
Definition field_mode.h:392
s16 set
the row of FIELDSTG_effectAnims
Definition field_mode.h:396
EffectAnim anims[4]
Definition field_mode.h:397
An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts.
Definition field_map.h:141
The image of the field's effects (FieldState.images), then the actors' ActorImages.
Definition field_map.h:127
The field's own image (FieldState.images) and its actors' after it.
Definition field_mode.h:692
ActorImage actors[20]
Definition field_mode.h:694
FieldImage field
Definition field_mode.h:693
The menu opened on the field: the three party members' pages, a list of options (FIELD_MENU_OPTIONS,...
Definition menu.h:116
The field's main task (FIELDSTG_updateField, FIELD_TASK_FIELD); its children follow.
Definition field_mode.h:698
s32 centerOnPlayer
the closing clip shrinks onto the player
Definition field_mode.h:707
s32 leaveDelay
the frames left before it closes the field
Definition field_mode.h:706
void * highBuffer
a buffer at the end of the heap
Definition field_mode.h:705
s32 nextMode
the mode it leaves for (FIELDSTG_leaveFieldAfter)
Definition field_mode.h:703
s32 width
of the clip rectangle
Definition field_mode.h:701
Vec2 warpPos
where the warp's effect plays
Definition field_mode.h:709
s32 fade
FIELDSTG_drawCover's level.
Definition field_mode.h:700
s32 nextModeArg
Definition field_mode.h:704
SlotDest * warp
where it leads
Definition field_mode.h:710
s32 warpKind
the effect and cutscene of a warp (FIELDSTG_startWarp)
Definition field_mode.h:708
s32 cursor
along the row, 0-GAUGE_CURSOR_MAX
Definition field_mode.h:243
s32 back
the cursor goes back
Definition field_mode.h:245
s32 row
of FIELDSTG_gaugeRows
Definition field_mode.h:242
A hidden spot: a map object with anim 0xFF.
Definition field_mode.h:549
s32 frame
its object's
Definition field_mode.h:550
s32 hasPrize
the one picked at random (GAME.prizeSpot)
Definition field_mode.h:553
s32 object
its index in FieldState.objects
Definition field_mode.h:551
The children of an HiddenSpots.
Definition field_mode.h:568
struct SpotHint * hint
Definition field_mode.h:570
struct SpotEffect * effect
Definition field_mode.h:569
The map's hidden spots (FIELD_TASK_HIDDEN_SPOTS, FIELDSTG_createHiddenSpots): one of them,...
Definition field_mode.h:558
HiddenSpot * entries
Definition field_mode.h:561
s32 forEvent
an event's search, without the prize or a hint
Definition field_mode.h:563
Vec2 pos
the prize's
Definition field_mode.h:564
s32 selected
the spot searched
Definition field_mode.h:562
An offset of the icon from the player's tile along a climb over an edge (FIELDSTG_iconPath),...
Definition field_mode.h:152
The inn: pay INNS[inn].price per party member to restore HP, MP and status, with a fade to black and ...
Definition menu.h:66
Launches an actor, spinning, from the nearest launcher (FIELD_TASK_LAUNCHER) to a tile (FIELDSTG_crea...
Definition field_mode.h:208
s32 negY
Definition field_mode.h:216
SlotDest * dest
the tile it lands on
Definition field_mode.h:211
Vec2 start
Definition field_mode.h:213
s32 negX
Definition field_mode.h:215
Task * from
the nearest FIELD_TASK_LAUNCHER
Definition field_mode.h:212
Actor * actor
Definition field_mode.h:210
Vec2 dist
Definition field_mode.h:214
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
The first sector of a map's tile file (MapStreamer.header)
Definition field_mode.h:462
s32 tileCount
the tiles with data (tileSizes not 0); nothing reads it
Definition field_mode.h:463
s32 width
in 128-pixel tiles
Definition field_mode.h:464
s32 tileBytes
the room of a tile on the CD
Definition field_mode.h:466
u16 tileSizes[0]
width * height: each tile's bytes, 0 for none
Definition field_mode.h:467
One of the 12 VRAM slots the map's tiles are loaded into (FIELDSTG_slotImages)
Definition field_mode.h:477
s32 time
when it was last drawn
Definition field_mode.h:479
s32 cover
the level of the cover over a new tile (8.8), 0 for none
Definition field_mode.h:480
s32 frame
the tile it holds, or -1
Definition field_mode.h:478
Animates and draws the map's objects (FIELDSTG_createMapObjects)
Definition field_mode.h:508
struct StageTile * objects
Definition field_mode.h:511
s32 sprites
their sprite file and entry
Definition field_mode.h:510
The task that streams the map's tiles from the CD around the view (FIELDSTG_runMapStreamer,...
Definition field_mode.h:487
s32 viewX
the tile column of the slots' left edge
Definition field_mode.h:500
s32 frameSectors
a tile's sectors on the CD
Definition field_mode.h:496
MapTile * tiles
width * height
Definition field_mode.h:498
s32 viewY
their top row
Definition field_mode.h:501
s32 pad60
never read or written
Definition field_mode.h:492
MapFileHeader * header
the map file's, while it is read
Definition field_mode.h:490
s32 pad50
never read or written
Definition field_mode.h:489
s32 width
in 128-pixel tiles
Definition field_mode.h:494
s32 file
the map's tiles, read from the CD (FieldState.mapFile)
Definition field_mode.h:493
u8 viewTiles[30]
by the slots around the view, their tiles
Definition field_mode.h:499
MapImage images[12]
Definition field_mode.h:497
A tile of the map that MapStreamer streams.
Definition field_mode.h:471
s32 size
its bytes on the CD, 0 for none
Definition field_mode.h:472
s32 sectors
what it reads (StreamTask.seek)
Definition field_mode.h:473
Opens or closes a menu panel: level goes 0 -> ONE in duration frames (or back at twice the speed),...
Definition menu.h:18
A story event (FIELDSTG_progressEvents): at a progress, while a flag is clear and a condition holds,...
Definition field_mode.h:335
s32 progress
-1 ends the list
Definition field_mode.h:336
Fades the whole screen to black and back with a subtractive rectangle.
Definition gfx.h:361
An entry of the script command table FIELDSTG_scriptCommands (ids from 0x320)
Definition field_mode.h:300
s32(* create)(s32 id)
creates the command's task; FIELDSTG's own return nothing or a Lift, so the table casts them
Definition field_mode.h:302
void(* handle)()
(task, command, arg): each command's task has its own type
Definition field_mode.h:304
A wait timer for the scripts (FIELDSTG_waitScriptTime)
Definition field_mode.h:308
void(* reset)(void)
Definition field_mode.h:311
Where a slot leads: a StageSlot from its arg on, as the warps (FieldTask.warp) and the launches (Laun...
Definition field_map.h:291
A message box, or a talk box that follows an actor (FIELDSTG_createSpeech, FIELDSTG_createTalk)
Definition field_mode.h:195
s32 isMessage
a message box
Definition field_mode.h:200
s32 type
the talk box's (createTalkBox), its corner
Definition field_mode.h:199
s32 entry
the text's entry
Definition field_mode.h:198
Actor * actor
Definition field_mode.h:197
void * text
FILE_CACHE.getEntry's.
Definition field_mode.h:201
The effect of searching a hidden spot, in front of the actor that searches (FIELDSTG_createSpotEffect...
Definition field_mode.h:575
The hint of a hidden spot that held nothing (FIELDSTG_createSpotHint): its sprite and its palette cyc...
Definition field_mode.h:539
s32 speed
frames per palette step
Definition field_mode.h:542
Vec2 from
Definition field_mode.h:544
An entry of the stage tables (FIELDSTG_pickStage): the stage overlay of a mode, up to the first mode ...
Definition field_mode.h:646
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
A character that another answers for when the player talks to it (FIELDSTG_talkToActorAt,...
Definition field_mode.h:186
s16 character
Actor.key1.
Definition field_mode.h:187
s16 answerer
the key1 of the actor that answers
Definition field_mode.h:188
EventTask * script
Definition field_mode.h:330
The story events of the field (FIELDSTG_createStoryEvents)
Definition field_mode.h:322
s32 script
the script to run next, or 0
Definition field_mode.h:325
void * owner
the field's task, as a stage's init gets it
Definition field_mode.h:324
The StreamTasks of a task's children (FIELDSTG_requestTiles)
Definition field_mode.h:454
Decompressor * decompressor
Definition field_mode.h:455
StreamTask * tasks[30]
Definition field_mode.h:456
A sprite of a StreamTask's frame.
Definition field_mode.h:413
A task that reads the frames of a file from the disc (FIELDSTG_createStream)
Definition field_mode.h:424
s32 * data
the decompressed tile: its sprites, then its image
Definition field_mode.h:442
s32(* getFrame)(struct StreamTask *task)
Definition field_mode.h:447
s32(* getSlot)(struct StreamTask *task)
Definition field_mode.h:448
void(* seek)(struct StreamTask *task, s32 frame, s32 size)
Definition field_mode.h:443
void(* setSource)(struct StreamTask *task, s32 slot, Decompressor *source)
Definition field_mode.h:446
void(* clearSlot)(struct StreamTask *task)
Definition field_mode.h:449
void * buffer
Definition field_mode.h:432
void(* updateTime)(struct StreamTask *task)
Definition field_mode.h:450
void(* draw)(struct StreamTask *task, Layer *layer, s32 x, s32 y)
Definition field_mode.h:445
StreamSprite sprites[3][5]
Definition field_mode.h:439
Decompressor * source
what it reads its sprites from (FIELDSTG_setStreamSource)
Definition field_mode.h:441
s32(* isLoaded)(struct StreamTask *task)
Definition field_mode.h:444
s32 loadedTime
when its read ended, 0 while reading
Definition field_mode.h:427
s32 frameSectors
Definition field_mode.h:431
s32 loadedSlot
the slot its image is loaded into, or -1
Definition field_mode.h:434
Any task, seen through its header.
Definition task.h:62
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
Definition text.h:131
A step of FIELDSTG_playBattleTransition's spiral: one coordinate of a tile moves by dir until it pass...
Definition field_mode.h:685
s32 * value
Definition field_mode.h:686
s32 dir
1, -1, or 0 at the end
Definition field_mode.h:687
TrailStep steps[64]
Definition field_mode.h:137
Actor * leader
Definition field_mode.h:134
s32 head
Definition field_mode.h:135
s32 tail
Definition field_mode.h:136
The children of an Triggers.
Definition field_mode.h:530
struct Balloon * balloon
Definition field_mode.h:531
EventTask * script
Definition field_mode.h:532
The map's triggers (FIELDSTG_createTriggers): on a trigger's cell (layer 7: index and direction) the ...
Definition field_mode.h:519
s32 dir
the trigger's direction
Definition field_mode.h:525
s32 sheetEntry
the stage's sprite sheet (FieldState.sheetEntry); nothing reads it
Definition field_mode.h:521
StageSlot * entry
Definition field_mode.h:526
StageSlot * entries
FieldState.slots.
Definition field_mode.h:522
Actor * actor
the player
Definition field_mode.h:523
s32 index
the trigger under it
Definition field_mode.h:524
Definition gfx.h:352