1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
4<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
5<base target="main">
6<title>Demo for Displaying the Strap Usage Screen</title>
7</head>
8
9<body>
10
11<h1>Demo for Displaying the Strap Usage Screen</h1>
12<h2>Location</h2>
13<p>
14<code>$REVOLUTION_SDK_ROOT/build/demos/cntdemo</code>
15</p>
16
17<h2>How to Display the Strap Usage Screen Using Its Image Content File</h2>
18<p>This demo uses the procedures in the <a href="./demo.html">NADK sample demo</a> to explain the use, as well as the structure, of the <a href="./shared/StrapImage.html">Image Content File for the Strap Usage Screen (<CODE>StrapImage.arc</CODE>)</a>.<br><br> (Read <CODE>dvddata</CODE> as <CODE>DvdRoot</CODE> if they are not the same.)<br><br>
19
20<STRONG>Note:</STRONG> <br> The image content file for the Strap Usage screen contains 640x480 (4:3) Strap Usage screen images. Applications should either expand or shrink the image data to convert it to a size other than 640x480, if necessary.<br>
21
22If the screen's aspect ratio is 16:9, do not change the width-to-height ratio of the image data for the Strap Usage screen (4:3). Instead, display the image data with a white (RGB = {255,255,255}) border added to each side. Stretching the aspect ratio from 4:3 to 16:9 will change the width-to-height ratio of the image data as well, which may prevent characters from being read properly.<br><br>
23
24The sequence used to display the Strap Usage screen in this demo does not follow the <I>Wii Programming Guidelines</I>. When using the image content file for the Strap Usage screen in a retail product, properly display the screen following the instructions in the <I>Wii Programming Guidelines</I> and the package for the Strap Usage screen.<br>
25
26</p>
27<H3>1.&nbsp;&nbsp;&nbsp;Creating the application</H3>
28<p>
29Create the source in the same way the disc application (ELF file) is normally created. Running <CODE>make</CODE> as usual (without setting any special options) will create a disc application that can be executed with <CODE>ndrun</CODE>.<br><br>
30
31When creating a disc application, use the CNT API to load the image data for the Strap Usage screen, located under <CODE>dvddata/content3</CODE>. Image data for the Strap Usage screen is an LZ77-compressed TPL image. After decompressing the loaded image data using the CX API, use it as a texture with the TPL API. (For specific information on how to use these functions, refer to the <a href="./list.html">CNT API Function Reference</a>, the <a href=" ../cx/list.html">CX API Function Reference</a>, the <a href=" ../tpl/list.html">TPL API Function Reference</a>, and the sample program source code.)<br>
32
33</p>
34<TABLE border="1" width="100%">
35  <TBODY>
36    <TR>
37      <TD width="100%">
38      <PRE><CODE>
39% make
40% ndrun bin/RVL/strapcntdemoD.elf</CODE></PRE>
41      </TD>
42    </TR>
43  </TBODY>
44</TABLE>
45<H3>2.&nbsp;&nbsp;&nbsp;Converting to a NAND application</H3>
46<p>
47Set the CNT API to be used for a NAND application and perform a build. (<CODE>bin/RVL/strapcntdemoD.elf</CODE> will be created.)
48</p>
49<TABLE border="1" width="100%">
50  <TBODY>
51    <TR>
52      <TD width="100%">
53      <PRE><CODE>
54% make NANDAPP=TRUE NOEXPORT=TRUE</CODE></PRE>
55      </TD>
56    </TR>
57  </TBODY>
58</TABLE>
59<p>
60Note that the only purpose here is the build, so <CODE>NOEXPORT</CODE> is defined.<br><br>
61
62Convert the ELF file into a DOL file. (<CODE>bin/RVL/strapcntdemoD.dol</CODE> will be created.)
63</p>
64<TABLE border="1" width="100%">
65  <TBODY>
66    <TR>
67      <TD width="100%">
68      <PRE><CODE>
69% makedol -f bin/RVL/strapcntdemoD.elf -d bin/RVL/strapcntdemoD.dol</CODE></PRE>
70      </TD>
71    </TR>
72  </TBODY>
73</TABLE>
74<p>
75Compress the DOL file. (<CODE>bin/RVL/strapcntdemoD.dol.lz7</CODE> will be created) <br>The system is set so that LZ77 extended compression is specified for the compression format and the size is aligned to a 32-byte boundary using the <CODE>-A</CODE> option.
76</p>
77<TABLE border="1" width="100%">
78  <TBODY>
79    <TR>
80      <TD width="100%">
81      <PRE><CODE>
82% ntcompress[D].exe -lex -A32 -o bin/RVL/strapcntdemoD.dol.lz7 bin/RVL/strapcntdemoD.dol</CODE></PRE>
83      </TD>
84    </TR>
85  </TBODY>
86</TABLE>
87<p>
88Archive the files under the <CODE>dvddata/content3</CODE> directory. (<CODE>/dvddata/archives/content3.arc</CODE> will be created.)
89</p>
90<TABLE border="1" width="100%">
91  <TBODY>
92    <TR>
93      <TD width="100%">
94      <PRE><CODE>
95% cd ../../../dvddata/content3; darchD -c * ../archives/content3.arc</CODE></PRE>
96      </TD>
97    </TR>
98  </TBODY>
99</TABLE>
100<p>
101Package the compressed DOL file and content file to create a WAD file. (<CODE>strapcntdemoD.wad</CODE> will be created.) <br>This demo uses the <CODE>-T</CODE> option to specify that the image content for the Strap Usage screen will be shared content. The file <CODE>content2.arc</CODE> is specified as a dummy file in order to align the number of contents in the source.
102</p>
103
104<TABLE border="1" width="100%">
105  <TBODY>
106    <TR>
107      <TD width="100%">
108      <PRE><CODE>
109% makeWad -n strapcntdemoD -l bin/RVL/strapcntdemoD.dol.lz7,<br>cnt/content2.arc,../../../dvddata/archives/content3.arc -gc RABA -g ZZ -T 0,0,1</CODE></PRE>
110      </TD>
111    </TR>
112  </TBODY>
113</TABLE>
114<br>
115
116
117<H3>3.&nbsp;&nbsp;&nbsp;Preparing for import</H3>
118<p>
119Copy the WAD file to the <CODE>dvddata/viewer</CODE> directory. (Create these directories if there is a different <CODE>DvdRoot</CODE> or the <CODE>viewer</CODE> directory does not exist.) <br>Next, start Nmenu (<CODE>Nmenu.elf</CODE>).
120</p>
121<TABLE border="1" width="100%">
122  <TBODY>
123    <TR>
124      <TD width="100%">
125      <PRE><CODE>
126% mv strapcntdemoD.wad ../../../dvddata/viewer
127% ndrun ../../../RVL/bin/tools/Nmenu.elf	</CODE></PRE>
128      </TD>
129    </TR>
130  </TBODY>
131</TABLE>
132
133<H3>4.&nbsp;&nbsp;&nbsp;Importing and executing</H3>
134<p>
135<CODE>Nmenu</CODE> starts in Import Mode. In Import Mode, the WAD file in <CODE>DvdRoot/viewer</CODE> can be imported. Press A to import <CODE>strapcntdemoD.wad</CODE>. Next, press B to enter Title List Mode. Pressing the A button at this time causes the application to execute. (Click <a href="./Nmenu.html">here</a> for information on <CODE>Nmenu</CODE>.)
136</p>
137
138<p>
139When the application is executed, the Strap Usage Screen is displayed.<br>The image type for the Strap Usage screen will be changed during a 5-second interval, and then the screen will fade in and out over a 20-second interval.<br>You can change the language using the A Button on the GameCube Controller.<br>The order in which languages are switched is: Japanese -&gt; English -&gt; French -&gt; German -&gt; Italian -&gt; Spanish -&gt; Dutch -&gt; Japanese.
140
141</p>
142
143<h2>Creating a WAD File for the Master Data</h2>
144<p>
145The image content file (<CODE>content3.arc</CODE>) created by this demo for the Strap Usage screen is intended only for the demo. It cannot be used when creating master data.<br>When creating master data, use the <CODE>{DvdRoot}/archives/StrapImage.arc</CODE> file, provided as a shared content file, to generate the WAD file.<br></p>
146
147<TABLE border="1" width="100%">
148  <TBODY>
149    <TR>
150      <TD width="100%">
151      <PRE><CODE>
152% makeWad -n strapcntdemoD -l bin/RVL/strapcntdemoD.dol.lz7,<br>cnt/content2.arc,../../../dvddata/archives/<font color=red>StrapImage.arc</font> -gc RABA -g ZZ -T 0,0,1</CODE></PRE>
153      </TD>
154    </TR>
155  </TBODY>
156</TABLE>
157
158
159<h2>Note</h2>
160<p>
161The end of the archive file is not 32-byte aligned. Accordingly, a specified 32-byte aligned value is returned as the <CODE>CNTRead</CODE> return value for DVD applications, but a different value, the actual size that was read, is returned for NAND applications.
162</p>
163
164<h2>Revision History</h2>
165<p>
1662008/07/25 Moved <CODE>content2.arc</CODE> from <CODE>dvddata/archives</CODE> to <CODE>cntdemo/cnt</CODE>.<br>2008/07/23 Changed the demo name from <CODE>strapimagedemo</CODE> to <CODE>strapcntdemo</CODE> and moved it under <CODE>cntdemo</CODE>.<br>2008/07/22 Added a note about changing image sizes. Added a note related to the guidelines for displaying the Strap Usage screen.<br>2008/03/04 Initial version.
167</p>
168
169
170<hr><p>CONFIDENTIAL</p></body>
171</html>
172