11#define OVL_NAME(name) STCRDSHP_##name
13#define CARD_GRID CardPackGrid
22#define CARD_PACK_IDS 315
25#define CARD_PACK_CATEGORY 0x62
29#if VERSION_US || VERSION_JP
30#define FILE_CARDSHOP_SPRITES 0x62E
31#define FILE_CARDSHOP_IMAGES 0x632
32#define FILE_CARD_DATA 0x7E7
34#define FILE_CARDSHOP_SPRITES 0x63E
35#define FILE_CARDSHOP_IMAGES 0x642
36#define FILE_CARD_DATA 0x7F6
void STCRDSHP_listPacks(CardPackOpen *open)
Lists the bag's card packs, and how many pages they fill.
void STCRDSHP_updateFader(ScreenFade *task)
void STCRDSHP_showBuyCard(CardShopBuy *buy, CardShopBuyWindows *win, s32 show)
Shows (or hides) the card under the cursor's name, price, how many the player has and its text or num...
CardShopStock * STCRDSHP_getStock(s32 shop)
The stock of a shop (the first one's if it has none), counting its cards.
void STCRDSHP_runBuy(CardShopBuy *buy, CardShopBuyWindows *win)
The states of the screen to buy cards: picking a card (left/right, L1/R1 for the pages),...
s32 STCRDSHP_cursorRows[]
the CLUT rows of the cursor's frames
void STCRDSHP_setCards(CardPackGrid *grid, s32 *cards)
Turns the grid over to six new cards (grid->setCards): keeps the old ones to draw while the slots tur...
void STCRDSHP_drawShop(CardShop *shop)
Draws the scrolling background and the panels as they open.
s16 STCRDSHP_getPrice(s32 card)
The price of a card.
void STCRDSHP_createPackOpenWindows(CardPackOpen *open, CardPackOpenWindows *win)
pack_open.c
s32 STCRDSHP_filesLoading(void)
Whether the shop's strings are still loading.
CardPackOpen * STCRDSHP_createPackOpen(CardShop *shop)
Creates the screen to open a pack.
s32 STCRDSHP_glowRows[]
the CLUT rows of the drawn card's glow
s32 STCRDSHP_updateLerp(MenuLerp *lerp)
void STCRDSHP_startFader(ScreenFade *task, s32 fadeIn, s32 duration)
fader.c
CardPrice STCRDSHP_prices[]
The cards the shops sell and their prices.
void STCRDSHP_runPackOpen(CardPackOpen *open, CardPackOpenWindows *win)
The states of the screen that opens a pack: its fades, the page and cursor, and the grid of cards a p...
void STCRDSHP_showPackCard(CardPackOpen *open, CardPackOpenWindows *win, s32 show)
Shows the card under the cursor: its name, how many the player has and its numbers or its text,...
void STCRDSHP_showPackPage(CardPackOpen *open, CardPackOpenWindows *win, s32 show)
Shows the page's packs, the page number and the arrows' labels, or hides them.
CardShopStock STCRDSHP_stocks[]
Each shop's cards.
s16 STCRDSHP_shopCards[24][8]
the cards each shop sells
void STCRDSHP_showOptions(CardShop *shop, CardShopWindows *win, s32 show)
Shows or hides the options (buy cards, open a pack, edit the decks) and the help.
CardPackGrid * STCRDSHP_createGrid(CardShop *owner, s32 *cards)
Creates the grid of six cards, copying the cards given.
CardShopTitle STCRDSHP_titles[]
The shop's title for each field it is opened from, up to mode 0.
void STCRDSHP_updatePackOpen(CardPackOpen *open, CardPackOpenWindows *win)
The update of the screen to open a pack.
void STCRDSHP_drawFader(ScreenFade *task)
s32 STCRDSHP_slotCards[123][16]
STCRDSHP's data, in its order: the pack screen's, the buy screen's and the shop's.
s32 STCRDSHP_slotCards123[]
void STCRDSHP_showTitle(CardShop *shop, CardShopWindows *win, s32 show)
Shows or hides the shop's title and the money.
CardPack STCRDSHP_packs[]
void STCRDSHP_loadIcons(CardPackGrid *grid)
card_grid.c
void STCRDSHP_drawBuy(CardShopBuy *buy)
Draws the screen: the card under the cursor's frames, the cursor, the arrows and the title.
s32 STCRDSHP_updateFade(PanelAnim *fade)
CardShopFuncs STCRDSHP_funcs
The shops' helpers.
void STCRDSHP_updateHiding(CardPackGrid *grid)
CardShopBuy * STCRDSHP_createBuy(CardShop *shop, s32 shopId)
Creates the screen to buy the cards of a shop.
void STCRDSHP_updateScene(Task *task, CardShop **child)
scene.c
CardShop * STCRDSHP_createShop(void)
Creates the card shop (task) for the shop of the mode's argument, titled for the field it is opened f...
void STCRDSHP_showMoney(CardShop *shop)
Shows the money left (after buying)
void STCRDSHP_drawCards(CardPackGrid *grid, s32 previous)
Draws the cards drawn (or the ones being turned over): each card's image, its numbers or its kind's m...
void STCRDSHP_drawTurningSlots(CardPackGrid *grid)
Draws the cover over each slot turned so far, in the palette of the turn's current frame.
void STCRDSHP_drawPackOpen(CardPackOpen *open)
Draws the screen: the page's packs and the arrows, the pack under the cursor, the help's frame and th...
void STCRDSHP_updateShop(CardShop *shop, CardShopWindows *win)
The shop's update: loads its files, then runs it; leaves to the field or the deck editor.
ScreenFade * STCRDSHP_createFader(void)
void STCRDSHP_runShop(CardShop *shop, CardShopWindows *win)
Opens the panels, moves the cursor and starts what was chosen.
void STCRDSHP_startFade(PanelAnim *fade, s32 fadeIn)
void STCRDSHP_hideCards(CardPackGrid *grid)
void STCRDSHP_updateBuy(CardShopBuy *buy, CardShopBuyWindows *win)
The buy screen's update: takes the shop's stock, six cards a page.
void STCRDSHP_createBuyWindows(CardShopBuy *buy, CardShopBuyWindows *win)
buy.c
void STCRDSHP_loadFiles(void)
Loads the shop's textures and requests its strings.
s32 STCRDSHP_slotCards124[86][16]
void STCRDSHP_updateGrid(CardPackGrid *grid)
The grid's task: covers its slots one by one (every 2 frames) above the old cards,...
void STCRDSHP_createShopWindows(CardShop *shop, CardShopWindows *win)
shop.c
void STCRDSHP_showPack(CardPackOpen *open, CardPackOpenWindows *win, s32 show)
Shows the name of the pack under the cursor, how many the bag holds and the help, or hides them.
void STCRDSHP_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames)
#define TASK_HEADER(Type)
long open(char *name, unsigned long mode)
The kernel's file functions (libapi.h); the sim: device is the PC's.
Draws the six cards drawn from a pack, and turns them over.
s32 pad60
never read or written (STCRDABM's grid: the page being turned's)
s32 pad5C
never read or written (STCRDABM's grid: the page's first card)
u8 padAC[0x10]
never read or written
s32 pad78
never read or written
s32 turned
slots turned so far
s32 pad74
never read or written
void(* setCards)(struct CardPackGrid *grid, s32 *cards)
s32 prevCards[6]
the cards being turned
struct CardShop * owner
never read
void(* hide)(struct CardPackGrid *grid)
The children of the screen to open a pack.
TextWindow * count
how many the bag holds
TextWindow * cardCount
how many the player has
TextWindow * packs[8]
the page's
TextWindow * cardName
the card under the cursor's
TextWindow * prev
by the arrows
TextWindow * name
the pack's
TextWindow * cardCountLabel
The screen to open a pack (STCRDSHP_createPackOpen): the bag's packs, eight a page.
s32 cards[6]
drawn from the pack opened
s32 card
the one under the cursor, in cards[]
s32 arrowTime
compared with the time but never updated
s32 arrowFrame
the page arrows' palette
s32 cursor
the pack under the cursor, in packs[]
s32 glowShown
the glow of the card under the cursor
s16 packs[0x194]
the bag's card packs
s32 pad
never read or written
s16 items[0x194]
the bag's items
A card pack: the item and the six lists of 16 cards its slots draw from.
TextWindow * prev
by the arrows
TextWindow * name
the card under the cursor's
TextWindow * text
its effect (TEXT_CARD_EFFECTS)
TextWindow * message
the total, or why the card can't be bought
TextWindow * count
how many the player has
The screen to buy cards (STCRDSHP_createBuy): the shop's cards, six a page.
struct CardShopStock * stock
s32 column
the card under the cursor, on the page
s32 shopId
the shop's game mode argument
The shop's helpers (STCRDSHP_funcs)
s16(* getPrice)(s32 card)
s32(* updateFade)(PanelAnim *fade)
void(* startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames)
s32(* filesLoading)(void)
s32(* updateLerp)(MenuLerp *lerp)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
The shop's title for the field it is opened from.
s32 title
string of file 0x95
s32 mode
GAME.fieldMode; 0 ends the list.
The children of the shop.
Task * dialog
buying cards or opening a pack
The card shop's main task (STCRDSHP_createShop): buy cards, open packs or edit the decks.
void(* showMoney)(struct CardShop *shop)
s16 items[0x194]
the bag's, to look for packs
s32 scrollWait
it moves every other frame
s32 scroll
of the background
s32 shop
the game mode's argument
A menu cursor: a text window showing one of the CURSOR_FRAMES glyphs.
Opens or closes a menu panel: level goes 0 -> ONE in duration frames (or back at twice the speed),...
Fades the whole screen to black and back with a subtractive rectangle.
Any task, seen through its header.
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...