Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
lab.c
Go to the documentation of this file.
1/* The mode's main task, the lab, which runs the main menu and its screens;
2 its files and helpers; and the overlay's tables */
3
4#include "menus/digimon_lab.h"
5
6/* Creates the main menu and opens the screen it picks, back to the menu when
7 the screen closes; once the menu is gone, ends the lab after the fade out */
8void STGDGLAB_runLab(Lab *lab, LabChildren *children) {
9 switch (lab->substate) {
10 case 0:
11 default:
12 if (children->menu == NULL) {
13 children->menu = STGDGLAB_createMenu(lab);
14 }
15 lab->substate++;
16 break;
17 case 1:
18 if (children->menu != NULL) {
19 if (children->menu->picked != 0) {
20 children->screen = STGDGLAB_screens[children->menu->choice](lab);
21 lab->substate++;
22 }
23 } else {
24 lab->substate = 3;
25 }
26 break;
27 case 2:
28 if (children->screen == NULL) {
29 lab->substate = 1;
30 children->menu->picked = 0;
31 }
32 break;
33 case 3:
34 if (children->fade->state == 2) {
35 lab->setState(lab, TASK_KILL);
36 }
37 break;
38 }
39}
40
41/* Counts the party and moves its members to the first places of GAME.party */
43 s32 i;
44 s32 j;
45
46 lab->partyCount = 0;
47 for (i = 0; i < 3; i++) {
48 if (GAME.party[i] >= 0) {
49 lab->partyCount++;
50 }
51 }
52 for (i = 0; i < 3; i++) {
53 if (GAME.party[i] < 0) {
54 for (j = i; j < 3; j++) {
55 if (GAME.party[j] >= 0) {
56 GAME.party[i] = GAME.party[j];
57 GAME.party[j] = -1;
58 break;
59 }
60 }
61 }
62 }
63}
64
65/* The mode's main task: loads the files and packs the party, then runs the lab
66 (STGDGLAB_runLab) and draws sprite 0x37 sliding diagonally; when killed it
67 goes back to the field (GAME.fieldMode) */
68void STGDGLAB_updateLab(Lab *lab, LabChildren *children) {
69 SpriteDrawer sprite;
70
71 switch (lab->state) {
72 case TASK_INIT:
73 default:
74 switch (lab->substate) {
75 case 0:
76 default:
78 lab->substate++;
79 break;
80 case 1:
81 if (STGDGLAB_data.funcs.filesLoading() == 0) {
82 lab->nextState(lab);
83 lab->partySize = PARTY_SIZE;
85 }
86 break;
87 }
88 break;
89 case TASK_RUN:
90 STGDGLAB_runLab(lab, children);
91 initSpriteDrawer(&sprite);
92 sprite.setLayerId(lab->layer, 7);
93 sprite.setTexture(0x280, 0x100);
94 if (lab->bgTick != 0) {
95 lab->bgScroll++;
96 lab->bgScroll = lab->bgScroll < 0x60 ? lab->bgScroll : 0;
97 lab->bgTick = 0;
98 } else {
99 lab->bgTick = 1;
100 }
101 sprite.draw(FILE_CACHE.getEntry(FILE_LAB_SPRITES << 16), 0x37, lab->bgScroll, lab->bgScroll);
102 break;
103 case TASK_DONE:
104 break;
105 case TASK_KILL:
107 break;
108 }
109}
110
111/* Lab.openMenu: opens the main menu's page again; 1 if the menu was running */
113 LabChildren *children = lab->children;
114 LabMenu *menu = children->menu;
115
116 if (menu != NULL && menu->state == TASK_RUN) {
117 menu->open(menu);
118 return 1;
119 }
120 return 0;
121}
122
123/* Lab.closeMenu: closes the main menu's page; 1 if the menu was running */
125 LabChildren *children = lab->children;
126 LabMenu *menu = children->menu;
127
128 if (menu != NULL && menu->state == TASK_RUN) {
129 menu->close(menu);
130 return 1;
131 }
132 return 0;
133}
134
135/* Lab.menuOpen: 1 when the main menu's task is running (its page not fading) */
137 LabChildren *children = lab->children;
138 LabMenu *menu = children->menu;
139
140 if (menu != NULL && menu->state == TASK_RUN) {
141 return 1;
142 }
143 return 0;
144}
145
146/* Lab.fadeOut: fades the screen out in 0x1E frames, as the lab is left */
148 LabChildren *children = lab->children;
149
150 children->fade = STGDGLAB_createFader();
151 children->fade->start(children->fade, 0, 0x1E);
152}
153
154/* Creates the mode's main task, the lab */
156 Lab *lab = createTask(STGDGLAB_updateLab, sizeof(Lab), sizeof(LabChildren));
157
163 lab->layer = SCREEN_LAYER;
164 return lab;
165}
166
167/* Loads the lab's textures and requests its strings: the lab's and the
168 Digimon's and skills' names and descriptions */
170 TimLoader loader;
171
172 initTimLoader(&loader);
173 loader.setImagePos(0x280, 0x100);
174 loader.loadArchive(FILE_CACHE.getEntry((FILE_LAB_SPRITES + 1) << 16));
175 loader.setImagePos(0x140, 0x100);
176 loader.setClutPos(0x280, 0);
177 loader.setBufferSize(0x10000);
178 loader.loadArchive(FILE_CACHE.getEntry(((FILE_LAB_SPRITES + 1) << 16) + 2));
184}
185
186/* Whether the lab's strings are still loading */
189 return 1;
190 }
192 return 1;
193 }
195 return 1;
196 }
198 return 1;
199 }
201}
202
207
208/* The sprite of a recipe's id (STGDGLAB_entries), 0 for an id not there */
210 s32 i;
211
212 for (i = 0; STGDGLAB_entries[i].id != 0; i++) {
213 if (STGDGLAB_entries[i].id == id) {
214 return STGDGLAB_entries[i].sprite;
215 }
216 }
217 return 0;
218}
219
220/* The third value (b) of a recipe's id in STGDGLAB_entries, 0 for an id not
221 there; LabFuncs.getB, which nothing in the overlay calls */
223 s32 i;
224
225 for (i = 0; STGDGLAB_entries[i].id != 0; i++) {
226 if (STGDGLAB_entries[i].id == id) {
227 return STGDGLAB_entries[i].b;
228 }
229 }
230 return 0;
231}
232
233/* The main menu's screens */
237/* The partners' animation frames, -1 ends */
239 { { 7, 8, 9, 10, 9, 8, -1 } },
240 { { 14, 15, 16, 15, -1, -1, -1 } },
241 { { 11, 12, 13, 12, -1, -1, -1 } },
242 { { 3, 4, 5, 6, 5, 4, -1 } },
243 { { 25, 26, 27, 28, 27, 26, -1 } },
244 { { 0, 1, 2, 1, -1, -1, -1 } },
245 { { 17, 18, 19, 20, 19, 18, -1 } },
246 { { 21, 22, 23, 24, 23, 22, -1 } },
247};
248/* Where the windows go: the five stats' labels, their values and the name */
250 { 21, 51, 38 },
251 { 22, 51, 48 },
252 { 23, 95, 48 },
253 { 14, 51, 57 },
254 { 23, 95, 57 },
255 { 18, 80, 38 },
256 { 18, 93, 48 },
257 { 18, 128, 48 },
258 { 18, 93, 57 },
259 { 18, 128, 57 },
260 { -1, 51, 23 },
261};
262/* The items of the recipes, up to id 0: their sprite (STGDGLAB_getItemSprite) and
263 STGDGLAB_getItemB's value */
265 { 0x017F, 0x0002, 0x010C },
266 { 0x0181, 0x0004, 0x011D },
267 { 0x0180, 0x0003, 0x0114 },
268 { 0x0003, 0x0001, 0x012A },
269 { 0x0091, 0x0007, 0x012B },
270 { 0x016E, 0x0000, 0x012C },
271 { 0x0175, 0x0005, 0x0115 },
272 { 0x001F, 0x0006, 0x010D },
273 { 0x0005, 0x0022, 0x0127 },
274 { 0x0006, 0x001D, 0x0132 },
275 { 0x000C, 0x0023, 0x0125 },
276 { 0x0013, 0x0017, 0x011C },
277 { 0x0014, 0x000B, 0x010A },
278 { 0x001A, 0x0028, 0x0131 },
279 { 0x001B, 0x0025, 0x0108 },
280 { 0x0038, 0x0021, 0x0135 },
281 { 0x003B, 0x0010, 0x0123 },
282 { 0x0042, 0x001E, 0x0130 },
283 { 0x0090, 0x000F, 0x0119 },
284 { 0x0094, 0x0013, 0x0121 },
285 { 0x0096, 0x002A, 0x011E },
286 { 0x0097, 0x0019, 0x012D },
287 { 0x00C4, 0x0026, 0x0117 },
288 { 0x00D3, 0x000C, 0x0105 },
289 { 0x00D5, 0x0024, 0x0102 },
290 { 0x00D6, 0x000D, 0x0134 },
291 { 0x00E6, 0x0018, 0x0118 },
292 { 0x00EA, 0x000E, 0x0106 },
293 { 0x00FE, 0x0012, 0x0124 },
294 { 0x0103, 0x0011, 0x0129 },
295 { 0x0104, 0x0016, 0x010B },
296 { 0x010B, 0x0029, 0x0133 },
297 { 0x0167, 0x0014, 0x0120 },
298 { 0x016F, 0x0008, 0x0128 },
299 { 0x0170, 0x0009, 0x0126 },
300 { 0x0171, 0x000A, 0x011F },
301 { 0x0174, 0x0027, 0x0122 },
302 { 0x0176, 0x001A, 0x0112 },
303 { 0x0177, 0x001B, 0x0110 },
304 { 0x0178, 0x001C, 0x010F },
305 { 0x0179, 0x0020, 0x012F },
306 { 0x017A, 0x001F, 0x012E },
307 { 0x017D, 0x0015, 0x0100 },
308 { 0x0182, 0x0031, 0x0109 },
309 { 0x0183, 0x002B, 0x0113 },
310 { 0x0184, 0x002E, 0x011B },
311 { 0x0185, 0x0032, 0x0107 },
312 { 0x0186, 0x002C, 0x0111 },
313 { 0x0187, 0x002F, 0x011A },
314 { 0x0188, 0x0033, 0x0101 },
315 { 0x0189, 0x002D, 0x010E },
316 { 0x018A, 0x0030, 0x0116 },
317 { 0x0000, 0x0000, 0x0000 },
318};
319/* The recipes of each table (STGDGLAB_data.recipes), by row and column */
320#if VERSION_US
322 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
323 { 3, { 0x005, 0x00C, 0x0D5, 0, 0 } },
324 { 3, { 0, 0x01A, 0x10B, 0x096, 0 } },
325 { 0, { 0, 0, 0, 0, 0 } },
326 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
327 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
328 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
329 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
330 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
331 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
332 { 1, { 0x038, 0, 0, 0, 0 } },
333 { 4, { 0x006, 0x042, 0x17A, 0x179, 0 } },
334 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
335 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
336 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
337 { 0, { 0, 0, 0, 0, 0 } },
338};
340 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
341 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
342 { 1, { 0x038, 0, 0, 0, 0 } },
343 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
344 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
345 { 4, { 0x006, 0x042, 0x17A, 0x179, 0 } },
346 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
347 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
348 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
349 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
350 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
351 { 0, { 0, 0, 0, 0, 0 } },
352 { 3, { 0x005, 0x00C, 0x0D5, 0, 0 } },
353 { 3, { 0, 0x01A, 0x10B, 0x096, 0 } },
354 { 3, { 0, 0x182, 0x185, 0x188, 0 } },
355 { 0, { 0, 0, 0, 0, 0 } },
356};
358 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
359 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
360 { 3, { 0, 0x01B, 0x0C4, 0x174, 0 } },
361 { 1, { 0, 0x038, 0, 0, 0 } },
362 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
363 { 3, { 0, 0x0EA, 0x090, 0x03B, 0 } },
364 { 3, { 0, 0x176, 0x177, 0x178, 0 } },
365 { 0, { 0, 0, 0, 0, 0 } },
366 { 3, { 0x005, 0x00C, 0x0D5, 0, 0 } },
367 { 3, { 0, 0x01A, 0x10B, 0x096, 0 } },
368 { 4, { 0, 0x006, 0x042, 0x17A, 0x179 } },
369 { 0, { 0, 0, 0, 0, 0 } },
370 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
371 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
372 { 3, { 0, 0x16F, 0x170, 0x171, 0 } },
373 { 3, { 0, 0x184, 0x187, 0x18A, 0 } },
374};
376 { 3, { 0x005, 0x00C, 0x0D5, 0, 0 } },
377 { 3, { 0, 0x01A, 0x10B, 0x096, 0 } },
378 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
379 { 0, { 0, 0, 0, 0, 0 } },
380 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
381 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
382 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
383 { 0, { 0, 0, 0, 0, 0 } },
384 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
385 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
386 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
387 { 1, { 0, 0x038, 0, 0, 0 } },
388 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
389 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
390 { 3, { 0, 0x0EA, 0x090, 0x03B, 0 } },
391 { 4, { 0, 0x006, 0x042, 0x17A, 0x179 } },
392};
394 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
395 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
396 { 3, { 0, 0x01B, 0x0C4, 0x174, 0 } },
397 { 4, { 0, 0x006, 0x042, 0x17A, 0x179 } },
398 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
399 { 3, { 0x005, 0x00C, 0x0D5, 0, 0 } },
400 { 3, { 0, 0x01A, 0x10B, 0x096, 0 } },
401 { 0, { 0, 0, 0, 0, 0 } },
402 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
403 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
404 { 3, { 0, 0x0EA, 0x090, 0x03B, 0 } },
405 { 0, { 0, 0, 0, 0, 0 } },
406 { 1, { 0x038, 0, 0, 0, 0 } },
407 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
408 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
409 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
410};
412 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
413 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
414 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
415 { 0, { 0, 0, 0, 0, 0 } },
416 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
417 { 1, { 0x038, 0, 0, 0, 0 } },
418 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
419 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
420 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
421 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
422 { 3, { 0x005, 0x00C, 0x0D5, 0, 0 } },
423 { 3, { 0, 0x01A, 0x10B, 0x096, 0 } },
424 { 4, { 0x006, 0x042, 0x17A, 0x179, 0 } },
425 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
426 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
427 { 0, { 0, 0, 0, 0, 0 } },
428};
430 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
431 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
432 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
433 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
434 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
435 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
436 { 4, { 0x006, 0x042, 0x17A, 0x179, 0 } },
437 { 1, { 0x038, 0, 0, 0, 0 } },
438 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
439 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
440 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
441 { 0, { 0, 0, 0, 0, 0 } },
442 { 3, { 0x005, 0x00C, 0x0D5, 0, 0 } },
443 { 3, { 0, 0x01A, 0x10B, 0x096, 0 } },
444 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
445 { 0, { 0, 0, 0, 0, 0 } },
446};
448 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
449 { 1, { 0x038, 0, 0, 0, 0 } },
450 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
451 { 0, { 0, 0, 0, 0, 0 } },
452 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
453 { 3, { 0x005, 0x00C, 0x0D5, 0, 0 } },
454 { 3, { 0, 0x01A, 0x10B, 0x096, 0 } },
455 { 0, { 0, 0, 0, 0, 0 } },
456 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
457 { 3, { 0, 0x01B, 0x0C4, 0x174, 0 } },
458 { 3, { 0, 0x16F, 0x170, 0x171, 0 } },
459 { 4, { 0, 0x006, 0x042, 0x17A, 0x179 } },
460 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
461 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
462 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
463 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
464};
465#elif VERSION_EU || VERSION_JP
467 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
468 { 4, { 0x005, 0x00C, 0x0D5, 0x096, 0 } },
469 { 2, { 0, 0x01A, 0x10B, 0, 0 } },
470 { 0, { 0, 0, 0, 0, 0 } },
471 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
472 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
473 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
474 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
475 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
476 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
477 { 1, { 0x038, 0, 0, 0, 0 } },
478 { 4, { 0x006, 0x042, 0x17A, 0x179, 0 } },
479 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
480 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
481 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
482 { 0, { 0, 0, 0, 0, 0 } },
483};
485 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
486 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
487 { 1, { 0x038, 0, 0, 0, 0 } },
488 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
489 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
490 { 4, { 0x006, 0x042, 0x17A, 0x179, 0 } },
491 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
492 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
493 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
494 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
495 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
496 { 0, { 0, 0, 0, 0, 0 } },
497 { 4, { 0x005, 0x00C, 0x0D5, 0x096, 0 } },
498 { 2, { 0, 0x01A, 0x10B, 0, 0 } },
499 { 3, { 0, 0x182, 0x185, 0x188, 0 } },
500 { 0, { 0, 0, 0, 0, 0 } },
501};
503 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
504 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
505 { 3, { 0, 0x01B, 0x0C4, 0x174, 0 } },
506 { 1, { 0, 0x038, 0, 0, 0 } },
507 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
508 { 3, { 0, 0x0EA, 0x090, 0x03B, 0 } },
509 { 3, { 0, 0x176, 0x177, 0x178, 0 } },
510 { 0, { 0, 0, 0, 0, 0 } },
511 { 4, { 0x005, 0x00C, 0x0D5, 0x096, 0 } },
512 { 2, { 0, 0x01A, 0x10B, 0, 0 } },
513 { 4, { 0, 0x006, 0x042, 0x17A, 0x179 } },
514 { 0, { 0, 0, 0, 0, 0 } },
515 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
516 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
517 { 3, { 0, 0x16F, 0x170, 0x171, 0 } },
518 { 3, { 0, 0x184, 0x187, 0x18A, 0 } },
519};
521 { 4, { 0x005, 0x00C, 0x0D5, 0x096, 0 } },
522 { 2, { 0, 0x01A, 0x10B, 0, 0 } },
523 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
524 { 0, { 0, 0, 0, 0, 0 } },
525 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
526 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
527 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
528 { 0, { 0, 0, 0, 0, 0 } },
529 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
530 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
531 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
532 { 1, { 0, 0x038, 0, 0, 0 } },
533 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
534 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
535 { 3, { 0, 0x0EA, 0x090, 0x03B, 0 } },
536 { 4, { 0, 0x006, 0x042, 0x17A, 0x179 } },
537};
539 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
540 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
541 { 3, { 0, 0x01B, 0x0C4, 0x174, 0 } },
542 { 4, { 0, 0x006, 0x042, 0x17A, 0x179 } },
543 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
544 { 4, { 0x005, 0x00C, 0x0D5, 0x096, 0 } },
545 { 2, { 0, 0x01A, 0x10B, 0, 0 } },
546 { 0, { 0, 0, 0, 0, 0 } },
547 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
548 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
549 { 3, { 0, 0x0EA, 0x090, 0x03B, 0 } },
550 { 0, { 0, 0, 0, 0, 0 } },
551 { 1, { 0x038, 0, 0, 0, 0 } },
552 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
553 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
554 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
555};
557 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
558 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
559 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
560 { 0, { 0, 0, 0, 0, 0 } },
561 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
562 { 1, { 0x038, 0, 0, 0, 0 } },
563 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
564 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
565 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
566 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
567 { 4, { 0x005, 0x00C, 0x0D5, 0x096, 0 } },
568 { 2, { 0, 0x01A, 0x10B, 0, 0 } },
569 { 4, { 0x006, 0x042, 0x17A, 0x179, 0 } },
570 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
571 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
572 { 0, { 0, 0, 0, 0, 0 } },
573};
575 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
576 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
577 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
578 { 3, { 0x16F, 0x170, 0x171, 0, 0 } },
579 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
580 { 3, { 0x01B, 0x0C4, 0x174, 0, 0 } },
581 { 4, { 0x006, 0x042, 0x17A, 0x179, 0 } },
582 { 1, { 0x038, 0, 0, 0, 0 } },
583 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
584 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
585 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
586 { 0, { 0, 0, 0, 0, 0 } },
587 { 4, { 0x005, 0x00C, 0x0D5, 0x096, 0 } },
588 { 2, { 0, 0x01A, 0x10B, 0, 0 } },
589 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
590 { 0, { 0, 0, 0, 0, 0 } },
591};
593 { 3, { 0x014, 0x0D3, 0x0D6, 0, 0 } },
594 { 1, { 0x038, 0, 0, 0, 0 } },
595 { 3, { 0x0EA, 0x090, 0x03B, 0, 0 } },
596 { 0, { 0, 0, 0, 0, 0 } },
597 { 4, { 0x104, 0x013, 0, 0x0E6, 0x097 } },
598 { 4, { 0x005, 0x00C, 0x0D5, 0x096, 0 } },
599 { 2, { 0, 0x01A, 0x10B, 0, 0 } },
600 { 0, { 0, 0, 0, 0, 0 } },
601 { 3, { 0x183, 0x186, 0x189, 0, 0 } },
602 { 3, { 0, 0x01B, 0x0C4, 0x174, 0 } },
603 { 3, { 0, 0x16F, 0x170, 0x171, 0 } },
604 { 4, { 0, 0x006, 0x042, 0x17A, 0x179 } },
605 { 3, { 0x176, 0x177, 0x178, 0, 0 } },
606 { 3, { 0x182, 0x185, 0x188, 0, 0 } },
607 { 5, { 0x103, 0x0FE, 0x094, 0x167, 0x17D } },
608 { 3, { 0x184, 0x187, 0x18A, 0, 0 } },
609};
610#endif
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
STGDGLAB.PRO: the Digimon Lab (MODE_DIGI_LAB; "デジモンラボ" in STAGSLCT's list of scenes),...
s32 STGDGLAB_updateFade(PanelAnim *fade)
#define FILE_LAB_SPRITES
The lab's sprite sheet; the next file is its texture archive.
Definition digimon_lab.h:25
s32 STGDGLAB_updateLerp(MenuLerp *lerp)
ScreenFade * STGDGLAB_createFader(void)
void STGDGLAB_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames)
void STGDGLAB_startFade(PanelAnim *fade, s32 fadeIn)
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
#define TEXT_DIGI_LAB
DGLABO: STGDGLAB's.
Definition file.h:208
#define TEXT_SKILL_NAMES
SKLNAM.
Definition file.h:223
#define TEXT_FILE(file)
Definition file.h:190
#define TEXT_DIGIMON_INFO
DIGINF.
Definition file.h:210
#define TEXT_DIGIMON_NAMES
DIGNAM.
Definition file.h:211
#define TEXT_SKILL_INFO
SKLINF.
Definition file.h:222
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#define PARTY_SIZE
How many partners the party holds.
Definition game_state.h:475
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
Definition gfx.h:45
LabEntry STGDGLAB_entries[]
The items of the recipes, up to id 0: their sprite (STGDGLAB_getItemSprite) and STGDGLAB_getItemB's v...
Definition lab.c:264
s32 STGDGLAB_openLabMenu(Lab *lab)
Lab.openMenu: opens the main menu's page again; 1 if the menu was running.
Definition lab.c:112
s32 STGDGLAB_filesLoading(void)
Whether the lab's strings are still loading.
Definition lab.c:187
void STGDGLAB_loadFiles(void)
Loads the lab's textures and requests its strings: the lab's and the Digimon's and skills' names and ...
Definition lab.c:169
PartnerAnim STGDGLAB_partnerAnims[]
The partners' animation frames, -1 ends.
Definition lab.c:238
LabRecipe STGDGLAB_recipes1[]
Definition lab.c:484
Task *(* STGDGLAB_screens[])(Lab *lab)
The main menu's screens.
Definition lab.c:234
void STGDGLAB_updateLab(Lab *lab, LabChildren *children)
The mode's main task: loads the files and packs the party, then runs the lab (STGDGLAB_runLab) and dr...
Definition lab.c:68
s32 STGDGLAB_getItemSprite(s32 id)
The sprite of a recipe's id (STGDGLAB_entries), 0 for an id not there.
Definition lab.c:209
LabRecipe STGDGLAB_recipes6[]
Definition lab.c:574
s32 STGDGLAB_closeLabMenu(Lab *lab)
Lab.closeMenu: closes the main menu's page; 1 if the menu was running.
Definition lab.c:124
LabRecipe STGDGLAB_recipes3[]
Definition lab.c:520
LabRecipe STGDGLAB_recipes4[]
Definition lab.c:538
void STGDGLAB_fadeOutLab(Lab *lab)
Lab.fadeOut: fades the screen out in 0x1E frames, as the lab is left.
Definition lab.c:147
LabWindowPos STGDGLAB_layout[]
Where the windows go: the five stats' labels, their values and the name.
Definition lab.c:249
s32 STGDGLAB_labMenuRunning(Lab *lab)
Lab.menuOpen: 1 when the main menu's task is running (its page not fading)
Definition lab.c:136
LabRecipe STGDGLAB_recipes5[]
Definition lab.c:556
void STGDGLAB_runLab(Lab *lab, LabChildren *children)
Creates the main menu and opens the screen it picks, back to the menu when the screen closes; once th...
Definition lab.c:8
LabData STGDGLAB_data
Definition lab.c:611
LabRecipe STGDGLAB_recipes7[]
Definition lab.c:592
s32 STGDGLAB_getItemB(s32 id)
The third value (b) of a recipe's id in STGDGLAB_entries, 0 for an id not there; LabFuncs....
Definition lab.c:222
LabRecipe STGDGLAB_recipes2[]
Definition lab.c:502
LabRecipe STGDGLAB_recipes0[]
The recipes of each table (STGDGLAB_data.recipes), by row and column.
Definition lab.c:466
void STGDGLAB_packParty(Lab *lab)
Counts the party and moves its members to the first places of GAME.party.
Definition lab.c:42
Lab * STGDGLAB_createLab(void)
Creates the mode's main task, the lab.
Definition lab.c:155
LabMenu * STGDGLAB_createMenu(Lab *lab)
Creates the lab's main menu (task)
Definition menu.c:580
Task * STGDGLAB_createPartyScreen(Lab *lab)
Creates the main menu's first screen (task), where a partner joins the party in the member's place.
Task * STGDGLAB_createRecipeScreen(Lab *lab)
Creates the main menu's third screen (task), the recipes, and fades the menu's page out.
Task * STGDGLAB_createSlotScreen(Lab *lab)
Creates the main menu's second screen (task), the party member's three slots.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
s32(* isLoading)(s32 file)
Definition file.h:88
void(* request)(s32 file)
Definition file.h:90
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
void(* requestMode)(s32 mode, s32 arg)
Definition game_state.h:21
s32 party[3]
partner indices
Definition game_state.h:511
s32 fieldMode
where the menu returns to
Definition game_state.h:503
GameFuncs funcs
Definition game_state.h:582
LabMenu * menu
ScreenFade * fade
Task * screen
The overlay's tables and helpers.
LabFuncs funcs
An entry of STGDGLAB_entries: a Digimon of the recipes (GET_DIGIMON)
s16 b
0x100-0x135, one per Digimon; only STGDGLAB_getItemB reads it, and nothing in src/ calls that (LabFun...
s32(* filesLoading)(void)
void(* loadFiles)(void)
The lab's main menu (STGDGLAB_createMenu)
Definition digimon_lab.h:29
s32 choice
into STGDGLAB_screens
Definition digimon_lab.h:35
void(* close)(struct LabMenu *menu)
Definition digimon_lab.h:43
void(* open)(struct LabMenu *menu)
Definition digimon_lab.h:42
s32 state
Definition digimon_lab.h:30
s32 picked
Definition digimon_lab.h:32
A recipe of STGDGLAB_data's tables.
Definition digimon_lab.h:60
Where a window of the menu or the first screen goes, and its string.
Definition digimon_lab.h:66
The mode's main task (STGDGLAB_createLab)
s32 partySize
the party's slots: PARTY_SIZE
s32 partyCount
void * children
s32 bgScroll
s32 bgTick
void(* setState)(struct Lab *task, s32 state)
void(* packParty)(struct Lab *lab)
s32(* openMenu)(struct Lab *lab)
void(* fadeOut)(struct Lab *lab)
s32(* closeMenu)(struct Lab *lab)
s32 layer
s32 state
s32 substate
void(* nextState)(struct Lab *task)
s32(* menuOpen)(struct Lab *lab)
A partner Digimon's animation in a menu: up to seven sprite ids, -1 ending it early (the sprites are ...
Definition game_state.h:340
void(* start)(struct ScreenFade *fade, s32 fadeIn, s32 frames)
TASK_DONE when done.
Definition gfx.h:368
s32 state
Definition gfx.h:362
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
Definition gfx.h:223
void(* setLayerId)()
(id, depth)
Definition gfx.h:244
void(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
Any task, seen through its header.
Definition task.h:62
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
Definition gfx.h:325
void(* setClutPos)()
(x, y)
Definition gfx.h:337
void(* setImagePos)()
(x, y)
Definition gfx.h:336
void(* setBufferSize)()
(size)
Definition gfx.h:339
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