1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<TITLE>CARDStat</TITLE>
9</HEAD>
10<BODY>
11<H1>CARDStat</H1>
12<H2>C Specification</H2>
13<DL>
14  <DD>
15<PRE><code>#include &lt;revolution/card.h&gt;</CODE></PRE>
16  <DD>
17<PRE>&nbsp;typedef struct CARDStat</tt>
18{
19&nbsp;&nbsp;&nbsp;&nbsp; // read-only (Set by CARDGetStatus)
20&nbsp;&nbsp;&nbsp;&nbsp; char fileName[CARD_FILENAME_MAX];
21&nbsp;&nbsp;&nbsp;&nbsp; u32  length;
22&nbsp;&nbsp;&nbsp;&nbsp; u32  time;           // seconds since midnight 01/01/2000
23&nbsp;&nbsp;&nbsp;&nbsp; u8&nbsp;&nbsp; gameName[4];
24&nbsp;&nbsp;&nbsp;&nbsp; u8&nbsp;&nbsp; company[2];
25
26&nbsp;&nbsp;&nbsp;&nbsp; // read/write (Set by CARDGetStatus/CARDSetStatus)
27&nbsp;&nbsp;&nbsp;&nbsp; u8&nbsp;&nbsp; bannerFormat;
28&nbsp;&nbsp;&nbsp;&nbsp; u32&nbsp; iconAddr;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
29&nbsp;&nbsp;&nbsp;&nbsp; u16&nbsp; iconFormat;
30&nbsp;&nbsp;&nbsp;&nbsp; u16&nbsp; iconSpeed;
31&nbsp;&nbsp;&nbsp;&nbsp; u32  commentAddr;
32
33&nbsp;&nbsp;&nbsp;&nbsp; // read-only (Set by CARDGetStatus)
34&nbsp;&nbsp;&nbsp;&nbsp; u32&nbsp; offsetBanner;
35&nbsp;&nbsp;&nbsp;&nbsp; u32&nbsp; offsetBannerTlut;
36&nbsp;&nbsp;&nbsp;&nbsp; u32&nbsp; offsetIcon[CARD_ICON_MAX];
37&nbsp;&nbsp;&nbsp;&nbsp; u32&nbsp; offsetIconTlut;
38&nbsp;&nbsp;&nbsp;&nbsp; u32&nbsp; offsetData;
39} CARDStat;
40
41#define CARDGetBannerFormat(stat)       (((stat)-&gt;bannerFormat) &amp; CARD_STAT_BANNER_MASK)
42#define CARDGetIconAnim(stat)           (((stat)-&gt;bannerFormat) &amp; CARD_STAT_ANIM_MASK)
43#define CARDGetIconFormat(stat, n)      (((stat)-&gt;iconFormat &gt;&gt; (2 * (n))) &amp; CARD_STAT_ICON_MASK)
44#define CARDGetIconSpeed(stat, n)       (((stat)-&gt;iconSpeed  &gt;&gt; (2 * (n))) &amp; CARD_STAT_SPEED_MASK)
45#define CARDSetIconFormat(stat, n, f)   ((stat)-&gt;iconFormat = (u16) (((stat)-&gt;iconFormat &amp; ~(CARD_STAT_ICON_MASK  &lt;&lt; (2 * (n)))) | ((f) &lt;&lt; (2 * (n)))))
46#define CARDSetIconSpeed(stat, n, f)    ((stat)-&gt;iconSpeed  = (u16) (((stat)-&gt;iconSpeed  &amp; ~(CARD_STAT_SPEED_MASK &lt;&lt; (2 * (n)))) | ((f) &lt;&lt; (2 * (n)))))
47
48#define CARD_STAT_ICON_NONE     0
49#define CARD_STAT_ICON_C8       1
50#define CARD_STAT_ICON_RGB5A3   2
51#define CARD_STAT_ICON_MASK     3
52
53#define CARD_STAT_BANNER_NONE   0
54#define CARD_STAT_BANNER_C8     1
55#define CARD_STAT_BANNER_RGB5A3 2
56#define CARD_STAT_BANNER_MASK   3
57
58// .bannerFormat
59#define CARD_STAT_ANIM_LOOP     0x00
60#define CARD_STAT_ANIM_BOUNCE   0x04
61#define CARD_STAT_ANIM_MASK     0x04
62
63#define CARD_STAT_SPEED_END     0
64#define CARD_STAT_SPEED_FAST    1
65#define CARD_STAT_SPEED_MIDDLE  2
66#define CARD_STAT_SPEED_SLOW    3
67#define CARD_STAT_SPEED_MASK    3</PRE>
68</DL>
69<H2>Description</H2>
70<P>The <code>CARDStat</code> data structure represents the status of a file.</P>
71<TABLE border="1" cellpadding="3" cellspacing="0.1">
72  <TBODY>
73    <TR>
74<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>gameName</CODE></EM></STRONG></CODE></TD>
75<TD width="520">Game code.</TD>
76    </TR>
77    <TR>
78<TD width="120" bgcolor="#ffffe8"><CODE>company</CODE></TD>
79<TD width="520">Company code.</TD>
80    </TR>
81    <TR>
82<TD width="120" bgcolor="#ffffe8"><CODE>length</CODE></TD>
83<TD width="520">File length in bytes.</TD>
84    </TR>
85    <TR>
86<TD width="120" bgcolor="#ffffe8"><CODE>fileName</CODE></TD>
87<TD width="520">File name. <em><strong><code>fileName</code> is not shown on the card menu screen.</TD>
88    </TR>
89    <TR>
90<TD width="120" bgcolor="#ffffe8"><CODE><code><EM><STRONG>time</STRONG></EM></code></CODE></TD>
91<TD width="520">Last access time in seconds since midnight 1/1/2000.</TD>
92    </TR>
93    <TR>
94<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>bannerFormat</CODE></EM></STRONG></CODE></TD>
95<TD width="520">One <code>CARD_STAT_BANNER_*</code> ORed with one <code>CARD_STAT_ANIM_*</code>. Referred by the <code>CARDGetBannerFormat</code> and <code>CARDGetIconAnim</code> functions.</TD>
96    </TR>
97    <TR>
98<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>iconAddr</CODE></EM></STRONG></CODE></TD>
99<TD width="520">File offset to the banner/icon data. <STRONG><EM><CODE>iconAddr</CODE></EM></STRONG> must be <code>0xffffffff</code> (no icon) or less than <code>CARD_READ_SIZE</code>. At least one icon is required in a game file.</TD>
100    </TR>
101    <TR>
102<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>iconFormat</CODE></EM></STRONG></CODE></TD>
103<TD width="520">bit 1-0: Icon 0 format (one <code>CARD_STAT_ICON_*</code>).<BR>bit 3-2: Icon 1 format (one <code>CARD_STAT_ICON_*</code>).<BR>bit 5-4: Icon 2 format (one <code>CARD_STAT_ICON_*</code>).<BR>bit 7-6: Icon 3 format (one <code>CARD_STAT_ICON_*</code>).<BR>bit 9-8: Icon 4 format (one <code>CARD_STAT_ICON_*</code>).<BR>bit 11-10: Icon 5 format (one <code>CARD_STAT_ICON_*</code>).<BR>bit 13-12: Icon 6 format (one <code>CARD_STAT_ICON_*</code>).<BR>bit 15-14: Icon 7 format (one <code>CARD_STAT_ICON_*</code>).<BR>Referred by the <code>CARDGetIconFormat</code>/<code>CARDSetIconFormat</code> function.</TD>
104    </TR>
105    <TR>
106<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>iconSpeed</CODE></EM></STRONG></CODE></TD>
107<TD width="520">bit 1-0: Icon 0 speed (one <code>CARD_STAT_SPEED_*</code>).<BR>bit 3-2: Icon 1 speed (one <code>CARD_STAT_SPEED_*</code>).<BR>bit 5-4: Icon 2 speed (one <code>CARD_STAT_SPEED_*</code>).<BR>bit 7-6: Icon 3 speed (one <code>CARD_STAT_SPEED_*</code>).<BR>bit 9-8: Icon 4 speed (one <code>CARD_STAT_SPEED_*</code>).<BR>bit 11-10: Icon 5 speed (one <code>CARD_STAT_SPEED_*</code>).<BR>bit 13-12: Icon 6 speed (one <code>CARD_STAT_SPEED_*</code>).<BR>bit 15-14: Icon 7 speed (one <code>CARD_STAT_SPEED_*</code>).<BR>Referred by the <code>CARDGetIconSpeed/CARDSetIconSpeed</code> function.</TD>
108    </TR>
109    <TR>
110<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>commentAddr</CODE></EM></STRONG></CODE></TD>
111<TD width="520">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. </strong></em> 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).)?</TD>
112    </TR>
113    <TR>
114<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>offsetBanner</CODE></EM></STRONG></CODE></TD>
115<TD width="520">File offset to the banner texture.</TD>
116    </TR>
117    <TR>
118<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>offsetBannerTlut</CODE></EM></STRONG></CODE></TD>
119<TD width="520">File offset to TLUT of the banner texture.</TD>
120    </TR>
121    <TR>
122<TD width="120" bgcolor="#ffffe8"><code>offsetIcon[</code><em>n</em><code>]</code></TD>
123<TD width="520">File offset to the <em>n</em>th icon texture.</TD>
124    </TR>
125    <TR>
126<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>offsetIconTlut</CODE></EM></STRONG></CODE></TD>
127<TD width="520">File offset to the TLUT of the icon.</TD>
128    </TR>
129    <TR>
130<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><CODE>offsetData</CODE></EM></STRONG></CODE></TD>
131<TD width="520">File offset to the byte next to the end of the icon/banner data.</TD>
132    </TR>
133  </TBODY>
134</TABLE>
135<H2>See Also</H2>
136<P><a target="contents" href="toc.html">Card Functions</a>, <br> <a href="CARDGetStatus.html"><code>CARDGetStatus</code></a>, <a href="CARDSetStatus.html"><code>CARDSetStatus</code></a>, <a href="CARDSetStatusAsync.html"><code>CARDSetStatusAsync</code></a>,</P>
137<H2>Revision History</H2>
138<P>2006/03/01 Initial version.</P>
139<hr>
140<P>CONFIDENTIAL</p>
141</BODY>
142</HTML>