The ctr_makerom tool is for creating CCI (CTR Card Image) files.
CCI files are created based on the content in RSF files.
Use the -f option to generate a CXI (CTR eXecutable Image) file and a CFA (CTR File Archive) file.
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.
% 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]
Creates files in CXI, CFA, and CCI format. You must specify ELF_FILE, -rsf, -desc.
% ctr_makerom32 ELF_FILE -rsf RSF_FILE -desc DESC_FILE -f le -lr LR_FILE -m 0x01000000 -o OUTPUT_FILE [-Dname=value...] [-info INFO_FILE] [-banner BANNER_FILE] [-icon ICON_FILE] [-j NUM]
Creates files in LE format. You must specify ELF_FILE, -rsf, -desc, -f, -lr, -m, -o.
% ctr_makerom32 -rsf RSF_FILE -f lr -o OUTPUT_FILE [-Dname=value...] [-info INFO_FILE] [-j NUM]
Creates files in LR format. You must specify -rsf, -f, -o.
% ctr_makerom32 -f list -le LE_FILE -lr LR_FILE -o OUTPUT_FILE
Creates files in CCL format. You much specify all options.
| Options | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-rsf |
Specifies the RSF file. | ||||||||||||
-desc |
Specifies the DESC file. | ||||||||||||
-banner |
Specifies the banner file. | ||||||||||||
-icon |
Specifies the icon file. Unless you specify an icon file with this option, you cannot get the EULA version from the application. |
||||||||||||
-content CONTENTS_PATH:INDEX |
Specifies content (CFA files) included in the CCI file. Specify the content file path in CONTENTS_PATH.INDEX specifies the index number that contains this content. There is a predetermined INDEX to specify for each type of content. Refer to the documentation corresponding to each type of content.
|
||||||||||||
-o |
Specifies the output filename. If this option is omitted, the output is written to a file whose filename consists of the input ELF filename with its extension replaced by CCI, CXI, or CFA. The extension is determined by the format specified in the -f option. |
||||||||||||
-Dname=value |
Specifies the variable name (name) and value (value) to reference in the RSF file. Locations where $(name) is written 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.
exec is specified. |
||||||||||||
-info |
Specifies the output file to which to output 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 used. |
||||||||||||
-le LE_FILE |
Specifies the file path for an LE-format file created in format 2. | ||||||||||||
-lr LR_FILE |
Specifies the file path for an LR-format file created in format 3. | ||||||||||||
-m 0x01000000 |
Required for format 2. Always specify 0x01000000. |
This is a file that contains the settings for the CCI file.
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 for title code
ChildIndex: # DLP child index
Rom:
HostRoot: # Root path of the ROM file system
Reject: # File and directory names to exclude from the ROM file system
SaveDataSize: # Size of the save data
CardInfo:
CardDevice: # Sets either NorFlash or None
AccessControlInfo:
Priority: # Main thread priority.
UseExtSaveData: # Whether to use expanded save data.
ExtSaveDataNumber: # Expanded save data number.
FileSystemAccess: # File system access permissions.
SystemControlInfo:
StackSize: # Stack size of main thread.
RemasterVersion: # The remaster version
Option:
EnableCompress: # Enables/disables compression of static memory
Configure the values of the items under the seven main sections (BasicInfo, TitleInfo, Rom, AccessControlInfo, SystemControlInfo, and Option).
Set the values using the following format:
Key Name: Value
Key Name:
- Value 1
- Value 2
...
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, "Distributed" for titles for which Nintendo purchased the publishing license from the software manufacturer or titles for which Nintendo acquired the publishing license from a publisher, and "Licensed" for all other titles. If omitted, "Nintendo" is used as the default value.The value " Published" was valid in previous versions, but it has been replaced by "Distributed". If you specify "Published", it is handled as "Distributed". In future releases it will not be possible to specify "Published".
|
BackupMemoryType |
Specify the backup memory type. This is ignored for download applications. Specify None, 128 KB, or 512 KB. |
If the value specified here differs from the size of the backup memory that is actually used, then the backup memory size takes precedence. See the page on the nn::fs::FormatSaveData function in the Function Reference for details.
|
TitleInfo| Item | Description | Note | ||||
|---|---|---|---|---|---|---|
Category |
Specifies the application type.
|
When unspecified, a value corresponding to DESC is automatically selected. |
||||
UniqueId |
The application's unique ID. Specifies the ID issued by Nintendo. Specifies the same ID as the parent device for Download Play child devices. |
Valid values are from 0x00300 to 0xf7fff. | ||||
ChildIndex |
Specifies the Download Play child index. | You can specify values from 0 through 255. |
Rom| Item | Description | Note |
|---|---|---|
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 period (".") 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. Specifications can use the " *" and "?" wildcards ("*" matches 0 or more characters, and "?" matches a single character) or the .NET Framework regular expressions. When specifying paths, specify absolute paths from the root directory specified by HostRoot.The only character that can be used as a path delimiter is the ' /' character.When specifying wildcards, denote paths that begin with ' /'.
Example: When specifying regular expressions, start the notatation pattern with ' >'.
Example: When the first character is other than ' /' or '>', it is treated as a wildcard specification. Although operation specifications of this type were supported up to CTR-SDK 1.0, their use is not recommended.For example, if the filename matches, it is excluded regardless of the directory it is in. |
Use the syntax described in the Specifying Multiple Values section. |
Specifies the size of the save data of the download application. Specify a value in the format nKB or nK, where n is 0, 128, or 512 only. The value specified in BackupMemoryType cannot be exceeded.Note: The actual size that is used will be smaller than the size specified here. |
CardInfo| Item | Description | Note |
|---|---|---|
CardDevice |
When None is specified for BasicInfo or BackupMemoryType, None is specified for this item. When 128KB or 512KB is specified for BasicInfo or BackupMemoryType, NorFlash is specified for this item.
|
When unspecified, it is handled as if NorFlash had been specified. |
SystemControlInfo| Item | Description | Note |
|---|---|---|
StackSize |
Specify the stack size of the main thread (in bytes). | Must be a multiple of 4096. |
| RemasterVersion | Specifies the remaster version. If unspecified, the version is treated as if 0 had been specified. |
AccessControlInfo| Item | Description | Note |
|---|---|---|
Priority |
Specifies the priority of the main thread. | You can specify values between 0 and 31 (inclusive). |
UseExtSaveData |
Specify true when using expanded save data. |
The default value is false. |
ExtSaveDataNumber |
Specify the expanded save data number using 20 bits. | The default is the UniqueId. |
FileSystemAccess |
Specifies the file system access permission attributes. Specify from the following values:
|
Use the syntax described in the Specifying Multiple Values section. |
| Item | Description | Note |
|---|---|---|
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. |
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 files are placed in the CTR_SDK/resources/specfiles folder. Use the appropriate DESC file depending on the type of application you are creating.
| Application Type | DESC File | Note |
|---|---|---|
| General applications | Application.desc |
|
| Download Play child | DlpChild.desc |
When you use the build system, the option -desc CTR_SDK/resources/specfiles/Application.desc is specified automatically when you run ctr_makerom.
You can also specify within the OMakefile what DESC file to use. For details, see the Build Rules.
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 if you use this code for prototyping it will be handled as an error by Master Editor.
BasicInfo:
CompanyCode:"00" ProductCode: "CTR-*-****"
TitleInfo:
UniqueId : 0xFF000 ~ 0xFF3FF
* ... A-Z, 0-9
ProductCode used the format below, but this format is no longer usable in subsequent versions.(###)" portion removed.
ProductCode: "CTR-*-**** (###)"
Refer to Build Rules (ctr_makerom) for more information about variables defined within the OMakefile.
SaveDataSize.BackupMemoryType.CardDevice.Reject.ChildIndex.UniqueId.-icon option.UniqueId to 0x300.-j option.-cxi option to -content and included a description.-banner and -icon options.Category and ChildIndex specifications for TitleInfo and the logo specification for BasicInfo.EnableCompress and MediaSize options.
InitialCode option.
-info option, CompanyCode, ProductCode, and UniqueId.
CONFIDENTIAL