20 table = screen->
table;
22 found = screen->
found[row][slot];
24 for (i = 0; i < 5; i++) {
29 if (screen->
owned[j] ==
id) {
30 found[i] = screen->
owned[j];
56 for (i = 0; i < 5; i++) {
65 if (screen->
owned[j] ==
id) {
96 if (++screen->
col >= 5) {
122 complete = screen->
complete[3] != 0;
131 if (screen->
slot < 2) {
179 if (screen->
found[screen->
row][0][0] != -1) {
185 for (i = 0; i < 4; i++) {
186 for (j = 4, shown = 0; j >= 0; j--) {
187 id = screen->
found[screen->
row][i][j];
207 for (k = screen->
slots - 2; k >= 0; k--) {
221 if (screen->
found[screen->
row][0][0] != -1) {
222 for (m = 0; m < 4; m++) {
223 for (n = 4; n >= 0; n--) {
224 id = screen->
found[screen->
row][m][n];
239#if VERSION_EU || VERSION_JP
247 screen->
slot += step;
248 if (screen->
slot < 0) {
250 }
else if (screen->
slots - 1 < screen->
slot) {
254 while (screen->
found[screen->
row][screen->
slot][col] == 0) {
259 }
while (screen->
found[screen->
row][screen->
slot][col] == 0);
260 if (old != screen->
slot) {
268#define FOUND(screen) ((screen)->found[(screen)->row][(screen)->slot][(screen)->col])
280 for (i = 0; i < 4; i++) {
282 for (j = 0, n = 0, count = 0; j < 4; j++) {
293 screen->
found[i][0][0] = -1;
325 oldCol = screen->
col;
326 oldSlot = screen->
slot;
330 if (--screen->
slot < 0) {
334 }
while (
FOUND(screen) == 0);
335 if (
FOUND(screen) == 0) {
336 screen->
slot = oldSlot;
337 if (screen->
slots != 0) {
338 if (screen->
col == 0) {
344 if (--screen->
slot < 0) {
348 }
while (
FOUND(screen) == 0);
349 if (
FOUND(screen) == 0) {
350 screen->
slot = oldSlot;
351 screen->
col = oldCol;
357 if (++screen->
slot > screen->
slots - 1) {
361 }
while (
FOUND(screen) == 0);
362 if (
FOUND(screen) == 0) {
363 screen->
slot = oldSlot;
364 if (screen->
slots != 0) {
365 if (screen->
col == 0) {
371 if (++screen->
slot > screen->
slots - 1) {
375 }
while (
FOUND(screen) == 0);
376 if (
FOUND(screen) == 0) {
377 screen->
slot = oldSlot;
378 screen->
col = oldCol;
383#elif VERSION_EU || VERSION_JP
384 if (screen->
slots >= 2) {
391 if (oldSlot == screen->
slot)
396 if (--screen->
col < 0) {
400 }
while (
FOUND(screen) == 0);
401 if (
FOUND(screen) == 0) {
402 screen->
col = oldCol;
406 if (++screen->
col >= 5) {
410 }
while (
FOUND(screen) == 0);
411 if (
FOUND(screen) == 0) {
412 screen->
col = oldCol;
416 if (oldCol != screen->
col || oldSlot != screen->
slot) {
419#if VERSION_EU || VERSION_JP
439 if (screen->
slot < 2) {
456 switch (screen->
step) {
536 }
else if (screen->
found[screen->
row][0][0] != -1) {
544 switch (screen->
state) {
650 return (
Task *)screen;
STGDGLAB.PRO: the Digimon Lab (MODE_DIGI_LAB; "デジモンラボ" in STAGSLCT's list of scenes),...
#define FILE_LAB_SPRITES
The lab's sprite sheet; the next file is its texture archive.
GfxState GFX
GFX: the graphics state and its methods.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
#define TEXT_DIGI_LAB
DGLABO: STGDGLAB's.
#define TEXT_DIGIMON_INFO
DIGINF.
#define TEXT_DIGIMON_NAMES
DIGNAM.
FileCache FILE_CACHE
The file cache.
DigimonData *(* GET_DIGIMON)(s32 id)
getDigimon for the overlays, in the small data (.sdata) between game/items.c's and file/file_table....
#define STRETCH_SPRITE(sprite, level, x, y)
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
#define STRETCH_SPRITE_V(sprite, level, x, y)
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
#define PAD_REPEATED(button)
static void checkRecipes(LabRecipeScreen *screen)
Finds the owned ids of each recipe of the table's four rows: a row is complete when none of its recip...
void STGDGLAB_resetRecipeCursor(LabRecipeScreen *screen)
Puts the third screen's cursor on the row's first recipe, at its first id found (the last one when no...
static void changeRecipeRow(LabRecipeScreen *screen)
Fades the row out and, unless the screen is closing (counter), the next row in.
static void runRecipeRow(LabRecipeScreen *screen, LabRecipeScreenWindows *win)
L1 and R1 go to the previous or next row (the arrows show where there is one), triangle closes the sc...
Task * STGDGLAB_createRecipeScreen(Lab *lab)
Creates the main menu's third screen (task), the recipes, and fades the menu's page out.
void STGDGLAB_updateRecipeScreen(LabRecipeScreen *screen, LabRecipeScreenWindows *win)
The third screen: a row of recipes at a time, the picked id's name and description on cross.
static void showRecipeTitle(LabRecipeScreen *screen, LabRecipeScreenWindows *win)
Once the title's panel has faded in, the title with the partner's name, the row's number and the arro...
s32 STGDGLAB_tableItems[]
The item each table's screen shows (STGDGLAB_entries)
s32 STGDGLAB_countRowIds(LabRecipeScreen *screen, u32 row)
How many of the row's four recipes the third screen shows: those whose first id the partner has (STGD...
s32 STGDGLAB_moveRecipeCursor(LabRecipeScreen *screen, s32 step)
Moves the third screen's cursor by step slots, to the first column with an id; whether it moved.
static void showRecipeName(LabRecipeScreen *screen, LabRecipeScreenWindows *win)
Once its panel has faded in, the picked id's name and description, by the panel of its place.
s32 STGDGLAB_hasRecipeId(LabRecipeScreen *screen, s32 row, u32 col)
Whether the partner has the first id of the recipe (row, col); 0 for a column past the recipes.
s32 STGDGLAB_findRecipe(LabRecipeScreen *screen, s32 row, u32 col, s32 slot)
Puts in found[row][slot] the owned ids of the recipe (row, col) and clears complete[row] when they're...
void STGDGLAB_drawRecipeScreen(LabRecipeScreen *screen, LabRecipeScreenWindows *win)
Draws the third screen: the picked id, the frames, the recipes of the row (the ids found,...
static void pickRecipeId(LabRecipeScreen *screen)
Moves the cursor over the row's owned ids, skipping the empty places; cross opens the picked id's nam...
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_MENU_CONFIRM
SYSTEM07.
#define SOUND_MENU_CANCEL
SYSTEM01.
#define SOUND_MENU_MOVE
SYSTEM06.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
u8 nameId
string in file 0x4F
void *(* getEntry)(u32 fileAndIndex)
struct PartnerStats *(* getPartnerStats)(s32 partner)
s32(* getPartyMember)(u32 index)
s32(* listPartnerEntries)()
(partner, s16 *out): the count
LabRecipe * recipes[8]
[row * 4 + col]
s32(* updateFade)(PanelAnim *fade)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
TextWindow * prev
by the arrows
TextWindow * name
the picked id's
TextWindow * title
with the partner's name
The main menu's third screen (STGDGLAB_createRecipeScreen)
s32 complete[4]
0: a recipe of the row lacks ids
s32 table
into STGDGLAB_data.recipes
s32 slots
how many of found[row] are in use
void(* setState)(struct LabRecipeScreen *task, s32 state)
s32 nextRow
L1 and R1 move to it.
void(* nextState)(struct LabRecipeScreen *task)
s32 found[4][4][5]
the owned ids of each recipe
s16 needed
how many of the ids the partner must have
The mode's main task (STGDGLAB_createLab)
s32(* closeMenu)(struct Lab *lab)
s32 member
the party member the screens show
s32(* menuOpen)(struct Lab *lab)
A partner Digimon from its name on (Partner.info), as getPartnerStats gives it.
short(* playSound)(s32 id)
returns the voice of a key-on
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setAltClut)()
(x, y)
void(* setScale)()
(x, y, z), ONE = 1.0
void(* setLayerId)()
(id, depth)
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
Any task, seen through its header.
void(* setRightAlign)()
no prototype: callers would truncate u8 args
void(* setPos)(struct TextWindow *obj, s16 x, s16 y)
void(* setVisible)(struct TextWindow *obj, u8 arg)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)