Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
preloader.c
Go to the documentation of this file.
1/* CARDGAME's preloader of the card game's files. */
2
4
5/* Requests the files of CARDGAME_preloadFiles one after the other, and ends after the
6 last */
8 switch (task->state) {
9 case 0:
10 default:
11 task->index = 0;
12 task->setState(task, 1);
13 task->ready = 0;
14 break;
15 case 1:
16 switch (task->substate) {
17 case 0:
18 default:
19 task->file = CARDGAME_preloadFiles[task->index].file;
20 if (CARDGAME_preloadFiles[task->index].isText != 0) {
21 task->file += TEXT_FILE(1);
22 }
23 FILE_CACHE.request(task->file);
24 task->substate++;
25 case 1:
26 break;
27 }
28 if (FILE_CACHE.isLoading(task->file) == 0) {
29 if (CARDGAME_preloadFiles[++task->index].file == -2) {
30 task->index++;
31 task->ready = 1;
32 }
33 if (CARDGAME_preloadFiles[task->index].file == -1) {
34 task->setState(task, 3);
35 }
36 task->substate = 0;
37 }
38 break;
39 case 2:
40 case 3:
41 break;
42 }
43}
44
45/* Starts the preloader of the card game's files (CARDGAME_tickPreloader) */
CARDGAME.PRO: the card battle (mode 0x700).
CardFileEntry CARDGAME_preloadFiles[]
Definition cardgame_3.c:112
#define TEXT_FILE(file)
Definition file.h:190
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
void CARDGAME_tickPreloader(CardPreloader *task)
Requests the files of CARDGAME_preloadFiles one after the other, and ends after the last.
Definition preloader.c:7
CardPreloader * CARDGAME_startPreloader(void)
Starts the preloader of the card game's files (CARDGAME_tickPreloader)
Definition preloader.c:46
s16 file
-2: the files before are enough to start, -1: the end
Definition screen.h:20
Reads CARDGAME's files into the file cache, one at a time.
Definition screen.h:25
s32 substate
Definition screen.h:26
s32 ready
the files before the first -2 are in
Definition screen.h:27
void(* setState)(struct CardPreloader *task, s32 state)
Definition screen.h:26
s32(* isLoading)(s32 file)
Definition file.h:88
void(* request)(s32 file)
Definition file.h:90
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105