22 if (panel->
flags[7] != 0) {
29 if (panel->
flags[6] != 0) {
36 if (panel->
flags[5] != 0) {
43 for (i = 0; i < 5; i++) {
44 if (panel->
flags[i] != 0) {
45 iconFrame = iconT / 6;
62 imageY = panel->
winsY;
85 for (i = 0; i < 5; i++) {
86 if (panel->
flags[i] != 0) {
90 if (panel->
flags[8] != 0) {
93 if (panel->
flags[9] != 0) {
96 if (panel->
flags[6] != 0) {
99 if (panel->
flags[7] != 0) {
102 if (panel->
flags[5] != 0) {
117 if (panel->
flags[8] != 0) {
124#elif VERSION_EU || VERSION_JP
127 if (panel->
flags[9] != 0) {
134#elif VERSION_EU || VERSION_JP
163 for (i = 0; i < 5; i++) {
185 s32 shownBoxX,
s32 hiddenBoxX,
s32 shownBoxY,
s32 hiddenBoxY,
186 s32 shownWinsX,
s32 hiddenWinsX,
s32 shownWinsY,
s32 hiddenWinsY) {
188 panel->
x = shownX - (shownX - hiddenX) * panel->
time / panel->
duration;
189 panel->
y = shownY - (shownY - hiddenY) * panel->
time / panel->
duration;
190 panel->
boxX = shownBoxX - (shownBoxX - hiddenBoxX) * panel->
time / panel->
duration;
191 panel->
boxY = shownBoxY - (shownBoxY - hiddenBoxY) * panel->
time / panel->
duration;
192 panel->
winsX = shownWinsX - (shownWinsX - hiddenWinsX) * panel->
time / panel->
duration;
193 panel->
winsY = shownWinsY - (shownWinsY - hiddenWinsY) * panel->
time / panel->
duration;
200 panel->
boxX = shownBoxX;
201 panel->
boxY = shownBoxY;
202 panel->
winsX = shownWinsX;
203 panel->
winsY = shownWinsY;
210 s32 shownBoxX,
s32 hiddenBoxX,
s32 shownBoxY,
s32 hiddenBoxY,
211 s32 shownWinsX,
s32 hiddenWinsX,
s32 shownWinsY,
s32 hiddenWinsY) {
213 panel->
x = hiddenX - (hiddenX - shownX) * panel->
time / panel->
duration;
214 panel->
y = hiddenY - (hiddenY - shownY) * panel->
time / panel->
duration;
215 panel->
boxX = hiddenBoxX - (hiddenBoxX - shownBoxX) * panel->
time / panel->
duration;
216 panel->
boxY = hiddenBoxY - (hiddenBoxY - shownBoxY) * panel->
time / panel->
duration;
217 panel->
winsX = hiddenWinsX - (hiddenWinsX - shownWinsX) * panel->
time / panel->
duration;
218 panel->
winsY = hiddenWinsY - (hiddenWinsY - shownWinsY) * panel->
time / panel->
duration;
226 panel->
boxX = hiddenBoxX;
227 panel->
boxY = hiddenBoxY;
228 panel->
winsX = hiddenWinsX;
229 panel->
winsY = hiddenWinsX;
278 switch (panel->
event) {
288 switch (panel->
state) {
290 slidePanelIn(panel, shownX, shownY, hiddenX, hiddenY, shownBoxX, hiddenBoxX, shownBoxY, hiddenBoxY,
291 shownWinsX, hiddenWinsX, shownWinsY, hiddenWinsY);
294 slidePanelOut(panel, shownX, shownY, hiddenX, hiddenY, shownBoxX, hiddenBoxX, shownBoxY, hiddenBoxY,
295 shownWinsX, hiddenWinsX, shownWinsY, hiddenWinsY);
298 panel->
boxX = hiddenBoxX;
299 panel->
boxY = hiddenBoxY;
300 panel->
winsX = hiddenWinsX;
301 panel->
winsY = hiddenWinsX;
303 panel->
x = shownX - (shownX - hiddenX) * panel->
time / panel->
duration;
304 panel->
y = shownY - (shownY - hiddenY) * panel->
time / panel->
duration;
314 panel->
boxX = hiddenBoxX;
315 panel->
boxY = hiddenBoxY;
316 panel->
winsX = hiddenWinsX;
317 panel->
winsY = hiddenWinsX;
319 panel->
x = hiddenX - (hiddenX - shownX) * panel->
time / panel->
duration;
320 panel->
y = hiddenY - (hiddenY - shownY) * panel->
time / panel->
duration;
371 if (scale->
state != 0) {
380 if (scale->
state == 2) {
382 screen->
panels[side].
y + textY);
391 switch (scale->
state) {
395 if (scale->
time <= 0) {
402 if (scale->
time <= 0) {
417 if (blinker->
time != 0) {
462 for (; i < 12; i++) {
CARDGAME.PRO: the card battle (mode 0x700).
CardOffset CARDGAME_panelIconPositions[2][2][2]
CARDGAME_drawPanelIcon's icon and label positions, by SHIFT_PAL_SCREEN and side (EU)
u8 CARDGAME_flag7Frames[]
the frames of the panel's sprites for flags 7, 6 and 5 and its five flag icons (CARDGAME_flagIconSpri...
u8 CARDGAME_panelBarSprites[8][2]
the sprites of the panel's two bars, by LANGUAGE (USA: 1)
CardPanelLayout CARDGAME_panelLayouts[2]
the panels' layouts, by side
u8 CARDGAME_flag6Frames[]
u8 CARDGAME_flagIconSprites[]
the sprites of the panel's five flag icons
u8 CARDGAME_panelLightCluts[8]
the clut rows of the panel's blinking lights: 0, 1, 2, 3, 2, 1
u8 CARDGAME_flagIconFrames[]
GfxState GFX
GFX: the graphics state and its methods.
s32 SHIFT_PAL_SCREEN
moves both display areas 0x18 lines down
s32 LANGUAGE
The European version's settings, in the small data (.sdata) between file/file_table....
#define TEXT_CARD_GAME
CARDGM: the card battle's.
FileCache FILE_CACHE
The file cache.
void CARDGAME_drawBlinker(CardBlinker *blinker)
Draws a blinker, its CLUT row changing every four frames.
void CARDGAME_drawPanelIcon(CardScreen *screen, CardScreenItems *items, s32 side, CardPanelScale *scale)
Draws a side's panel icon at the panel's open or close scale, and once the panel is open (state 2) it...
void CARDGAME_updateBlinkers(CardScreen *screen, CardScreenItems *items)
Moves and draws the twelve blinkers.
void CARDGAME_slidePanel(CardPanel *panel, CardScreenItems *items, s32 side)
Moves a side's panel between its shown and hidden places: in (state 1, slidePanelIn),...
void CARDGAME_drawPanel(CardPanel *panel, CardScreenItems *items, s32 side)
Draws a side's panel (CardScreen.panels): its lights, bars, numbers and parts (drawPanelParts),...
static void drawPanelParts(CardPanel *panel, s32 side, s32 y, s32 imageY)
Draws a side's panel image of its wins, its parts blinking by its flags, and its frame.
static void slidePanelIn(CardPanel *panel, s32 shownX, s32 shownY, s32 hiddenX, s32 hiddenY, s32 shownBoxX, s32 hiddenBoxX, s32 shownBoxY, s32 hiddenBoxY, s32 shownWinsX, s32 hiddenWinsX, s32 shownWinsY, s32 hiddenWinsY)
Slides a side's whole panel in from its hidden places to its shown ones, where it stays (state 2)
void CARDGAME_moveBlinker(CardBlinker *blinker)
Moves a blinker towards its target; it stops there (state 1)
static void slidePanelOut(CardPanel *panel, s32 shownX, s32 shownY, s32 hiddenX, s32 hiddenY, s32 shownBoxX, s32 hiddenBoxX, s32 shownBoxY, s32 hiddenBoxY, s32 shownWinsX, s32 hiddenWinsX, s32 shownWinsY, s32 hiddenWinsY)
Slides a side's whole panel out from its shown places to its hidden ones, where it's gone (state 0)
void CARDGAME_updatePanels(CardScreen *screen, CardScreenItems *items)
Runs and draws both panels and their icons.
void CARDGAME_updatePanelIcon(CardScreen *screen, CardScreenItems *items, s32 side, CardPanelScale *scale)
Grows (state 1) or shrinks (3) side's panel icon, and draws it.
#define FILE_CARDGAME_TIMS
CARDGAME's own pictures, a TIM archive.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
A blinking marker on the battle screen (CardScreen.blinkers), which can move to a target.
A number drawn with the TIM archive's digits (CARDGAME_drawNumber)
CardOffset boxLight
from the box
CardOffset flagIcons
five, 0x2A apart
CardOffset discardCount
from the box
CardOffset flagNumbers
CardPanel.points, 0x2A apart.
u8 winsSprite
plus CardPanel.wins: the sprite at winsX, winsY
CardOffset flagLights
five, 0x2A apart
u8 frame
the panel's sprite
CardOffset boxLabel
from the box
A panel's open (state 1) or close (state 3) scale, which goes over duration frames.
One side's panel on the battle screen (CardScreen.panels): 0 is the player's, 1 the opponent's.
s16 event
for a frame, until CARDGAME_slidePanel clears it: 2 the panel started sliding in, 1 it slid out; noth...
s32 wins
the rounds won shown
s16 apTotal
the values shown (CARDGAME_setPanelValue)
s32 blinkTime
a frame counter for the blinking (CARDGAME_drawPanel)
u8 points[5]
one per card colour
s16 winsX
where the rounds won are shown
s16 boxX
the discards' box, which slides on its own
The battle screen's task items.
TextWindow * panelTexts[2]
the label under each side's panel (CARDGAME_drawPanelIcon)
The battle screen (created by CARDGAME_createScreen): the two panels, the cards on the table and the ...
void *(* getEntry)(u32 fileAndIndex)
s32(* getFrameTime)(void)
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(* setPos)(struct TextWindow *obj, s16 x, s16 y)
void(* setVisible)(struct TextWindow *obj, u8 arg)
void CARDGAME_drawNumber(CardNumber *number, s32 scaled)
Draws a number with the TIM archive's digits, seven pixels apart, without leading zeros unless asked;...