Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
start.c
Go to the documentation of this file.
1/* FIELDSTG's entry point, which the executable starts the field mode with */
2
3#include "field/field_mode.h"
4
5/* FIELDSTG's root task: notes whether the mode is new (GAME.clearTempFlags)
6 and creates the field */
7void FIELDSTG_updateRoot(Task *task, Task **children) {
8 s32 mode;
9
10 switch (task->state) {
11 default:
12 case TASK_INIT:
13 mode = GAME.funcs.getMode();
14 if (GAME.lastFieldMode != mode) {
15 GAME.lastFieldMode = mode;
17#if VERSION_EU || VERSION_JP
18 GAME.randomGauges = 0x10;
19#endif
20 } else {
22 }
23 children[0] = FIELDSTG_createField();
24 task->nextState(task);
25 break;
26 case TASK_RUN:
27 case TASK_DONE:
28 case TASK_KILL:
29 break;
30 }
31}
32
33/* FIELDSTG's entry point: creates its root task */
35 return createTask(FIELDSTG_updateRoot, sizeof(Task), 0xC);
36}
signed int s32
Definition common.h:11
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
void FIELDSTG_updateRoot(Task *task, Task **children)
FIELDSTG's root task: notes whether the mode is new (GAME.clearTempFlags) and creates the field.
Definition start.c:7
Task * FIELDSTG_start(void)
FIELDSTG's entry point: creates its root task.
Definition start.c:34
Task * FIELDSTG_createField(void)
Creates the field's main task.
Definition field.c:677
FIELDSTG.PRO: the field mode, where the player walks around the map.
s32(* getMode)(void)
Definition game_state.h:19
s32 lastFieldMode
Definition game_state.h:574
s32 clearTempFlags
Definition game_state.h:573
s32 randomGauges
gauge games left with random rows, reset with each new mode
Definition game_state.h:581
GameFuncs funcs
Definition game_state.h:582
Any task, seen through its header.
Definition task.h:62
void(* nextState)(struct Task *task)
Definition task.h:63
s32 state
Definition task.h:63
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105