Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
scene.c
Go to the documentation of this file.
1/* CARDGAME's scene, which the mode starts (CARDGAME_start). */
2
4
5/* The mode's task: sets up the display and starts the battle, then returns
6 to the field once it is over (or to MODE_STAGE_SELECT when the mode's low
7 bits are set) */
8void CARDGAME_updateScene(Task *task, CardBattle **items) {
9 TimLoader tim;
10 Layer *layer;
11
12 switch (task->state) {
13 case 0:
14 default:
15 GFX.funcs.reset();
18 initTimLoader(&tim);
19 tim.setImagePos(0x280, 0);
21 tim.setImagePos(0x340, 0);
23 layer = GFX.funcs.createLayer(&CARDGAME_screenRect, 3, 0x100);
24 layer->setBgColor(layer, 0x1F, 0x1F, 0x1F);
26 task->nextState(task);
27 break;
28 case 1:
29 if (items[0]->result == 2) {
30 task->setState(task, 2);
31 items[0]->setState(items[0], 3);
32 }
33 break;
34 case 2:
35 switch (task->substate) {
36 case 0:
37 default:
39 task->nextSubstate(task);
40 break;
41 case 1:
42 break;
43 }
44 break;
45 case 3:
46 break;
47 }
48}
49
50/* The mode's entry point (MODE_ENTRY_POINTS) */
52 return createTask(CARDGAME_updateScene, sizeof(Task), 4);
53}
CARDGAME.PRO: the card battle (mode 0x700).
CardBattle * CARDGAME_createBattle(s32 arg)
Creates the card battle against opponent arg (CARDGAME_loadOpponent), with its functions,...
Definition battle.c:2554
Task * CARDGAME_start(void)
The mode's entry point (MODE_ENTRY_POINTS)
Definition scene.c:51
void CARDGAME_updateScene(Task *task, CardBattle **items)
The mode's task: sets up the display and starts the battle, then returns to the field once it is over...
Definition scene.c:8
RECT CARDGAME_screenRect
The data: the rest of the overlay's, this object's tables and the variables, which the second object ...
Definition cardgame_3.c:8
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#define MODE_STAGE_SELECT
STAGSLCT, the debug stage select.
Definition game_state.h:454
#define SCREEN_WIDTH
The screen the modes draw on (setDisplayMode, their layers' rects)
Definition gfx.h:36
#define SCREEN_HEIGHT
Definition gfx.h:37
#define FILE_CARDGAME_TIMS
CARDGAME's own pictures, a TIM archive.
Definition screen.h:15
The card battle (CARDGAME_createBattle).
Definition battle.h:226
void(* setState)(struct CardBattle *task, s32 state)
Definition battle.h:227
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
s32(* getMode)(void)
Definition game_state.h:19
s32(* getModeArg)()
Definition game_state.h:20
void(* requestMode)(s32 mode, s32 arg)
Definition game_state.h:21
s32 fieldMode
where the menu returns to
Definition game_state.h:503
GameFuncs funcs
Definition game_state.h:582
void(* reset)(void)
Definition gfx.h:17
void(* allocPrimBuffers)(s32 size)
Definition gfx.h:18
struct Layer *(* createLayer)(RECT *rect, s32 otShift, s32 id)
Definition gfx.h:24
void(* setDisplayMode)(s32 w, s32 h, s32 hires, s32 interlace)
Definition gfx.h:26
GfxFuncs funcs
Definition gfx.h:77
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
void(* setBgColor)()
no prototype: callers would truncate u8 args
Definition gfx.h:152
Any task, seen through its header.
Definition task.h:62
void(* setState)(struct Task *task, s32 state)
Definition task.h:63
void(* nextSubstate)(struct Task *task)
Definition task.h:63
s32 substate
Definition task.h:63
void(* nextState)(struct Task *task)
Definition task.h:63
s32 state
Definition task.h:63
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
Definition gfx.h:325
void(* setImagePos)()
(x, y)
Definition gfx.h:336
void(* loadArchive)()
(archive): each image 64 halfwords to the right
Definition gfx.h:338
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.
Definition tim_loader.c:119