16 for (i = 0; i < 6; i++) {
29 for (i = 0; i < 8; i++) {
62 for (i = 0; i < 6; i++) {
85 if (
id == 0x45 ||
id == 0x70 ||
id == 0x9B ||
id == 0xC6 ||
id == 0xF1) {
113 for (i = 0; i < 6; i++) {
135 for (i = 0; i < 8; i++) {
149 for (i = 0; i < 8; i++) {
179 if (
id == 0x45 ||
id == 0x70 ||
id == 0x9B ||
id == 0xC6 ||
id == 0xF1) {
214 for (i = 0; i < 315; i++) {
219 for (n = 0; n < 40; n++, cards++) {
220 task->
owned[*cards]--;
223 for (i = 0, n = 0; i < 315; i++) {
224 if (task->
owned[i] > 0) {
272 if (
id == 0x45 ||
id == 0x70 ||
id == 0x9B ||
id == 0xC6 ||
id == 0xF1) {
347 if (
id == 0x45 ||
id == 0x70 ||
id == 0x9B ||
id == 0xC6 ||
id == 0xF1) {
380 if (task->
row == 4) {
381 if (++task->
column >= 4) {
385 if (++task->
column >= 9) {
391 if (--task->
row < 0) {
397 if (task->
row >= 4) {
401 if (task->
row >= 5) {
407 if (prev != task->
column + task->
row * 9) {
489#if VERSION_EU || VERSION_JP
496#if VERSION_EU || VERSION_JP
508 for (k = 0; k < 7; k++) {
539#if VERSION_EU || VERSION_JP
605 for (i = 0; i < 39; i++) {
606 for (j = i + 1; j < 40; j++) {
669 if (task->
step == 0) {
763 switch (task->
state) {
816 switch (task->
state) {
void initCardDrawer(CardDrawer *obj)
Clears a card drawer, gives it its methods and binds it.
DeckCards * STCRDDEK_createDeckCards(DeckEditor *editor)
Creates the deck's cards (task) on the editor's grid.
STCRDDEK: the deck editor, where the player builds the three decks from the cards they own and rename...
ScrollBar * STCRDDEK_createScrollBar(void)
#define STCRDDEK_SPRITES
sprite bank
GfxState GFX
GFX: the graphics state and its methods.
void STCRDDEK_showEditorWindows(DeckEditor *task, DeckEditorChildren *children, s32 show)
Shows the title, the deck's name and counts of each kind, the hint (taking turns with another one) an...
void STCRDDEK_stepIdle(DeckIdle *task, void *children)
Ends the idle task on triangle.
static void STCRDDEK_showCardListCursor(DeckEditor *task, DeckEditorChildren *children)
Once the list card's panel has opened: adds a scroll bar to a list longer than a page and shows the c...
void STCRDDEK_drawIdle(DeckIdle *task)
Only sets up a sprite drawer.
void STCRDDEK_drawEditor(DeckEditor *task)
Draws the editor: the cursor on the deck's grid, the info panel, the deck's panel,...
void STCRDDEK_showListCard(DeckEditor *task, DeckEditorChildren *children, s32 show)
Shows the list's card under the cursor: its name and its numbers or its text, or hides them.
void STCRDDEK_updateIdle(DeckIdle *task, void *children)
A task that waits for triangle, then ends; nothing creates it.
void STCRDDEK_showCardList(DeckEditor *task, DeckEditorChildren *children, s32 show)
Shows the eight lines of the list of the cards owned from listTop (each card's name and how many are ...
static void STCRDDEK_chooseListCard(DeckEditor *task, DeckEditorChildren *children)
The cursor on the list of the cards owned: L1/R1 turn a page, up/down move it (scrolling the list); c...
static void STCRDDEK_openCardList(DeckEditor *task, DeckEditorChildren *children)
Leaves the deck's grid for the list of the cards owned: fills the list and keeps its cursor on a card...
void STCRDDEK_buildCardList(DeckEditor *task)
Lists the cards owned but not in the deck: owned holds each card's copies left over,...
void STCRDDEK_initIdle(DeckIdle *task, void *children)
Left empty.
static void STCRDDEK_startSort(DeckEditor *task, DeckEditorChildren *children)
Before sorting the deck: closes the grid's panels and hides its windows.
void STCRDDEK_updateEditor(DeckEditor *task, DeckEditorChildren *children)
The editor's task: creates its windows, then runs and draws it.
DeckEditor * STCRDDEK_createEditor(DeckScreen *screen, s32 deck)
Creates the editor (task) of one of GAME.decks.
static void STCRDDEK_closeCardList(DeckEditor *task, DeckEditorChildren *children)
Hides the list, its card and its cursor and closes their panels, and ends the scroll bar.
static void STCRDDEK_closeEditor(DeckEditor *task, DeckEditorChildren *children)
Leaving: ends the deck's cards and closes the grid's panels and windows.
static void STCRDDEK_moveDeckCursor(DeckEditor *task, DeckEditorChildren *children)
The cursor on the deck's grid (9 columns, the last row 4): the pad moves it, R1 opens or closes the c...
static void STCRDDEK_openEditor(DeckEditor *task, DeckEditorChildren *children)
Once the grid's panel has opened: shows the deck's windows, fills the list of the cards owned and sta...
static void STCRDDEK_toggleCardInfo(DeckEditor *task, DeckEditorChildren *children)
Opens or closes the info panel of the card under the cursor.
DeckIdle * STCRDDEK_createIdle(void *parent)
Creates the idle task; nothing calls it.
void STCRDDEK_createEditorWindows(DeckEditor *task, DeckEditorChildren *children)
Creates the editor's windows: the title, the deck's name and counts of each kind, the hint,...
void STCRDDEK_stepEditor(DeckEditor *task, DeckEditorChildren *children)
The editor's states: picks a card of the deck (R1 its info panel, circle sorts the deck,...
static void STCRDDEK_sortDeck(DeckEditor *task, DeckEditorChildren *children)
Sorts the deck's 40 cards by id, then shows the grid again.
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_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...
s32 STCRDDEK_cursorCluts[]
The CLUT rows of the cursor's frames.
Draws the cards' images (CardImage), from files 0x7E7-0x7EB.
u8 points
what it adds to its colour
void(* setPos)()
(cursor, x, y)
void(* setVisible)()
(cursor, visible)
TextWindow * listCardName
TextWindow * listPointsLabel
void(* nextState)(struct DeckEditor *task)
void(* setSubstate)(struct DeckEditor *task, s32 substate)
s32 column
of the deck's grid, 9 cards a row
s8 owned[315]
how many of each card are not in the deck
s32 infoShown
the card's info panel
s16 list[315]
the cards owned and not in the deck
s32 listCursor
in the list of the cards owned
struct DeckScreen * screen
void(* startFade)(PanelAnim *fade, s32 fadeIn)
s32(* updateFade)(PanelAnim *fade)
A task that waits for triangle; nothing creates it.
void(* nextState)(struct DeckIdle *task)
The screen's controller: the three decks to choose from.
s32 kinds[3][6]
how many cards of each kind a deck has
void(* countKinds)(struct DeckScreen *task)
STCRDDEK_countCardKinds.
void *(* getEntry)(u32 fileAndIndex)
s8 cards[0x13D]
counts, up to CARD_COPIES_MAX
s32(* getFrameTime)(void)
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)
void(* setRightAlign)()
no prototype: callers would truncate u8 args
void(* setLines)()
no prototype: callers would truncate u8 args
void(* setVisible)(struct TextWindow *obj, u8 arg)
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)