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>Data Title Sample Demo</title> 7</head> 8 9<body> 10 11<h1>Data Title Sample Demo</h1> 12<h2>Location</h2> 13<p> 14<code>$REVOLUTION_SDK_ROOT/build/demos/cntdemo</code> 15</p> 16 17<h2>Application Development and Access Using Disc Emulation</h2> 18<p> 19A sample demo is used here to describe how to develop applications that use data titles with disc emulation. 20</p> 21 22<h3>1. Preparing Content Files for Data Titles</h3> 23<p> 24Prepare the files that will be included in the content file for the data title and place them under the following directory (read <CODE>dvddata</CODE> as the appropriate directory if it is not the same as <CODE>DvdRoot</CODE>). 25</p> 26<TABLE border="1" width="80%"> 27 <TBODY> 28 <TR> 29 <TD width="80%"> 30 <PRE><CODE> 31dvddata/datatitle/{game code}/content{index}/</CODE></PRE> 32 </TD> 33 </TR> 34 </TBODY> 35</TABLE> 36<p> 37The game code for the data title is given by <code>{game code}</code> and the index of the content file is given by <code>{index}</code>. The game code for the data title is <CODE>a000</CODE> and the index for the content file is 1 in the sample demo. 38</p> 39 40<h3>2. Creating an Application That Uses Content Files in a Data Title</h3> 41<p> 42To access the content files of the data title you use the CNT library, just as you would for NAND applications. The difference is that you open the content file using <a href="./CNTInitHandleTitle.html"><code>CNTInitHandleTitle</code></a> (whereas you would use <a href="./CNTInitHandle.html"><code>CNTInitHandle</code></a> for a normal NAND application).<br><br>In order to use <a href="./CNTInitHandleTitle.html"><code>CNTInitHandleTitle</code></a> you must specify a 64-bit title ID. This title ID can be calculated as follows: 43</p> 44<ol> 45<li>Upper 32 bits: Fixed at <CODE>0x00010005</CODE> for data titles.</li> 46<li>Lower 32 bits: Game code, converted into ASCII.</li> 47</ol> 48<p> 49For example, when the game code for a data title is <CODE>a000</CODE>, the title ID is <CODE>0x0001000561303030</CODE> (in ASCII, '0' is <CODE>0x30</CODE> and 'a' is <CODE>0x61</CODE>).<br><br>After the content file has been opened the data can be accessed using the CNT API. For more specific usages, refer to the demo source.<br><br>You can access the files under <CODE>dvddata/datatitle/{game code}/content{index}</CODE> by building and running <CODE>datatitledemo</CODE>. 50</p> 51<TABLE border="1" width="95%"><TBODY><TR><TD width="100%"><PRE><code> 52% make 53% ndrun bin/RVL/datatitledemoD.elf 54</code></PRE></TD></TR></TBODY></TABLE> 55 56<h2>Creating Data Titles and Developing NAND Applications That Access Data Titles</h2> 57<p> 58A sample demo is used here to describe how to create data titles and give examples of how to create NAND applications that use data titles. 59</p> 60 61<H3>1. Creating a Data Title</H3> 62<p> 63A data title can be created by specifying the <code>-f</code> option to <CODE>makeWad</CODE> when it is run. Be aware that a data title does not include a program, and therefore its content numbers start at 1.<br>The beginning of the game code specified with the <code>-gc</code> option must be set to a lower-case alphabetic character. It is set to <code>a000</code> by default.<br><br>A data title will be created by performing a build in <CODE>build/demos/cntdemo</CODE> with <CODE>datatitle</CODE> specified as the target.<br> 64</p> 65<TABLE border="1" width="95%"><TBODY><TR><TD width="100%"><PRE><code> 66% make datatitle 67</code></PRE></TD></TR></TBODY></TABLE> 68<br> 69<p> 70The process collects the following files together as an archive located in <CODE>dvddata/content2/</CODE> and creates the WAD file for the data title that has this as the content file.<br> 71<ul> 72<li><CODE>dvddata/archives/content1_a000.arc</CODE></li> 73<li>build/demos/cntdemo/bin/RVL/a000.wad</li> 74</ul> 75</p> 76 77<h3>2. Importing a Data Title</h3> 78<p> 79Use Nmenu to import a data title into Wii console NAND memory. Nmenu can import the WAD file for a data title in the same way that it imports a file for a NAND application. 80</p> 81 82<p> 83You can also use the ECDK (E-Commerce Library) to download and import a data title. 84</p> 85 86<h3>3. NAND Applications That Access Data Titles Imported into Wii Console NAND Memory</h3> 87<p> 88By defining the <CODE>NANDAPP</CODE> macro as a compiler switch, the CNT API will access a data title in Wii console NAND memory. You can also directly define <CODE>NANDAPP</CODE> before including <CODE>cnt.h</CODE> in your source code and then perform a build to change the location that will be accessed. 89</p> 90 91<p> 92If the <CODE>datatitledemo</CODE> application is built with <CODE>NANDAPP</CODE> defined, it will access the content files in <CODE>a000.wad</CODE>, a data title imported into Wii console NAND memory. 93</p> 94 95<TABLE border="1" width="95%"><TBODY><TR><TD width="100%"><PRE><code> 96% make clean 97% make NANDAPP=TRUE 98</code></PRE></TD></TR></TBODY></TABLE> 99 100<p> 101Use Nmenu to import and run the <CODE>bin/RVL/datatitledemoD.wad</CODE> that is generated. 102</p> 103 104<h2>Revision History</h2> 105<p> 1062008/07/23 Moved <CODE>datatitledemo</CODE> under <CODE>cntdemo</CODE>.<br>2008/07/22 Changed descriptions again following changes in the way Nmenu handles data titles. Changed descriptions together with the implementation of disc emulation.<br>2008/02/13 Changed the description to be in line with the change in the way data titles are handled by <CODE>Nmenu</CODE>.<br>2007/10/11 Initial version. 107</p> 108 109<hr><p>CONFIDENTIAL</p></body> 110</html> 111