#include <revolution/card.h>
typedef struct CARDStat
{
// read-only (Set by CARDGetStatus)
char fileName[CARD_FILENAME_MAX];
u32 length;
u32 time; // seconds since midnight 01/01/2000
u8 gameName[4];
u8 company[2];
// read/write (Set by CARDGetStatus/CARDSetStatus)
u8 bannerFormat;
u32 iconAddr;
u16 iconFormat;
u16 iconSpeed;
u32 commentAddr;
// read-only (Set by CARDGetStatus)
u32 offsetBanner;
u32 offsetBannerTlut;
u32 offsetIcon[CARD_ICON_MAX];
u32 offsetIconTlut;
u32 offsetData;
} CARDStat;
#define CARDGetBannerFormat(stat) (((stat)->bannerFormat) & CARD_STAT_BANNER_MASK)
#define CARDGetIconAnim(stat) (((stat)->bannerFormat) & CARD_STAT_ANIM_MASK)
#define CARDGetIconFormat(stat, n) (((stat)->iconFormat >> (2 * (n))) & CARD_STAT_ICON_MASK)
#define CARDGetIconSpeed(stat, n) (((stat)->iconSpeed >> (2 * (n))) & CARD_STAT_SPEED_MASK)
#define CARDSetIconFormat(stat, n, f) ((stat)->iconFormat = (u16) (((stat)->iconFormat & ~(CARD_STAT_ICON_MASK << (2 * (n)))) | ((f) << (2 * (n)))))
#define CARDSetIconSpeed(stat, n, f) ((stat)->iconSpeed = (u16) (((stat)->iconSpeed & ~(CARD_STAT_SPEED_MASK << (2 * (n)))) | ((f) << (2 * (n)))))
#define CARD_STAT_ICON_NONE 0
#define CARD_STAT_ICON_C8 1
#define CARD_STAT_ICON_RGB5A3 2
#define CARD_STAT_ICON_MASK 3
#define CARD_STAT_BANNER_NONE 0
#define CARD_STAT_BANNER_C8 1
#define CARD_STAT_BANNER_RGB5A3 2
#define CARD_STAT_BANNER_MASK 3
// .bannerFormat
#define CARD_STAT_ANIM_LOOP 0x00
#define CARD_STAT_ANIM_BOUNCE 0x04
#define CARD_STAT_ANIM_MASK 0x04
#define CARD_STAT_SPEED_END 0
#define CARD_STAT_SPEED_FAST 1
#define CARD_STAT_SPEED_MIDDLE 2
#define CARD_STAT_SPEED_SLOW 3
#define CARD_STAT_SPEED_MASK 3
The CARDStat data structure represents the status of a file.
|
Game code. |
|
Company code. |
|
File length in bytes. |
|
File name. fileName is not shown on the card menu screen. |
|
Last access time in seconds since midnight 1/1/2000. |
|
One CARD_STAT_BANNER_* ORed with one CARD_STAT_ANIM_*. Referred by the CARDGetBannerFormat and CARDGetIconAnim functions. |
|
File offset to the banner/icon data. iconAddr must be 0xffffffff (no icon) or less than CARD_READ_SIZE. At least one icon is required in a game file. |
|
bit 1-0: Icon 0 format (one CARD_STAT_ICON_*).bit 3-2: Icon 1 format (one CARD_STAT_ICON_*).bit 5-4: Icon 2 format (one CARD_STAT_ICON_*).bit 7-6: Icon 3 format (one CARD_STAT_ICON_*).bit 9-8: Icon 4 format (one CARD_STAT_ICON_*).bit 11-10: Icon 5 format (one CARD_STAT_ICON_*).bit 13-12: Icon 6 format (one CARD_STAT_ICON_*).bit 15-14: Icon 7 format (one CARD_STAT_ICON_*).Referred by the CARDGetIconFormat/CARDSetIconFormat function. |
|
bit 1-0: Icon 0 speed (one CARD_STAT_SPEED_*).bit 3-2: Icon 1 speed (one CARD_STAT_SPEED_*).bit 5-4: Icon 2 speed (one CARD_STAT_SPEED_*).bit 7-6: Icon 3 speed (one CARD_STAT_SPEED_*).bit 9-8: Icon 4 speed (one CARD_STAT_SPEED_*).bit 11-10: Icon 5 speed (one CARD_STAT_SPEED_*).bit 13-12: Icon 6 speed (one CARD_STAT_SPEED_*).bit 15-14: Icon 7 speed (one CARD_STAT_SPEED_*).Referred by the CARDGetIconSpeed/CARDSetIconSpeed function. |
|
File offset to two pairs of '\0'-terminated 32-byte (including the terminating '\0) file description strings. Both strings are shown on the card menu screen. The 64-byte comment data must not cross the 8-KB boundary of the file (i.e., the comment data must fit an 8KB block of the file). |
|
File offset to the banner texture. |
|
File offset to TLUT of the banner texture. |
offsetIcon[n] |
File offset to the nth icon texture. |
|
File offset to the TLUT of the icon. |
|
File offset to the byte next to the end of the icon/banner data. |
Card Functions,
CARDGetStatus, CARDSetStatus, CARDSetStatusAsync,
03/01/2006 Initial version.