15 for (i = 0; i < 3; i++) {
20 for (j = 0; j < 6; j++) {
24 for (i = 0; i < 2; i++) {
29 windows = &children->
title;
30 for (i = 0; i < task->
childCount - 3; i++, windows++) {
41 for (i = 0; i < 6; i++) {
47 for (i = 0; i < 6; i++) {
78 for (i = 0; i < 3; i++) {
82 sprite.
setPivot(0x17, 0x63 + i * 0x2D);
122 for (d = 0; d < 3; d++) {
123 for (i = 0; i < 6; i++) {
124 task->
kinds[d][i] = 0;
126 for (i = 0; i < 40; i++) {
138 prevDeck = task->
deck;
140 if (--task->
deck < 0) {
144 if (++task->
deck >= 3) {
148 if (prevDeck != task->
deck) {
356 fader->
start(fader, 0, 10);
371 switch (task->
state) {
void initCardDrawer(CardDrawer *obj)
Clears a card drawer, gives it its methods and binds it.
NameEntry * STCRDDEK_createNameEntry(char *text)
Creates the name entry (task) to rename a deck, starting from its name: up to 10 characters.
void STCRDDEK_updateScreen(DeckScreen *task, DeckScreenChildren *children)
The screen's task: loads its files and creates its windows, then runs it; waits for the editor or the...
static void STCRDDEK_startClosingRows(DeckScreen *task, DeckScreenChildren *children)
Closes the decks' rows, from the last, to open the editor or the name entry (step set): the cursor st...
s32 STCRDDEK_filesLoading(void)
Whether the texts or the keyboard are still loading (the card images aren't waited for)
static void STCRDDEK_chooseDeckOption(DeckScreen *task, DeckScreenChildren *children)
Up/down choose to edit the deck or to rename it; cross closes the decks' rows to open it,...
static void STCRDDEK_closeFirstRow(DeckScreen *task, DeckScreenChildren *children)
Once the second deck's row has closed: hides the options (the title, step unset) and closes the first...
static void STCRDDEK_chooseDeck(DeckScreen *task, DeckScreenChildren *children)
Up/down choose one of the three decks; cross offers what to do with it, triangle leaves the screen.
void STCRDDEK_createScreenWindows(DeckScreen *task, DeckScreenChildren *children)
The title, each deck's name and six counts, the two options and the cursor, then every window from th...
void STCRDDEK_countCardKinds(DeckScreen *task)
Counts how many cards of each kind (their color) each of the three decks has.
void STCRDDEK_stepScreen(DeckScreen *task, DeckScreenChildren *children)
The screen's states: opens the title and the decks' rows; cross on a deck offers to edit or rename it...
DeckScreen * STCRDDEK_createScreen(void)
Creates the deck screen (task)
static void STCRDDEK_openChosen(DeckScreen *task, DeckScreenChildren *children)
Once the rows have closed: opens the editor or the name entry for the chosen deck and waits for it; a...
static void STCRDDEK_openDeckOptions(DeckScreen *task, DeckScreenChildren *children)
Once the options' panel has opened: shows edit folder and change name, the cursor on edit.
void STCRDDEK_drawScreen(DeckScreen *task)
Draws the screen: the background scrolling diagonally, the title panel, the decks' rows,...
void STCRDDEK_showDeckRow(DeckScreen *task, DeckScreenChildren *children, s32 deck, s32 show)
Shows a deck's row: its name and how many cards of each kind it has, or hides it.
void STCRDDEK_loadFiles(void)
Loads the screen's textures and requests the card images, the card texts and the keyboard.
STCRDDEK: the deck editor, where the player builds the three decks from the cards they own and rename...
#define STCRDDEK_IMAGES
TIM archive.
#define STCRDDEK_FILE_KEYBOARD
ScreenFade * STCRDDEK_createFader(void)
#define STCRDDEK_SPRITES
sprite bank
#define STCRDDEK_FILE_CARDS
GfxState GFX
GFX: the graphics state and its methods.
DeckEditor * STCRDDEK_createEditor(DeckScreen *screen, s32 deck)
Creates the editor (task) of one of GAME.decks.
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...
Cursor * createCursor(s16 layerId, s32 depth, s16 x, s16 y)
A menu cursor on a layer at (x, y)
#define TEXT_CARD_SHOP
CRDSHP: STCRDSHP's, and STCRDDEK's.
#define TEXT_NAME_ENTRY
NAMEDT: the keyboard's.
#define TEXT_CARD_NAMES
CARDNM.
#define TEXT_CARD_EFFECTS
CARDST.
FileCache FILE_CACHE
The file cache.
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
#define PAD_REPEATED(button)
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_SELECT
Sounds the overlays share, with SOUNDTST's names.
#define SOUND_MENU_CANCEL
SYSTEM01.
#define SOUND_MENU_MOVE
SYSTEM06.
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
Draws the cards' images (CardImage), from files 0x7E7-0x7EB.
void(* setPos)()
(cursor, x, y)
void(* setVisible)()
(cursor, visible)
s32(* filesLoading)(void)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
s32(* updateFade)(PanelAnim *fade)
union DeckScreenChildren::@8 child
NULL once it is gone.
The screen's controller: the three decks to choose from.
void(* nextState)(struct DeckScreen *task)
s32 kinds[3][6]
how many cards of each kind a deck has
void(* setState)(struct DeckScreen *task, s32 state)
void(* countKinds)(struct DeckScreen *task)
STCRDDEK_countCardKinds.
s32 scroll
of the background
void(* setSubstate)(struct DeckScreen *task, s32 substate)
s32(* isLoading)(s32 file)
void(* request)(s32 file)
void *(* getEntry)(u32 fileAndIndex)
void(* requestMode)(s32 mode, s32 arg)
void(* close)(NameEntry *task)
void(* getName)(NameEntry *task, char *out)
Fades the whole screen to black and back with a subtractive rectangle.
void(* start)(struct ScreenFade *fade, s32 fadeIn, s32 frames)
TASK_DONE when done.
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(* setScale)()
(x, y, z), ONE = 1.0
void(* setLayerId)()
(id, depth)
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
void(* setRightAlign)()
no prototype: callers would truncate u8 args
void(* setVisible)(struct TextWindow *obj, u8 arg)
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
void(* setImagePos)()
(x, y)
void(* loadArchive)()
(archive): each image 64 halfwords to the right
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
#define PALETTE_WHITE
The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs,...
#define PALETTE_GREY
what is unavailable
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.