Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
album.h
Go to the documentation of this file.
1#ifndef STCRDABM_H
2#define STCRDABM_H
3
4/* STCRDABM.PRO: the card album (scene 0x1200). 27 pages of 12 cards, the
5 cards the player has are shown with their icon and numbers, the others
6 as empty slots. */
7
8#include "engine/game.h"
9
10/* The name of this overlay's copy of a function of src/shared/ */
11#define OVL_NAME(name) STCRDABM_##name
12/* The card grid that src/shared's hide_cards and update_hiding take */
13#define CARD_GRID CardAlbumGrid
14
15#define CARD_COUNT 315
16#define ALBUM_PAGE_CARDS 12
17
18/* The album's files: the discs number them differently */
19#if VERSION_US || VERSION_JP
20#define STCRDABM_FILE_SPRITES 0x5F5
21#define STCRDABM_FILE_IMAGES 0x5F6
22#define STCRDABM_FILE_DATA 0x7E7 /* the first of five */
23#elif VERSION_EU
24#define STCRDABM_FILE_SPRITES 0x605
25#define STCRDABM_FILE_IMAGES 0x606
26#define STCRDABM_FILE_DATA 0x7F6
27#endif
28#define STCRDABM_SPRITES (STCRDABM_FILE_SPRITES << 16) /* sprite bank */
29#define STCRDABM_IMAGES (STCRDABM_FILE_IMAGES << 16) /* TIM archive */
30
31/* Draws the cards of a page and animates the page turns */
32typedef struct CardAlbumGrid {
34 /* 0x50 */ struct CardAlbum *album;
35 /* 0x54 */ s32 layer;
36 /* 0x58 */ s32 depth;
37 /* 0x5C */ s32 first; /* first card of the page */
38 /* 0x60 */ s32 prevFirst; /* the page being turned */
39 /* 0x64 */ s32 shown; /* cards drawn */
40 /* 0x68 */ s32 turned; /* slots turned so far */
41 /* 0x6C */ s32 time;
42 /* 0x70 */ s32 frame;
43 /* 0x74 */ u8 pad[0x10]; /* never read or written */
44 /* 0x84 */ void (*setPage)(struct CardAlbumGrid *grid, s32 first);
45 /* 0x88 */ void (*hide)(struct CardAlbumGrid *grid);
47
48typedef struct CardAlbum {
50 /* 0x50 */ s32 layer;
51 /* 0x54 */ s32 depth;
52 /* 0x58 */ s32 frame;
53 /* 0x5C */ s32 frameToggle;
54 /* 0x60 */ s32 page;
55 /* 0x64 */ s32 pageCount;
56 /* 0x68 */ s32 active;
57 /* 0x6C */ s32 blink;
58 /* 0x70 */ s32 blinkTime;
59 /* 0x74 */ s32 slot;
60 /* 0x78 */ s32 card;
61 /* 0x7C */ s32 pageHasCards;
63 /* 0xB0 */ s32 cursorFrame;
64 /* 0xB4 */ s32 cursorTime;
65 /* 0xB8 */ PanelAnim fade; /* the album */
66 /* 0xC8 */ PanelAnim infoFade; /* the card's details */
67} CardAlbum;
68
69typedef struct CardAlbumWindows {
70 /* 0x00 */ TextWindow *title;
71 /* 0x04 */ TextWindow *help;
72 /* 0x08 */ TextWindow *page;
73 /* 0x0C */ TextWindow *pageSlash;
74 /* 0x10 */ TextWindow *pageCount;
75 /* 0x14 */ TextWindow *prev;
76 /* 0x18 */ TextWindow *next;
77 /* 0x1C */ TextWindow *name;
79 /* 0x24 */ TextWindow *level; /* card data [5] */
81 /* 0x2C */ TextWindow *count; /* copies the player has */
82 /* 0x30 */ TextWindow *text;
84 /* 0x38 */ TextWindow *stat1; /* card data [1] */
86 /* 0x40 */ TextWindow *stat2; /* card data [2] */
87 /* 0x44 */ CardAlbumGrid *grid;
88 /* 0x48 */ ScreenFade *fader;
90
91typedef struct CardAlbumFuncs {
92 /* 0x00 */ void (*loadFiles)(void);
93 /* 0x04 */ s32 (*filesLoading)(void);
94 /* 0x08 */ void (*startFade)(PanelAnim *fade, s32 fadeIn);
95 /* 0x0C */ s32 (*updateFade)(PanelAnim *fade);
96 /* 0x10 */ void (*startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames);
97 /* 0x14 */ s32 (*updateLerp)(MenuLerp *lerp);
99
100void STCRDABM_loadFiles(void);
102void STCRDABM_startFade(PanelAnim *fade, s32 fadeIn);
104void STCRDABM_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames);
106void STCRDABM_startFader(ScreenFade *task, s32 fadeIn, s32 duration);
111void STCRDABM_setPage(CardAlbumGrid *grid, s32 first);
113void STCRDABM_drawCards(CardAlbumGrid *grid, s32 previous);
121void STCRDABM_showPageInfo(CardAlbum *album, CardAlbumWindows *win, s32 show);
122void STCRDABM_showCardInfo(CardAlbum *album, CardAlbumWindows *win, s32 show);
123void STCRDABM_drawAlbum(CardAlbum *album);
128
129#endif /* STCRDABM_H */
void STCRDABM_startFader(ScreenFade *task, s32 fadeIn, s32 duration)
s32 STCRDABM_pageHasCards(CardAlbumGrid *grid)
1 when the grid's page holds a seen card (or runs past the last card)
Definition album.c:155
s32 STCRDABM_updateLerp(MenuLerp *lerp)
void STCRDABM_updateFader(ScreenFade *task)
void STCRDABM_hideCards(CardAlbumGrid *grid)
void STCRDABM_setPage(CardAlbumGrid *grid, s32 first)
Turns the grid to the page whose first card is first (grid->setPage)
Definition album.c:39
void STCRDABM_updateGrid(CardAlbumGrid *grid)
The card grid's task: draws the page's cards; on a page turn, turns its 12 slots one every 2 frames o...
Definition album.c:173
s32 STCRDABM_filesLoading(void)
Whether the card data or the strings are still loading.
Definition album.c:751
void STCRDABM_drawAlbum(CardAlbum *album)
Draws the album: the scrolling background, its panels as they open, the blinking previous and next pa...
Definition album.c:377
void STCRDABM_updateScene(Task *task, CardAlbum **child)
s32 STCRDABM_updateFade(PanelAnim *fade)
void STCRDABM_drawTurningSlots(CardAlbumGrid *grid)
Draws the slots turned so far over the cards, flashing the ones with a seen card.
Definition album.c:131
void STCRDABM_findPageCards(CardAlbum *album)
Notes which slots of the current page hold a seen card, and whether any does.
Definition album.c:478
void STCRDABM_showPageInfo(CardAlbum *album, CardAlbumWindows *win, s32 show)
Shows the title, help and page number and, while the album takes input, the previous and next page hi...
Definition album.c:282
void STCRDABM_updateHiding(CardAlbumGrid *grid)
CardAlbum * STCRDABM_createAlbum(void)
Creates the album (task), on the top layer.
Definition album.c:724
void STCRDABM_createWindows(CardAlbum *album, CardAlbumWindows *win)
Creates the album's text windows (the page's and the selected card's), in front of the album.
Definition album.c:254
void STCRDABM_startFade(PanelAnim *fade, s32 fadeIn)
void STCRDABM_loadFiles(void)
Loads the album's images and requests the card data and the card names, effects and album strings.
Definition album.c:734
#define ALBUM_PAGE_CARDS
Definition album.h:16
void STCRDABM_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames)
ScreenFade * STCRDABM_createFader(void)
void STCRDABM_drawCards(CardAlbumGrid *grid, s32 previous)
Draws the page's cards, or the page being turned when previous != 0: a seen card's image,...
Definition album.c:52
void STCRDABM_updateAlbum(CardAlbum *album, CardAlbumWindows *win)
The album's task: loads the files and creates its windows, then runs and draws it; once the screen ha...
Definition album.c:689
CardAlbumGrid * STCRDABM_createGrid(CardAlbum *album)
Creates the album's card grid (task), on the top layer.
Definition album.c:233
void STCRDABM_runAlbum(CardAlbum *album, CardAlbumWindows *win)
The album's steps: opens it, then turns pages with L1 and R1, moves the cursor between the seen cards...
Definition album.c:609
void STCRDABM_showCardInfo(CardAlbum *album, CardAlbumWindows *win, s32 show)
Shows the card under the cursor (album->card = page * 12 + slot + 1) once the player has seen it: its...
Definition album.c:320
void STCRDABM_drawFader(ScreenFade *fader)
void STCRDABM_loadIcons(CardAlbumGrid *grid)
Loads the images of the grid's page of cards, from grid->first, into VRAM's 6x2 grid of card images.
Definition album.c:19
signed int s32
Definition common.h:11
unsigned char u8
Definition common.h:8
#define TASK_HEADER(Type)
Definition task.h:39
s32(* updateFade)(PanelAnim *fade)
Definition album.h:95
s32(* updateLerp)(MenuLerp *lerp)
Definition album.h:97
void(* startFade)(PanelAnim *fade, s32 fadeIn)
Definition album.h:94
s32(* filesLoading)(void)
Definition album.h:93
void(* startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames)
Definition album.h:96
void(* loadFiles)(void)
Definition album.h:92
Draws the cards of a page and animates the page turns.
Definition album.h:32
void(* setPage)(struct CardAlbumGrid *grid, s32 first)
Definition album.h:44
s32 prevFirst
the page being turned
Definition album.h:38
s32 first
first card of the page
Definition album.h:37
s32 frame
Definition album.h:42
u8 pad[0x10]
never read or written
Definition album.h:43
s32 layer
Definition album.h:35
struct CardAlbum * album
Definition album.h:34
s32 depth
Definition album.h:36
s32 turned
slots turned so far
Definition album.h:40
s32 shown
cards drawn
Definition album.h:39
void(* hide)(struct CardAlbumGrid *grid)
Definition album.h:45
TextWindow * stat2
card data [2]
Definition album.h:86
TextWindow * stat1
card data [1]
Definition album.h:84
TextWindow * text
Definition album.h:82
TextWindow * count
copies the player has
Definition album.h:81
TextWindow * help
Definition album.h:71
TextWindow * title
Definition album.h:70
TextWindow * pageCount
Definition album.h:74
TextWindow * level
card data [5]
Definition album.h:79
TextWindow * stat2Label
Definition album.h:85
TextWindow * countLabel
Definition album.h:80
TextWindow * stat1Label
Definition album.h:83
CardAlbumGrid * grid
Definition album.h:87
TextWindow * next
Definition album.h:76
TextWindow * prev
Definition album.h:75
ScreenFade * fader
Definition album.h:88
TextWindow * pageSlash
Definition album.h:73
TextWindow * name
Definition album.h:77
TextWindow * levelLabel
Definition album.h:78
TextWindow * page
Definition album.h:72
s32 page
Definition album.h:54
s32 frame
Definition album.h:52
s32 blinkTime
Definition album.h:58
s32 active
Definition album.h:56
s32 card
Definition album.h:60
PanelAnim infoFade
the card's details
Definition album.h:66
s32 slotHasCard[12]
Definition album.h:62
PanelAnim fade
the album
Definition album.h:65
s32 pageHasCards
Definition album.h:61
s32 slot
Definition album.h:59
s32 cursorFrame
Definition album.h:63
s32 frameToggle
Definition album.h:53
s32 cursorTime
Definition album.h:64
s32 pageCount
Definition album.h:55
s32 blink
Definition album.h:57
s32 depth
Definition album.h:51
s32 layer
Definition album.h:50
Moves a value towards a target in fixed point, as the menu overlays' startLerp and updateLerp do.
Definition menu.h:27
Opens or closes a menu panel: level goes 0 -> ONE in duration frames (or back at twice the speed),...
Definition menu.h:18
Fades the whole screen to black and back with a subtractive rectangle.
Definition gfx.h:361
Any task, seen through its header.
Definition task.h:62
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
Definition text.h:131