ctr_makerom

Table of Contents

  1. Introduction
  2. Using the Tool
  3. RSF File
  4. DESC File
  5. Game Software Prototype Code
  6. Variables Defined Within OMakefiles
  7. Revision History

Introduction

This ctr_makerom tool is for creating CCI (CTR Card Image) files. CCI files are created based on the content in RSF files.

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.

Using the Tool

What's Required

You will need the following to create a CCI file:

RSF 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.

Commands

% 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]

You must specify the ELF, RSF, and DESC files. All other options are optional.

Options

Options Description
-rsf Specifies the RSF file.
-desc Specifies the DESC file.
-banner Specifies the banner file.
-icon Specifies the icon file.
-content CONTENTS_PATH:INDEX Specifies content (.cfa) included in the CCI.
Specify the contents file path in CONTENTS_PATH.
Specify the partition number including the content in INDEX.
The values specifiable for INDEX vary depending on the following conditions.
When an ELF_FILE is specified The value 1 through 7 can be specified for INDEX.
When an ELF_FILE is not specified The value 0 through 7 can be specified for INDEX.
-o 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.
-Dname=value Specifies the variable name (name) and value (value) from the RSF file to reference. References to $(name) in the RSF file are replaced with the value command line argument and then evaluated.
-f FORMAT Specifies the format of the image to output. The following values can be specified for FORMAT.
card Outputs in .cci format. Specify this option when creating a standard card application.
nand Outputs in .cxi format. Specify this option when building a NAND application.
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.
data Output is made in .cfa format. The generated .cfa file can be made to include a separate CCI by using the -content option.
If no format is specified, the default value of nand is used.
-info Specifies the output file for information about the output image. If unspecified, the output filename will have the .xml filename extension. This file contains information about the application title and ROMFS.
-j NUM Specifies the number of makerom parallel processes. However, only some processes can be performed in parallel.
When it is not specified, the CPU core count for the execution environment is acquired, and that value is used.

RSF File

This is a file that contains the settings for the CCI file to be generated.

Format

The RSF file format is shown below.

BasicInfo:
  Title:           # Application title
  CompanyCode:     # Company code
  ProductCode:     # Product code
  MediaSize:       # Media size
  Logo:            # Logo data specification
  BackupMemoryType:  # Backup memory type

TitleInfo:
  Category:          # Title category
  UniqueId:          # Unique ID of the title code
  ChildIndex:        # DLP child device index

Rom:
  HostRoot:          # Path that is the root of the ROM file system
  Reject:            # Specifies file and directory names to be excluded from the ROM file system

AccessControlInfo:
  Priority:          # Priority of the main thread
  UseExtSaveData:    # Use of the extended save data
  ExtSaveDataNumber: # Extended save data number

SystemControlInfo:
  StackSize:         # Stack size of the main thread

Option:
  EnableCompress:    # Enables/disables compression of the static region

Configure the values of the items under the six main sections (BasicInfo, TitleInfo, Rom, AccessControlInfo, SystemControlInfo, and Option).
Set the values using the following format:

Specifying Single Values

Key Name: Value

Specifying Multiple Values

Key Name:
  - Value 1
  - Value 2
  ...

Notes

The following are sample settings for each of these items.

BasicInfo

Item Description Comments
Title The title of the application. Specifies the application title in eight or fewer ASCII characters.
CompanyCode The company code. Company code that was assigned when the licensing agreement was signed with Nintendo. Two ASCII characters.
ProductCode Product code. Specifies the product code issued by Nintendo.
MediaSize Specifies the media size. Specify a value of 125 MB, 256 MB, 512 MB, 1 GB, or 2 GB.
Logo Specifies the type of logo data. Specify "Nintendo" for Nintendo titles,
"Published" for titles for which Nintendo purchased retail licenses from the software manufacturer or titles for which Nintendo sells after receiving retail license consignment,
and "Licensed" for all other titles.
BackupMemoryType Specify the backup memory type. This is ignored for download applications.
Specify None, 128 KB, or 512 KB.

TitleInfo

Item Description Comments
Category Specifies the application type.
Application Specify this when building a typical application.
DlpChild Specify this when building a download play child.
This must be specified along with ChildIndex (described later).
Application is selected if not specified.
UniqueId The application's unique ID. Specifies the ID issued by Nintendo. Valid values are from 0x00300 to 0xf7fff.
ChildIndex Specifies the download play child index.

Rom

Item Description Comments
HostRoot The root path of the ROM file system.
Specify either an absolute path or a relative path from the directory that is the current directory when executing ctr_makerom. 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 (".") will not be stored in the ROM file system, nor will any files or directories specified under the Reject item.
Reject Specify the names of files and directories to exclude from the ROM file system.
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 "*" and "?" wildcards ("*" matches 0 or more characters, and "?" matches a single character).
Use the syntax described in the Specifying Multiple Values section.

SystemControlInfo

Item Description Comments
StackSize Specify the stack size of the main thread (in bytes). Must be a multiple of 4096.

AccessControlInfo

Item Description Comments
Priority Specifies the priority of the main thread. You can specify values between 0 and 31 (inclusive).
UseExtSaveData Specify TRUE when using extended save data. The default value is false.
ExtSaveDataNumber Specify the extended save data number using 20 bits. The default is the UniqueId.

Option

Item Description Comments
EnableCompress Specify TRUE to enable static memory compression or FALSE 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 -info argument. If this argument is not specified, the default value of TRUE is used.

Variables

Using the -Dname=value option allows you to pass variable names and their corresponding values to the ctr_makerom tool. The ctr_makerom tool replaces any occurrences of $(name) within the RSF file with the specified value, then evaluates the results. An example is shown below.

$ ctr_makerom32 test.axf -o test.cci -rsf test.rsf -DTITLE=Test -DROMFS_ROOT=files

--- test.rsf
BasicInfo:
Title: $(TITLE)

Rom:
HostRoot: "$(ROMFS_ROOT)"

--- Value at final evaluation
BasicInfo:
  Title: Test

Rom:
  HostRoot: "files"

DESC File

Edits to this file are prohibited. Editing this file may prevent your application from operating properly. Always use CTR_SDK/resources/specfiles/Application.desc.

If you're using the build system, the option -desc CTR_SDK/resources/specfiles/Application.desc is specified automatically when you run ctr_makerom.

Game Software Prototype Code

The 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. Note that running ctr_makerom displays a warning if you are using UniqueId for the prototype code.

BasicInfo:
  CompanyCode:"00"
  ProductCode:"CTR-*-9@** (###)"

TitleInfo:
  UniqueId   :0xFF000 ~ 0xFF3FF

 * ... A-Z, 0-9
 # ... A-Z
 @ ... A-H

Variables Defined Within OMakefiles

Refer to Build Rules (ctr_makerom) for more information about variables defined within the OMakefile.

Revision History

2010/10/29
Added to the description of the extended save data and backup memory specifications
2010/10/26
Added to the description of log data
Changed the specifiable range for UniqueId to 0x300
2010/10/07
Added the -j option
2010/09/24
Changed the -cxi option to -content and included a description.
Included a description of the -banner and -icon options.
Included a description of Category and ChildIndex specifications for TitleInfo and the Logo specification for BasicInfo.
2010/08/17
Added the "Game Software Prototype Code" section.
2010/08/03
Added descriptions of the EnableCompress and MediaSize options.
Deleted InitialCode option.
2010/07/19
Added description of -info option, CompanyCode, ProductCode, and UniqueId.
2010/07/14
Added description about CXI files.
2009/12/22
Initial version.

CONFIDENTIAL