1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4<meta http-equiv="Content-Style-Type" content="text/css">
5<title>ctr_makerom</title>
6<style type="text/css">
7<!--
8body {
9/*
10    font-size       : 10pt;
11*/
12    font-weight     : normal;
13    color           : #000000;
14    margin          : 8px;
15}
16
17div {
18    width           : 98%;
19    white-space     : nowrap;
20}
21
22div.title {
23    text-align      : left;
24    font-weight     : bold;
25/*
26    font-size       : 16pt;
27*/
28    font-size       : 150%;
29    color           : #202020;
30    border-style    : double;
31    border-width    : 8px;
32    /* タイトルを囲む枠線の色を指定 */
33    border-color    : #FF6600;
34
35    /* RVLプラットフォーム系列 */
36/*
37    border-color    : #34beed;
38*/
39
40    /* TWLプラットフォーム系列 */
41/*
42    border-color    : #ff458f;
43*/
44
45    margin          : 4px;
46    padding         : 4px;
47}
48H1 {
49  font-size		: 150%;
50  font-family		: Arial;
51  border-bottom-width	: 5px;
52  border-bottom-style	: solid;
53  border-bottom-color	: #FF6600;
54  padding-bottom		: 1px;
55  margin-bottom		: 20px;
56  letter-spacing		: normal;
57  font-weight		: bold;
58}
59
60h2 {
61    font-weight     : bold;
62/*
63    font-size       : 16pt;
64*/
65    font-size       : 150%;
66    border-style    : none none solid double;
67    border-width    : 0px 0px 2px 8px;
68    /* 見出しの線の色を指定 */
69    border-color    : #FF6600;
70
71    /* RVLプラットフォーム系列 */
72/*
73    border-color    : #34beed;
74*/
75
76    /* TWLプラットフォーム系列 */
77/*
78    border-color    : #ff458f;
79*/
80
81    margin-left     : 2px;
82    padding-left    : 4px;
83}
84CODE {
85  font-family		: "Courier New", monospace;
86  position		: normal;
87  left			: 12px;
88  font-size		: 10pt;
89}
90table {
91  margin-top        : 2pt;
92  margin-bottom     : 2pt;
93  margin-left       : 0pt;
94  margin-right      : 0pt;
95  padding-left      : 0pt;
96  padding-right     : 0pt;
97  position          : relative;
98  left              : 12px;
99  font-family       : Arial;
100  font-size         : 10pt;
101  border-style      : none none none none;
102}
103td,th {
104  padding           : 2pt;
105  border-width      : 2pt;
106  border-style      : none none none none;
107  font-style        : normal;
108  text-align        : left;
109}
110td {
111  background        : #e8f4f4;
112  font-weight       : normal;
113}
114th {
115  background        : #c0d8d8;
116  font-weight       : bold;
117}
118
119p {
120    margin-left     : 4px;
121}
122p.code {
123  font-family		: "Courier New", monospace;
124  position		: normal;
125  left			: 12px;
126  font-size		: 10pt;
127  background            : #e8f4f4;
128}
129
130-->
131</style>
132
133</head>
134<body>
135<a name="top"></a>
136
137<h1><CODE>ctr_makerom</CODE></h1>
138
139<h1>Table of Contents</h1>
140<ol>
141<li><a href="#intro">Introduction</a></li>
142<li><a href="#usage">How to Use</a></li>
143<li><a href="#rsf">RSF File</a></li>
144<li><a href="#desc">DESC File</a></li>
145<li><a href="#titleid">Game Software Prototype Code</a></li>
146<li><a href="#omake">Variables Defined within OMakefiles</a></li>
147<li><a href="#history">Revision History</a></li>
148</ol>
149
150
151
152<h2><a name="intro">Introduction</a></h2>
153<P>This <CODE>ctr_makerom</CODE> tool is for creating CCI (CTR Card Image) files. CCI files are created based on the content in RSF files.</P>
154
155<P>If a NAND application is specified as the output format, a CXI (Ctr eXecutable Image) file is generated as the output. The requirements for CXI file generation are the same as for CCI files.</P>
156
157<h2><a name="usage">How to Use</a></h2>
158<h3>What's Required</h3>
159<p>You will need the following to create a CCI file:</p>
160<ul>
161<li> ELF file that was created using &quot;RVCT for Nintendo&quot;
162<li> RSF File
163<li> DESC File
164</ul>
165
166<p>
167RSF files contain the information required to create a CCI file. They must be created individually for each application. By default, the SDK's default RSF file is used. Be sure to always use the DESC file included in the SDK.
168</p>
169
170<h3>Command</h3>
171
172
173<p class="code">
174% ctr_makerom32 ELF_FILE -rsf RSF_FILE -desc DESC_FILE [-o OUTPUT_FILE] [-Dname=value...] [-f FORMAT] [-info INFO_FILE] [-banner BANNER_FILE] [-icon ICON_FILE] [-cxi CXI_FILE:PARTITION_ID]
175</p>
176
177<p class="first_ja">You must specify the ELF, RSF, and DESC files. All other options are optional.</p>
178
179<h4 >Options</h4>
180
181
182<div class="table">
183<table border="1">
184<thead>
185<tr>
186<th align="center">Options</th>
187<th align="center">Description</th>
188</tr>
189</thead>
190<tbody>
191<tr>
192<td align="center">-rsf</td>
193<td align="center">Specifies the RSF file.</td>
194</tr>
195<tr>
196<td align="center">-desc</td>
197<td align="center">Specifies the DESC file.</td>
198</tr>
199<tr>
200<td align="center">-banner</td>
201<td align="center">Specifies the banner file.</td>
202</tr>
203<tr>
204<td align="center">-icon</td>
205<td align="center">Specifies the icon file.</td>
206</tr>
207<tr>
208<td align="center">-content CONTENTS_PATH:INDEX</td>
209<td align="center">
210Specifies content (.cfa) included in the CCI.<BR>Specify the contents file path in CONTENTS_PATH.<BR>Specify the partition number including the content in INDEX.<BR>The values specifiable for INDEX vary depending on the following conditions.
211<table border="1">
212<tr>
213<td>When an ELF_FILE is specified</td>
214<td>1 through 7 can be specified for INDEX.</td>
215</tr>
216<tr>
217<td>When an ELF_FILE is not specified</td>
218<td>0 through 7 can be specified for INDEX.</td>
219</tr>
220</table>
221
222</td>
223</tr>
224<tr>
225<td align="center">-o</td>
226<td align="center">Specifies the output filename. If omitted, the output file will have the same basename as the ELF file used as input, and instead of the .elf extension, the output file extension will be .cci for card applications and .cxi for NAND applications.</td>
227</tr>
228<tr>
229<td align="center">-Dname=value</td>
230<td align="center">Specifies the variable name (<CODE>name</CODE>) and value (<CODE>value</CODE>) from the RSF file to reference. References to <CODE>$(name)</CODE> in the RSF file are replaced with the <CODE>value</CODE> command line argument and then evaluated.</td>
231</tr>
232<tr>
233<td align="center">-f FORMAT</td>
234<td align="center">Specifies the format of the image to output. The following values can be specified for FORMAT.
235<table border="1">
236<tr>
237<td>card</td>
238<td>Outputs in .cci format. Specify this option when creating a regular card application.</td>
239</tr>
240<tr>
241<td>nand</td>
242<td>Outputs in .cxi format. Specify this option when building a NAND application.<br/>You must use the .cxi file generated as input to ctr_makecia to create a .cia file in order to create images that can actually be imported to NAND.</td>
243</tr>
244<tr>
245<td>data</td>
246<td>Output is made in .cfa format. The generated .cfa file can be made to include a separate CCI by using the -content option.</td>
247</tr>
248</table>
249If no format is specified, the default value of <CODE>nand</CODE> is used.
250</td>
251</td>
252</tr>
253<tr>
254<td align="center">-info</td>
255<td align="center">Specifies the output file for information about the output image. If unspecified, the output filename will have the <CODE>.xml</CODE> filename extension. This file contains information about the application title and ROMFS.
256</td>
257</td>
258</tr>
259</tbody>
260</table>
261</div>
262
263<h2><a name="rsf">RSF File</a></h2>
264
265<p>This is a file that contains the settings for the CCI file to be generated.</p>
266
267<h3>Format</h3>
268
269<p>The RSF file format is shown below.</p>
270
271<p class="code">
272BasicInfo:<br/>  Title:           # Application title<br/>   CompanyCode:     # Company code<br/>   ProductCode:     # Product code<br/>   MediaSize:       # Media size<br/>   Logo:            # Logo data specification<br/>
273
274</br> TitleInfo: <br/>   Category:        # Title category<br/>   UniqueId:        # Unique ID for title code<br/>   ChildIndex:      # DLP child index<br/> <br/> Rom:<br/>  HostRoot:    # Root path of the ROM file system<br/>   Reject:      # File and directory names to exclude from the ROM file system<br/> <br/> AccessControlInfo:<br/>  Priority:    # Priority of main thread<br/> <br/> SystemControlInfo:<br/>  StackSize:       # Main thread stack size<br/> <br/> Option:<br/>  EnableCompress:  # Enable/disable compression of static memory<br/>
275
276</p>
277
278<p>
279Configure the values of the items under the four main sections (<CODE>BasicInfo</CODE>, <CODE>TitleInfo</CODE>, <CODE>Rom</CODE>, <CODE>AccessControlInfo</CODE>, and <CODE>SystemControlInfo</CODE>).<br/>Set the values using the following format:
280
281<h3>Specifying Single Values</h3>
282<p class="code">
283Key Name: Value
284</p>
285
286<h3><a name="sequence_element" />Specifying Multiple Values</h3>
287<p class="code">
288Key Name:<br/>  - Value 1<br/>   - Value 2<br/>   ...<br/>
289</p>
290
291</p>
292
293<h4>Notes</h4>
294<ul>
295<li>Tabs cannot be used in place of half-width spaces.</li>
296<li>You must use at least one half-width space after the colons and hyphens that separate the key names from the values.</li>
297<li>The indentation before all items within each main section is required. Use half-width spaces for this indentation.</li>
298<li>Main sections must appear at the start of a line.</li>
299<li>Each item within a given main section must be indented by the same number of spaces.</li>
300</ul>
301
302Following are sample settings for each of these sections.
303
304<h4>BasicInfo</h4>
305<div class="table">
306<table border="1">
307<thead>
308<tr>
309<th align="center">Item Name</th>
310<th align="center">Description</th>
311<th align="center">Comment</th>
312</tr>
313</thead>
314<tbody>
315<tr>
316<td align="center">Title</td>
317<td align="center">The title of the application. Specifies the application title in 8 or fewer ASCII characters.</td>
318<td align="center"></td>
319</tr>
320<tr>
321<td align="center">CompanyCode</td>
322<td align="center">The company code. Company code that was assigned when the licensing agreement was signed with Nintendo. Two ASCII characters.</td>
323<td align="center"></td>
324</tr>
325<tr>
326<td align="center">ProductCode</td>
327<td align="center">Product code. Specifies the product code issued by Nintendo.</td>
328<td align="center"></td>
329</tr>
330<tr>
331<td align="center">MediaSize</td>
332<td align="center">Specifies the media size. Specify a value of 125 MB, 256 MB, 512 MB, 1 GB, or 2 GB.</td>
333<td align="center"></td>
334</tr>
335<tr>
336<td align="center">Logo</td>
337<td align="center">Specifies the type of logo data. Specify one of &quot;Nintendo&quot;, &quot;Licensed&quot;, or &quot;Published&quot;.</td>
338<td align="center"></td>
339</tr>
340</tbody>
341</table>
342</div>
343
344<h4>TitleInfo</h4>
345<div class="table">
346<table border="1">
347<thead>
348<tr>
349<th align="center">Item Name</th>
350<th align="center">Description</th>
351<th align="center">Comment</th>
352</tr>
353</thead>
354<tbody>
355<tr>
356<td align="center">Category</td>
357<td align="center">Specifies the application type.<br/>
358<table border="1">
359<tr>
360<td>Application</td>
361<td>Specify this when building a typical application.</td>
362</tr>
363<tr>
364<td>DlpChild</td>
365<td>Specify this when building a download play child.<br/>This must be specified along with ChildIndex (described later).</td>
366</tr>
367</table>
368</td>
369<td align="center">Application is selected if not specified.</td>
370</tr>
371<tr>
372<td align="center">UniqueId</td>
373<td align="center">The application's unique ID. Specifies the ID issued by Nintendo.</td>
374<td align="center">Valid values are from 0x00200 to 0xf7fff.</td>
375</tr>
376<tr>
377<td align="center">ChildIndex</td>
378<td align="center">Specifies the download play child index.</td>
379<td></td>
380</tr>
381</tbody>
382</table>
383</div>
384
385
386
387<h4>Rom</h4>
388<div class="table">
389<table border="1">
390<thead>
391<tr>
392<th align="center">Item Name</th>
393<th align="center">Description</th>
394<th align="center">Comment</th>
395</tr>
396</thead>
397<tbody>
398<tr>
399<td align="center">HostRoot</td>
400<td align="center">The root path of the ROM file system.<br/>Specify either an absolute path or a relative path from the directory that is the current directory when executing <CODE>ctr_makerom</CODE>. All files and directories under the directory specified here will be stored in the ROM file system. However, any files or directories that start with a dot (&quot;.&quot;) will not be stored in the ROM file system, nor will any files or directories specified under the Reject item.</td>
401<td align="center"></td>
402</tr>
403<tr>
404<td align="center">Reject</td>
405<td align="center">Specify the names of files and directories to exclude from the ROM file system.<br/>Any files or directories that match the names specified will not be stored in the ROM file system. You can set multiple values. Names can use the &quot;*&quot; and &quot;?&quot; wildcards (&quot;*&quot; matches 0 or more characters, and &quot;?&quot; matches a single character).</td>
406<td align="center">Use the syntax described in the <a href="#sequence_element">Specifying Multiple Values</a> section.</td>
407</tr>
408</tbody>
409</table>
410</div>
411
412<h4>SystemControlInfo</h4>
413<div class="table">
414<table border="1">
415<thead>
416<tr>
417<th align="center">Item Name</th>
418<th align="center">Description</th>
419<th align="center">Comment</th>
420</tr>
421</thead>
422<tbody>
423<tr>
424<td rowspan="2" align="center">StackSize</td>
425<td align="center">Specify the stack size of the main thread (in bytes).</td>
426<td rowspan="2" align="center">Must be a multiple of 4096.</td>
427</tr>
428</tbody>
429</table>
430</div>
431
432<h4>AccessControlInfo</h4>
433<div class="table">
434<table border="1">
435<thead>
436<tr>
437<th align="center">Item Name</th>
438<th align="center">Description</th>
439<th align="center">Comment</th>
440</tr>
441</thead>
442<tbody>
443<tr>
444<td rowspan="2" align="center">Priority</td>
445<td align="center">Specifies the priority of the main thread.</td>
446<td rowspan="2" align="center">You can specify values between 0 and 31 (inclusive).</td>
447</tr>
448</tbody>
449</table>
450</div>
451
452<h4>Option</h4>
453<div class="table">
454<table border="1">
455<thead>
456<tr>
457<th align="center">Item Name</th>
458<th align="center">Description</th>
459<th align="center">Comment</th>
460</tr>
461</thead>
462<tbody>
463<tr>
464<td rowspan="2" align="center">EnableCompress</td>
465<td align="center">Specifies <CODE>TRUE</CODE> to enable static memory compression, or <CODE>FALSE</CODE> to disable. Memory is not compressed if doing so would not decrease the size. The compression rate is output to the file specified in the <SPAN class="argument">-info</SPAN> argument.</td>
466<td rowspan="2" align="center">If this argument is not specified, the default value of <CODE>TRUE</CODE> is used.</td>
467</tr>
468</tbody>
469</table>
470</div>
471
472<h3>Variables</h3>
473
474<p>
475Using the <CODE>-Dname=value</CODE> option allows you to pass variable names and their corresponding values to the <CODE>ctr_makerom</CODE> tool. The <CODE>ctr_makerom</CODE> tool replaces any occurrences of <CODE>$(name)</CODE> within the RSF file with the specified <CODE>value</CODE>, then evaluates the results. An example is shown below.
476</p>
477
478<p class="code">
479$ ctr_makerom32 test.axf -o test.cci -rsf test.rsf -DTITLE=Test -DROMFS_ROOT=files<br/> <br/> --- test.rsf<br/> BasicInfo:<br/>Title: $(TITLE)<br/> <br/> Rom:<br/>HostRoot: &quot;$(ROMFS_ROOT)&quot;<br/> <br/> --- Value at final evaluation<br/> BasicInfo:<br/>   Title: Test<br/> <br/> Rom:<br/>   HostRoot: &quot;files&quot;<br/>
480</p>
481
482<h2><a name="desc">DESC File</a></h2>
483<p>
484Edits to this file are prohibited. Editing this file may prevent your application from operating properly. Always use <CODE>CTR_SDK/resources/specfiles/Application.desc</CODE>.
485</p>
486<p>
487If you're using the build system, the option <CODE>-desc CTR_SDK/resources/specfiles/Application.desc</CODE> is specified automatically when you run <CODE>ctr_makerom</CODE>.
488</p>
489
490<h2><a name="titleid">Game Software Prototype Code</a></h2>
491<p>
492The following code has been assigned for software testing and prototyping purposes. Use this as an ID for internal testing. Be careful to avoid duplicate IDs within your company and development department.
493
494Note that running <CODE>ctr_makerom</CODE> will display a warning if you are using a <CODE>UniqueId</CODE> for prototype code.
495
496<p class="code">
497BasicInfo:<br/>  CompanyCode:&quot;00&quot;</br>   ProductCode:&quot;CTR-*-9@** (###)&quot;</br> <br/> TitleInfo:<br/>  UniqueId   :0xFF000 ~ 0xFF3FF</br> <br/>  * ... A-Z, 0-9<br/>  # ... A-Z<br/>  @ ... A-H<br/>
498</p>
499
500</p>
501
502
503<h2><a name="omake">Variables Defined within OMakefiles</a></h2>
504<p>
505Refer to <A href="../SDKRules/BuildRules.html#makeromvariable">Build Rules (<CODE>ctr_makerom</CODE>)</A> for more information about variables defined within the <CODE>OMakefile</CODE>.
506</p>
507
508</tbody>
509</table>
510</div>
511<h2><a name="history">Revision History</a></h2>
512    <dl class="history">
513      <dt>2010/09/24</dt>
514<dd>Changed the -cxi option to -content and included a description.<BR>
515<dd>Included a description of the -banner and -icon options.<BR>
516<dd>Included a description of Category and ChildIndex specifications for TitleInfo and the Logo specification for BasicInfo.<BR>
517        </dd>
518      <dt>2010/08/17</dt>
519<dd>Added &quot;Game Software Prototype Code&quot; section.
520        </dd>
521      <dt>2010/08/03</dt>
522<dd>Added description of <CODE>EnableCompress</CODE> and <CODE>MediaSize</CODE> options.
523        </dd>
524<dd>Deleted <CODE>InitialCode</CODE> option.
525        </dd>
526      <dt>2010/07/19</dt>
527<dd>Added description of <CODE>-info</CODE> option, <CODE>CompanyCode</CODE>, <CODE>ProductCode</CODE>, and <CODE>UniqueId</CODE>.
528        </dd>
529      <dt>2010/07/14</dt>
530<dd>Added description about CXI files.
531        </dd>
532      <dt>2009/12/22</dt>
533<dd>Initial version.<br />
534      </dd>
535    </dl>
536<hr><p>CONFIDENTIAL</p></body>
537</html>
538