34 for (i = 0; i < 40; i++) {
35 if (i < battle->effectStep.vars[3]) {
90 screen->
addSprite(screen, 15, 0x1800, 0x9000);
189 screen->
startSlide(screen, 0, 5, 0x1800, 0x5C00);
286 for (i = 0; i < count; i++) {
309 current = drawer.
card;
312 if (current->
rank >= header->
rank) {
316 }
else if (current->
rank < header->
rank) {
382 screen->
addSprite(screen, 15, 0xE500, 0x6100);
385 screen->
scaleSprite(screen, 15, 8, 0x1000, 0x1000);
389 for (i = 0; i < 15; i++) {
474 screen->
addSprite(screen, 15, 0xE500, 0x6100);
477 screen->
scaleSprite(screen, 15, 8, 0x1000, 0x1000);
479 for (i = 0; i < 15; i++) {
483 for (j = 0; j < 15; j++) {
490 }
else if (mode == 1) {
562 screen->
addSprite(screen, 15, 0xE500, 0x6100);
565 screen->
scaleSprite(screen, 15, 8, 0x1000, 0x1000);
568 for (i = 0, ok = 0; i < 12; i++, ok = 0) {
637 for (j = 0; j < 3; j++) {
653 for (i = 0; i < 12; i++) {
665 for (i = 0; i < 12; i++) {
685 for (i = 0; i < 12; i++) {
CARDGAME.PRO: the card battle (mode 0x700).
s32 CARDGAME_chooseCard(CardBattle *battle, CardScreen *screen, s32 mode)
Lets a player pick a card of a row (set up by CARDGAME_setupCardChoice): 2 once one is picked,...
static void takePickedCard(CardBattle *battle)
Takes the picked card (effectStep.choice): one of the player's deck is swapped to its top and the res...
void CARDGAME_browseHand(CardBattle *battle, CardScreen *screen)
Moves the highlight along the hand with left and right; cross picks a playable card.
void CARDGAME_startPreviousCardChoice(CardBattle *battle, CardScreen *screen, s32 mode)
Shows the last card played as sprite 15; with mode 0, or mode 1 and a colour 6 card before it,...
s32 CARDGAME_stepTargetSlots(CardBattle *battle, CardScreen *screen)
The steps of CARDGAME_showTargetSlots: highlights the marked slots (effectStep.marked); confirming ne...
void CARDGAME_setupSideChoice(CardBattle *battle, CardScreen *screen, s32 side)
CARDGAME_setupCardChoice of side, kind 0.
void CARDGAME_pickBestPileCard(CardBattle *battle, CardScreen *screen, s32 lowest)
Sets effectStep.choice to the effectStep.eligible-marked card of the pile effectStep....
s32 CARDGAME_pickComputerCards(CardBattle *battle, CardScreen *screen)
The computer marks (effectStep.marked) the cards of its hand it plays: up to six that can be played,...
void CARDGAME_setupCardChoice(CardBattle *battle, CardScreen *screen, s32 side, s32 kind)
Sets up CARDGAME_chooseCard's choice of one of a side's cards: kind 0 among its hand,...
void CARDGAME_moveHandHighlight(CardBattle *battle, CardScreen *screen, s32 delta)
Moves the highlight along the hand by delta, raising the highlighted card.
static void showPlayedCard(CardBattle *battle, CardScreen *screen)
Shows the card being played (sprite 15) scaling in on the slot row.
s32 CARDGAME_stepPreviousCardChoice(CardBattle *battle, CardScreen *screen)
The steps of CARDGAME_startPreviousCardChoice: confirming takes the card before the last one played,...
void CARDGAME_showTargetSlots(CardBattle *battle, CardScreen *screen, s32 owner, s32 target)
Shows the card being played as sprite 15 and lets the slots out that its target picks (a side of owne...
void CARDGAME_startPileChoice(CardBattle *battle, CardScreen *screen, s32 flags)
Shows the card being played as sprite 15 and the panels with flags, and starts CARDGAME_stepPileChoic...
s32 CARDGAME_stepPileChoice(CardBattle *battle, CardScreen *screen)
The steps of CARDGAME_startPileChoice: confirming is allowed when the pile the panel flags (effectSte...
void CARDGAME_pickComputerDeckCard(CardBattle *battle, CardScreen *screen)
The computer's pick from its deck: the first card flagged (effectStep.eligible) from its top up to dr...
void CARDGAME_pickLowestPlayerCard(CardBattle *battle, CardScreen *screen)
Picks the player's card with the lowest CardImage.rank, the strongest.
void initCardDrawer(CardDrawer *obj)
Clears a card drawer, gives it its methods and binds it.
#define CARD_ANIM_DIM_ALL
s32 CARDGAME_selectionText
the message of CARDGAME_chooseCard's selection
s32 CARDGAME_slotRowPositions[2][4]
sprite positions, by SHIFT_PAL_SCREEN
s32 SHIFT_PAL_SCREEN
moves both display areas 0x18 lines down
s32 CARDGAME_stepPulseCard(CardBattle *battle, CardScreen *screen)
Scales the highlighted sprite up to 1.25 and back, 5 frames each; 1 once done.
void CARDGAME_addCardPoints(CardBattle *battle, CardScreen *screen, CardPile *pile, s32 add, s32 card)
Adds a card's points to pile's points of its colour (takes them when add is 0), on the panel.
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.
s32 CARDGAME_canPlayCard(CardBattle *battle, u8 *points, s32 card)
Whether a card can be played: in CARD_PHASE_PUT_OUT a kind 0x10 card needs as many points of its colo...
void CARDGAME_sortOpponentCards(CardBattle *battle)
Sorts the opponent's cards by opponentDraws[].order, then swaps card effectStep.choice to reserveStar...
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.
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.
s32 count
the pile's cards
u8 dimAll
sets dimmed of the first 15 sprites once
u8 hide
the one that hides what the last one showed
The card battle (CARDGAME_createBattle).
u8 drawEnd
the first card of the opponent's deck above the round's group
s16 cards[250]
card ids, minus one (CARDGAME_loadCardImages)
CardPlan opponentPlans[40]
one per card of side 1 (40-79)
void(* shufflePile)(struct CardBattle *battle, s32 base, s32 n)
void(* sortCards)(struct CardBattle *battle, s16 *list, s32 range, s32 flags)
CardDraw opponentDraws[40]
by the opponent's deck card
u8 order
its place in the deck
Draws the cards' images (CardImage), from files 0x7E7-0x7EB.
A card's image (CardDrawer.card): 64 to a file, a 12-byte header and a 32x32 8-bit TIM.
s16 rank
by strength, from 1 the strongest (0 on the two blank cards)
s16 deckCount
the cards left in the deck
s16 deck[40]
deckTop on are left
s16 deckTop
the index of the deck's top card
u8 points[5]
one per card colour
s16 discards[10]
the cards played and lost from the slots, discardCount in use
s16 hand[10]
handCount in use
u8 kind
1-7 (CardDeckCard.kind)
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 ...
void(* setSpriteCard)(struct CardScreen *screen, s32 sprite, s32 index)
void(* closePanel)(struct CardScreen *screen, s32 side)
void(* scaleSprite)(struct CardScreen *screen, s32 index, s32 duration, s32 scaleX, s32 scaleY)
s32(* getCardColor)(struct CardScreen *screen, s32 index)
void(* setPanelFlags)(struct CardScreen *screen, s32 bits)
void(* clearPanelFlags)(struct CardScreen *screen)
void(* resetPanels)(struct CardScreen *screen)
void(* openPanels)(struct CardScreen *screen)
s32(* getHandOffset)(s32 count, s32 index)
s32(* removeSprite)(struct CardScreen *screen, s32 index)
void(* closePanels)(struct CardScreen *screen)
void(* closeWindow)(struct CardScreen *screen, s32 index)
s32(* addSprite)(struct CardScreen *screen, s32 index, s32 x, s32 y)
void(* startSlide)(struct CardScreen *screen, s32 index, s32 duration, s32 x, s32 y)
void(* openPanel)(struct CardScreen *screen, s32 side)
s16 card
the index in the battle's card list
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 count
the cards picked, or to draw
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
u8 next
the step to start: CARDGAME_runEffectStep sets it up first
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