382 for (j = 0; j < 3; j++) {
385 for (j = 0; j < 12; j++) {
396 screen->
addSprite(screen, 15, 0xE500, 0x6100);
399 screen->
scaleSprite(screen, 15, 8, 0x1000, 0x1000);
401 for (i = 0; i < 3; i++) {
404 for (i = 0; i < 12; i++) {
575 for (i = 0; i < 3; i++) {
578 for (i = 0; i < 12; i++) {
622 for (i = 0; i < 15; i++) {
CARDGAME.PRO: the card battle (mode 0x700).
#define CARD_ANIM_UNDIM_ALL
CardAnim.dimAll.
s32 CARDGAME_rowSteps[]
the step of each row of CARDGAME_viewTable
s32 CARDGAME_rowSpriteOffsets[]
the sprite offset of each row of CARDGAME_viewTable
s16 CARDGAME_savedPanelScales[2]
the panels' scale states, kept by CARDGAME_viewTable
PadState PAD
Controller input: cleared by initPad, then the methods.
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
void CARDGAME_showCardInfo(CardBattle *battle, CardScreen *screen, s32 offset)
Fills the information windows with the card of sprite offset + effectStep.cursor (the highlighted one...
void CARDGAME_clearCardInfo(CardBattle *battle, CardScreen *screen)
Empties the card information windows 1-4.
s32 CARDGAME_openStepWindows(CardBattle *battle, CardScreen *screen, s32 layout, s32 text, s32 time, s32 step)
Opens the windows of the step CARDGAME_windowSteps[step] once its time is past; the next step.
void CARDGAME_showTableCardInfo(CardBattle *battle, CardScreen *screen, s32 kind)
CARDGAME_showCardInfo for the highlighted card of a row (kind 0, 1 or 2, as CARDGAME_moveTableHighlig...
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.
u8 dimAll
sets dimmed of the first 15 sprites once
The card battle (CARDGAME_createBattle).
u8 state
1 opening, 2 open, 4 confirmed, 5 closing
s16 card
the index in the battle's card list
s8 playCount
the plays in use
CardPlay plays[3]
the cards played this turn, up to three
The battle screen (created by CARDGAME_createScreen): the two panels, the cards on the table and the ...
CardMessageWindow message
void(* setSpriteCard)(struct CardScreen *screen, s32 sprite, s32 index)
void(* scaleSprite)(struct CardScreen *screen, s32 index, s32 duration, s32 scaleX, s32 scaleY)
void(* resetPanels)(struct CardScreen *screen)
void(* openPanels)(struct CardScreen *screen)
void(* openMessage)(struct CardScreen *screen, s32 message, s32 prompt, s16 choice, s32 place)
void(* closePanels)(struct CardScreen *screen)
void(* closeMessage)(struct CardScreen *screen)
void(* closeWindow)(struct CardScreen *screen, s32 index)
s32(* startBlink)(struct CardScreen *screen, s32 index)
s32(* addSprite)(struct CardScreen *screen, s32 index, s32 x, s32 y)
u8 highlight
bit 0 the cursor, bit 1 picked, bit 2 glowing
s32 cursor
the card or slot highlighted
s32 time
a frame count, or the step's own sub-state
s8 eligible[0x29]
the cards or slots that can be picked
u8 state
the step's own state
s32 vars[5]
values each step uses its own way
u8 nextState
the state to set up first, if not 0
u8 flags
the step's own: the rows to pick from, the deck run out...
s8 marked[40]
the cards or slots picked
s32 choice
the card, slot or answer chosen; -1 for none
s32(* getRepeated)(s32 pad)
s32(* getButtonBit)(s32 pad, s32 button)
s32(* getPressed)(s32 pad)
short(* playSound)(s32 id)
returns the voice of a key-on
static void chooseFirstPickRow(CardBattle *battle, CardScreen *screen)
Once the panels are open (or right away without them), shows the first row the pick allows that has c...
s32 CARDGAME_viewTable(CardBattle *battle, CardScreen *screen)
Lets the player look over the cards out on the table: the two players' rows and the row of the cards ...
static void pickInOwnRow(CardBattle *battle, CardScreen *screen)
The player's own row: up goes to the opponent's row when allowed, left and right move along it,...
void CARDGAME_moveTableHighlight(CardBattle *battle, CardScreen *screen, s32 kind, s32 delta)
Moves the highlight of a row of cards (kind 0, 1 or 2) by delta.
void CARDGAME_movePickHighlight(CardBattle *battle, CardScreen *screen, s32 kind, s32 delta)
CARDGAME_moveTableHighlight, for CARDGAME_pickTableCard.
static void pickInOpponentRow(CardBattle *battle, CardScreen *screen)
The opponent's row: down goes to the player's own row when allowed, left and right move along it,...
s32 CARDGAME_getTableHeight(CardBattle *battle, CardScreen *screen)
The table's height: 8 per card of the longer row of slots (at least 3), and 14.
s32 CARDGAME_pickTableCard(CardBattle *battle, CardScreen *screen)
Lets the player pick a card out on the table (effectStep.flags bit 0: in their own row,...
static void browsePlayedRow(CardBattle *battle, CardScreen *screen)
The row of the cards played: up and down go to the opponent's or the player's own row,...
static void browseOwnRow(CardBattle *battle, CardScreen *screen)
The player's own row: up goes to the played or the opponent's row, left and right move along it,...
static void setUpViewState(CardBattle *battle, CardScreen *screen)
Sets up the table view's next state (effectStep.nextState): opening the panels, a row,...
static void setUpPickState(CardBattle *battle, CardScreen *screen)
Sets up the table pick's next state (effectStep.nextState): dimming the cards that can't be picked,...
void CARDGAME_startViewTable(CardBattle *battle, CardScreen *screen)
Starts CARDGAME_viewTable.
static void leavePlayedRow(CardBattle *battle, CardScreen *screen)
11 frames after leaving the played row, goes to the opponent's (effectStep.vars[1]) or the player's o...
static void leaveOpponentRow(CardBattle *battle, CardScreen *screen)
11 frames after leaving the opponent's row, goes down to the played row (the cursor halved) or the pl...
static void chooseFirstRow(CardBattle *battle, CardScreen *screen)
Once the panels are open, shows the first row with cards in it, or the no-cards message.
static void leaveTableRow(CardBattle *battle, CardScreen *screen, s32 offset)
Leaves a row of cards (its first sprite at offset): unhighlights its card and closes the windows.
static void leaveOwnRow(CardBattle *battle, CardScreen *screen)
11 frames after leaving the player's own row, goes up to the played row (the cursor halved) or the op...
s32 CARDGAME_getPickTableHeight(CardBattle *battle, CardScreen *screen)
CARDGAME_getTableHeight, for CARDGAME_pickTableCard.
static void browseOpponentRow(CardBattle *battle, CardScreen *screen)
The opponent's row: down goes to the played or the player's own row, left and right move along it,...
static void closeTableWindows(CardScreen *screen)
Closes the card info's four windows.
static void startTableRow(CardBattle *battle, CardScreen *screen, s32 row)
Starts showing a row of cards (0, 1 or 2) and its windows.
void CARDGAME_startPickTableCard(CardBattle *battle, CardScreen *screen, s32 cancelable)
Starts CARDGAME_pickTableCard, which triangle backs out of when cancelable (effectStep....