Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
state.c
Go to the documentation of this file.
1/* FieldState's methods: the file and width of a character, the stage of
2 the mode and the battles of a place */
3
4#include "field/field_mode.h"
5
6/* The file entry index of FIELDSTG_fileEntries */
8 return FIELDSTG_fileEntries[index];
9}
10
11/* The width of character index */
13 return FIELDSTG_actorWidths[index];
14}
15
16/* Picks the stage overlay of the mode (FIELDSTG_stages, in the European
17 version's extra chapter FIELDSTG_extraStages and then those): its file and
18 its setup; hangs if there is none */
20 StageEntry *entry;
21 s32 mode;
22
23#if VERSION_US
24 entry = FIELDSTG_stages;
25#elif VERSION_EU || VERSION_JP
26 if (GAME.progress != STORY_EXTRA) {
27 entry = FIELDSTG_stages;
28 } else {
30 }
31#endif
32 mode = GAME.funcs.getMode();
34 while (1) {
35 if (entry->mode == mode) {
38 break;
39 }
40 if ((++entry)->mode == 0) {
41 break;
42 }
43 }
44 if (entry->mode == 0) {
45 while (1) {
46 }
47 }
48}
49
50/* The battles of the place id in a stage's list, or NULL */
52 s32 i;
53
54 for (i = 0; i < 30; i++) {
55 if (list->id == id) {
56 return list;
57 }
58 list++;
59 }
60 return NULL;
61}
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
s32 FIELDSTG_getActorWidth(s32 index)
The width of character index.
Definition state.c:12
s32 FIELDSTG_getFileEntry(s32 index)
The file entry index of FIELDSTG_fileEntries.
Definition state.c:7
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
FieldBattles * FIELDSTG_findBattles(FieldBattles *list, s32 id)
The battles of the place id in a stage's list, or NULL.
Definition state.c:51
FIELDSTG.PRO: the field mode, where the player walks around the map.
StageEntry FIELDSTG_extraStages[]
The European and Japanese versions' extra chapter's stages (STORY_EXTRA), the modes they take over fi...
Definition fieldstg.c:2977
StageEntry FIELDSTG_stages[]
Definition fieldstg.c:3337
s32 FIELDSTG_fileEntries[]
by character (Actor.key1)
Definition fieldstg.c:2761
FieldState FIELDSTG_state
Definition fieldstg.c:2641
u8 FIELDSTG_actorWidths[]
by character, in pixels (FieldState.getActorWidth)
Definition fieldstg.c:2920
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
Definition heap.c:184
@ STORY_EXTRA
WSTAG780, event 1500, in the European and Japanese versions: the extra chapter, whose stages are FIEL...
Definition story.h:149
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
s32 id
the place, GAME.place
Definition field_map.h:424
struct Task *(* stageInit)(void *owner)
starts the stage's task
Definition field_map.h:443
s32 stageFile
the stage overlay's file
Definition field_map.h:442
s32(* getMode)(void)
Definition game_state.h:19
GameFuncs funcs
Definition game_state.h:582
void(* zero)(void *ptr, s32 size)
Definition heap.h:32
An entry of the stage tables (FIELDSTG_pickStage): the stage overlay of a mode, up to the first mode ...
Definition field_mode.h:646
struct Task *(* init)(void *owner)
Definition field_mode.h:649