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> <!-- ※注意事項 --> <!--  ・(任意)となっているものは、記載が無くても問題ありません。 --> <!--  ・各項目についてる(必須)や(任意)は、作成後に削除してください。 --> <!--  ・各項目内の書き方は、パッケージごとに自由で問題ありませんが、同じパッケージ内で違いがでないようにしてください。 --> <!--  ・タグはすべて小文字、終了タグを持たないものは「/>」で閉じてください。--> <!--  ・HTMLコードのインデントは、各種社内コード規約と同様にスペース4文字か4文字幅のタブになるようにしてください-->
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">Using the Tool</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">Using the Tool</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>Commands</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] [-content CONTENTS_PATH:INDEX] [-j NUM]
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 <CODE>CONTENTS_PATH</CODE>.<BR>Specify the partition number including the content in <CODE>INDEX</CODE>.<BR>The values specifiable for <CODE>INDEX</CODE> vary depending on the following conditions.
211<table border="1">
212<tr>
213<td>When an <CODE>ELF_FILE</CODE> is specified</td>
214<td>The value 1 through 7 can be specified for <CODE>INDEX</CODE>.</td>
215</tr>
216<tr>
217<td>When an <CODE>ELF_FILE</CODE> is not specified</td>
218<td>The value 0 through 7 can be specified for <CODE>INDEX</CODE>.</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 <CODE>FORMAT</CODE>.
235<table border="1">
236<tr>
237<td>card</td>
238<td>Outputs in .cci format. Specify this option when creating a standard 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 <CODE>ctr_makecia</CODE> 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 <CODE>-content</CODE> 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<tr>
260<td align="center">-j NUM</td>
261<td align="center">Specifies the number of makerom parallel processes. However, only some processes can be performed in parallel.<br/>When it is not specified, the CPU core count for the execution environment is acquired, and that value is used.
262</td>
263</td>
264</tr>
265</tbody>
266</table>
267</div>
268
269<h2><a name="rsf">RSF File</a></h2>
270
271<p>This is a file that contains the settings for the CCI file to be generated.</p>
272
273<h3>Format</h3>
274
275<p>The RSF file format is shown below.</p>
276
277<p class="code">
278BasicInfo:<br/>  Title:           # Application title<br/>   CompanyCode:     # Company code<br/>   ProductCode:     # Product code<br/>   MediaSize:       # Media size<br/>   Logo:            # Logo data specification<br/>
279   BackupMemoryType:  # Backup memory type<br/>
280</br> TitleInfo: <br/>   Category:          # Title category<br/>   UniqueId:          # Unique ID of the title code<br/>   ChildIndex:        # DLP child device index<br/> <br/> Rom:<br/>  HostRoot:          # Path that is the root of the ROM file system<br/>   Reject:            # Specifies file and directory names to be excluded from the ROM file system<br/> <br/> AccessControlInfo:<br/>  Priority:          # Priority of the main thread<br/>   UseExtSaveData:    # Use of the extended save data<br/>   ExtSaveDataNumber: # Extended save data number<br/> <br/> SystemControlInfo:<br/>  StackSize:         # Stack size of the main thread<br/> <br/> Option:<br/>  EnableCompress:    # Enables/disables compression of the static region<br/>
281
282</p>
283
284<p>
285Configure the values of the items under the six main sections (<CODE>BasicInfo</CODE>, <CODE>TitleInfo</CODE>, <CODE>Rom</CODE>, <CODE>AccessControlInfo</CODE>, <CODE>SystemControlInfo</CODE>, and <CODE>Option</CODE>).<br/>Set the values using the following format:
286
287<h3>Specifying Single Values</h3>
288<p class="code">
289Key Name: Value
290</p>
291
292<h3><a name="sequence_element" />Specifying Multiple Values</h3>
293<p class="code">
294Key Name:<br/>  - Value 1<br/>   - Value 2<br/>   ...<br/>
295</p>
296
297</p>
298
299<h4>Notes</h4>
300<ul>
301<li>Tabs cannot be used in place of half-width spaces.</li>
302<li>You must use at least one half-width space after the colons and hyphens that separate the key names from the values.</li>
303<li>The indentation before all items within each main section is required. Use half-width spaces for this indentation.</li>
304<li>Main sections must appear at the start of a line.</li>
305<li>Each item within a given main section must be indented by the same number of spaces.</li>
306</ul>
307
308The following are sample settings for each of these items.
309
310<h4>BasicInfo</h4>
311<div class="table">
312<table border="1">
313<thead>
314<tr>
315<th align="center">Item</th>
316<th align="center">Description</th>
317<th align="center">Comments</th>
318</tr>
319</thead>
320<tbody>
321<tr>
322<td align="center">Title</td>
323<td align="center">The title of the application. Specifies the application title in eight or fewer ASCII characters.</td>
324<td align="center"></td>
325</tr>
326<tr>
327<td align="center">CompanyCode</td>
328<td align="center">The company code. Company code that was assigned when the licensing agreement was signed with Nintendo. Two ASCII characters.</td>
329<td align="center"></td>
330</tr>
331<tr>
332<td align="center">ProductCode</td>
333<td align="center">Product code. Specifies the product code issued by Nintendo.</td>
334<td align="center"></td>
335</tr>
336<tr>
337<td align="center">MediaSize</td>
338<td align="center">Specifies the media size. Specify a value of 125 MB, 256 MB, 512 MB, 1 GB, or 2 GB.</td>
339<td align="center"></td>
340</tr>
341<tr>
342<td align="center">Logo</td>
343<td align="center">Specifies the type of logo data.</td>
344<td align="center">Specify &quot;Nintendo&quot; for Nintendo titles, <br/>&quot;Published&quot; for titles for which Nintendo purchased retail licenses from the software manufacturer or titles for which Nintendo sells after receiving retail license consignment,<br/>and &quot;Licensed&quot; for all other titles.</td>
345</tr>
346<tr>
347<td align="center">BackupMemoryType</td>
348<td align="center">
349Specify the backup memory type. This is ignored for download applications.<br/>Specify None, 128 KB, or 512 KB.
350</td>
351<td align="center">
352</tr>
353</tbody>
354</table>
355</div>
356
357<h4>TitleInfo</h4>
358<div class="table">
359<table border="1">
360<thead>
361<tr>
362<th align="center">Item</th>
363<th align="center">Description</th>
364<th align="center">Comments</th>
365</tr>
366</thead>
367<tbody>
368<tr>
369<td align="center">Category</td>
370<td align="center">Specifies the application type.<br/>
371<table border="1">
372<tr>
373<td>Application</td>
374<td>Specify this when building a typical application.</td>
375</tr>
376<tr>
377<td>DlpChild</td>
378<td>Specify this when building a download play child.<br/>This must be specified along with <CODE>ChildIndex</CODE> (described later).</td>
379</tr>
380</table>
381</td>
382<td align="center"><CODE>Application</CODE> is selected if not specified.</td>
383</tr>
384<tr>
385<td align="center">UniqueId</td>
386<td align="center">The application's unique ID. Specifies the ID issued by Nintendo.</td>
387<td align="center">Valid values are from 0x00300 to 0xf7fff.</td>
388</tr>
389<tr>
390<td align="center">ChildIndex</td>
391<td align="center">Specifies the download play child index.</td>
392<td></td>
393</tr>
394</tbody>
395</table>
396</div>
397
398
399
400<h4>Rom</h4>
401<div class="table">
402<table border="1">
403<thead>
404<tr>
405<th align="center">Item</th>
406<th align="center">Description</th>
407<th align="center">Comments</th>
408</tr>
409</thead>
410<tbody>
411<tr>
412<td align="center">HostRoot</td>
413<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>
414<td align="center"></td>
415</tr>
416<tr>
417<td align="center">Reject</td>
418<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>
419<td align="center">Use the syntax described in the <a href="#sequence_element">Specifying Multiple Values</a> section.</td>
420</tr>
421</tbody>
422</table>
423</div>
424
425<h4>SystemControlInfo</h4>
426<div class="table">
427<table border="1">
428<thead>
429<tr>
430<th align="center">Item</th>
431<th align="center">Description</th>
432<th align="center">Comments</th>
433</tr>
434</thead>
435<tbody>
436<tr>
437<td rowspan="2" align="center">StackSize</td>
438<td align="center">Specify the stack size of the main thread (in bytes).</td>
439<td rowspan="2" align="center">Must be a multiple of 4096.</td>
440</tr>
441</tbody>
442</table>
443</div>
444
445<h4>AccessControlInfo</h4>
446<div class="table">
447<table border="1">
448<thead>
449<tr>
450<th align="center">Item</th>
451<th align="center">Description</th>
452<th align="center">Comments</th>
453</tr>
454</thead>
455<tbody>
456<tr>
457<td rowspan="2" align="center">Priority</td>
458<td align="center">Specifies the priority of the main thread.</td>
459<td rowspan="2" align="center">You can specify values between 0 and 31 (inclusive).</td>
460</tr>
461</tbody>
462<tbody>
463<tr>
464<td rowspan="2" align="center">UseExtSaveData</td>
465<td align="center">Specify <CODE>TRUE</CODE> when using extended save data.</td>
466<td rowspan="2" align="center">The default value is <CODE>false</CODE>.</td>
467</tr>
468</tbody>
469<tbody>
470<tr>
471<td rowspan="2" align="center">ExtSaveDataNumber</td>
472<td align="center">Specify the extended save data number using 20 bits.</td>
473<td rowspan="2" align="center">The default is the UniqueId.</td>
474</tr>
475</tbody>
476</table>
477</div>
478
479<h4>Option</h4>
480<div class="table">
481<table border="1">
482<thead>
483<tr>
484<th align="center">Item</th>
485<th align="center">Description</th>
486<th align="center">Comments</th>
487</tr>
488</thead>
489<tbody>
490<tr>
491<td rowspan="2" align="center">EnableCompress</td>
492<td align="center">Specify <CODE>TRUE</CODE> to enable static memory compression or <CODE>FALSE</CODE> to disable it. Memory is not compressed if doing so does not decrease the size. The compression rate is output to the file specified in the <SPAN class="argument">-info</SPAN> argument.</td>
493<td rowspan="2" align="center">If this argument is not specified, the default value of <CODE>TRUE</CODE> is used.</td>
494</tr>
495</tbody>
496</table>
497</div>
498
499<h3>Variables</h3>
500
501<p>
502Using 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.
503</p>
504
505<p class="code">
506$ 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/>
507</p>
508
509<h2><a name="desc">DESC File</a></h2>
510<p>
511Edits 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>.
512</p>
513<p>
514If 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>.
515</p>
516
517<h2><a name="titleid">Game Software Prototype Code</a></h2>
518<p>
519The 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.
520
521Note that running <CODE>ctr_makerom</CODE> displays a warning if you are using <CODE>UniqueId</CODE> for the prototype code.
522
523<p class="code">
524BasicInfo:<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/>
525</p>
526
527</p>
528
529
530<h2><a name="omake">Variables Defined Within OMakefiles</a></h2>
531<p>
532Refer 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>.
533</p>
534
535</tbody>
536</table>
537</div>
538<h2><a name="history">Revision History</a></h2>
539    <dl class="history">
540      <dt>2010/10/29</dt>
541<dd>Added to the description of the extended save data and backup memory specifications<br />
542        </dd>
543      <dt>2010/10/26</dt>
544<dd>Added to the description of log data<br />
545        </dd>
546<dd>Changed the specifiable range for UniqueId to 0x300<br />
547        </dd>
548      <dt>2010/10/07</dt>
549<dd>Added the -j option<br />
550        </dd>
551      <dt>2010/09/24</dt>
552<dd>Changed the -cxi option to -content and included a description.<BR>
553<dd>Included a description of the -banner and -icon options.<BR>
554<dd>Included a description of Category and ChildIndex specifications for TitleInfo and the Logo specification for BasicInfo.<BR>
555        </dd>
556      <dt>2010/08/17</dt>
557<dd>Added the &quot;Game Software Prototype Code&quot; section.
558        </dd>
559      <dt>2010/08/03</dt>
560<dd>Added descriptions of the <CODE>EnableCompress</CODE> and <CODE>MediaSize</CODE> options.
561        </dd>
562<dd>Deleted <CODE>InitialCode</CODE> option.
563        </dd>
564      <dt>2010/07/19</dt>
565<dd>Added description of <CODE>-info</CODE> option, <CODE>CompanyCode</CODE>, <CODE>ProductCode</CODE>, and <CODE>UniqueId</CODE>.
566        </dd>
567      <dt>2010/07/14</dt>
568<dd>Added description about CXI files.
569        </dd>
570      <dt>2009/12/22</dt>
571<dd>Initial version.<br />
572      </dd>
573    </dl>
574<hr><p>CONFIDENTIAL</p></body>
575</html>
576