4. Preparing to Build

This chapter explains how to create the files that you need to prepare before you build your application (separate from programming-related concerns).

The following files must be prepared before the application is built.

  • RSF file
  • BSF file
  • E-manual

4.1. RSF Files

An RSF file is a settings file required to create CCI files and CXI files with ctr_makerom.

For more information, see the reference for the ctr_makerom tool in the CTR-SDK documentation.

4.1.1. Required Settings

The following settings are required in order to create an application.

Table 4-1. Required Settings to Create an Application
Section Subsection Setting
TitleInfo Category

Specify the value that corresponds to your application's type below.

  • For card-based software: Application
  • For downloadable applications: Application (For downloadable demos: Demo)
  • For client programs: DlpChild
  • For add-on content: AddOnContents
    If you omit this setting, it is determined by the application type that is set by the DESC file when you build the application.
UniqueId

Specify the unique ID that was issued to you by Nintendo.

Although you can specify a testing code (0xFF0000xFF3FF) when you are testing and experimenting with your software, do not use the same ID for multiple applications.

You must specify the same unique ID for hosts and clients to support Download Play.

ChildIndex When you create a client program to be distributed through Download Play, specify its index here.
DemoIndex When you create a downloadable application demo version, specify its index (in the range from 1 to 255). For more information, see Nintendo 3DS Demo Version Creation Instructions – Download Format.
Variation When you create add-on content, specify its index (in the range from 0 to 255).
Rom HostRoot

Specify the directory that stores the files to include in your ROM.

The specified directory is stored in the ROM archive as its root directory, along with all of the files and directories under it.

Specify $(ROMFS_ROOT) to access the ROMFS_ROOT of the OMakefile.

Reject

Specify the files and directories to exclude from your ROM.

You can specify files with wildcard characters or regular expressions.

SaveDataSize

Specify the size of the save data area in nKB/nMB/nGB format.

Specify 0KB to omit a save data area.

CardInfo MediaType

When you create a card application, specify the game card type (Card1/Card2).

Specify Card2 for downloadable applications whose save data size exceeds 512 KB.

When omitted, the default is Card1.

Code 4-1. Sample RSF File (Required Settings)
TitleInfo: 
  Category:  Application
  UniqueId:  0xFF3FF
Rom: 
  HostRoot:  $(ROMFS_ROOT) 

4.1.2. Using Save Data

When your application uses save data, different items must be specified depending on the application type.

Note:

Applications cannot actually use the full size specified for the save data region, because a part of it is used as an internal buffer for the file system. For more information about how much of each save data region can actually be used, see the Worksheet for Calculating the Save Data File System Capacity in the CTR-SDK API Reference.

You can also call the nn::fs::GetArchiveFreeBytes() function to get the amount of free archive space while your application is running.

4.1.2.1. Card Applications Using Card1 as the Game Card Type

Use the following settings when using this game card type.

Table 4-2. Settings for Applications That Use Save Data (Card Applications Using Card1)
Section Subsection Setting
Rom SaveDataSize Specify 0KB, 128KB, or 512KB.
Code 4-2. Sample RSF File (Using Save Data With a Card1 Card Application)
Rom: 
  SaveDataSize:  512KB 

4.1.2.2. Downloadable Application

Use the following settings when using this game card type.

Table 4-3. Settings for Applications That Use Save Data (Downloadable Application)
Section Subsection Setting
Rom SaveDataSize

It differs depending on the MediaType specified.

Card1: Specify 0KB, 128KB, or 512KB.

Card2: Specify in the format of nMB or nGB.
Contact support@noa.com in advance if exceeding 50 MB.
In addition, we recommend a setting of up to 512 KB for dedicated sales of downloadable applications and up to 20 MB for dual distribution with card applications.

Code 4-3. Sample RSF File (Using Save Data With a Downloadable Application)
Rom: 
  SaveDataSize:  512KB 

4.1.2.3. Card Applications Using Card2 as the Game Card Type

Use the following settings when using this game card type.

Table 4-4. Settings for Applications That Use Save Data (Card Applications Using Card2)
Section Subsection Setting
Rom SaveDataSize

Specify in the nMB or nGB format.

This value must be entered only in units of 1 MB. In addition, the physical limit is half the value specified by BasicInfo / MediaSize.

Code 4-4. Sample RSF File (Using Save Data With a Card2 Card Application)
Rom: 
  SaveDataSize:  32MB 

4.1.2.4. Accessing the Save Data of Demo Versions

Use the following settings for applications that need to access save data created with a demo version.

Table 4-5. Settings When Accessing the Save Data of Demo Versions
Section Subsection Setting
AccessControlInfo UseOtherVariationSaveData

Specify true or false.

Specify true to mount the demo version save data with nn::fs::MountDemoSaveData.

If omitted, the default is false.

Note:

When specifying the AccessibleSaveDataIds value of AccessControlInfo, specifying true for UseOtherVariationSaveData is interpreted more broadly to allow access to application save data and extended save data, even if the application's unique ID is not included.

4.1.2.5. Accessing the Save Data of Other Applications

Use the following settings for applications that need to access the save data of other applications.

Table 4-6. Settings When Accessing the Save Data of Other Applications
Section Subsection Setting
AccessControlInfo AccessibleSaveDataIds

Specify the save data unique ID and the extended save data ID that you want to access in the list of unique IDs. You can specify a maximum of six.

You can access save data (including demo versions) with a unique ID that matches the specified ID and extended save data with an extended save data ID that matches the specified ID.

Using these settings results in a broader interpretation of UseOtherVariationSaveData. For more information, see 4.1.2.4. Accessing the Save Data of Demo Versions.

OtherUserSaveDataId1

OtherUserSaveDataId2

OtherUserSaveDataId3

You can specify up to three unique IDs for save data to access. For save data with the same unique ID as the application, specify true for UseOtherVariationSaveData to use this without having to include the save data unique ID in these settings.

These settings cannot be used when specifying AccessibleSaveDataIds.

4.1.3. Using Extended Save Data

Configure the following settings when your application uses extended save data.

Table 4-7. Settings for Applications That Use Extended Save Data
Section Subsection Setting
AccessControlInfo AccessibleSaveDataIds

Specify the save data unique ID and the extended save data ID that you want to access in the list of unique IDs. You can specify a maximum of six.

You can access save data (including demo versions) with a unique ID that matches the specified ID and extended save data with an extended save data ID that matches the specified ID.

If the application unique ID is included in these settings, you can access the extended save data regardless of the value specified for UseOtherVariationSaveData.

Using these settings results in a broader interpretation of UseOtherVariationSaveData. For more information, see 4.1.2.4. Accessing the Save Data of Demo Versions.

AccessControlInfo UseExtSaveData

Specify true.

These settings cannot be used when specifying AccessibleSaveDataIds.

ExtSaveDataNumber

You normally specify your application's unique ID.

If your application shares extended save data, specify the shared ID (the unique ID of the title with which data is shared).

For example, if your title is a sequel to another title with which it shares extended save data, specify the original title's unique ID.

These settings cannot be used when specifying AccessibleSaveDataIds.

Code 4-5. Sample RSF File (Extended Save Data)
AccessControlInfo: 
  AccessibleSaveDataIds: 
    - 0xFF3FF 

In the following cases, a new extended save data number is required that does not duplicate the unique ID of any application.

  • Multiple applications have their own extended save data, and you want to use separate extended save data for sharing.
  • A patch has been applied, and you want to add a new file to the extended save data, but the maximum number of files and directories that can be saved in the existing extended save data has been reached.
  • You want to use multiple extended save data items with a single application independent of other applications for some other reason.

Contact Nintendo support at support@noa.com if you want to acquire a new extended save data number for one of these cases.

Note:

If you specify AccessibleSaveDataIds of AccessControlInfo, the UseExtSaveData and ExtSaveDataNumber specifications cannot be used. In this case, they can be used by including the extended save data ID of the extended save data to be accessed in AccessibleSaveDataIds, or by specifying true in UseOtherVariationSaveData if that extended save data ID and the application unique ID match.

Warning:

The SD card can be accessed directly when the file system access attribute (FileSystemAccess in AccessControlInfo) is set to Debug. As a side effect, you can access data that cannot be accessed by a retail version, including save data and extended save data of other applications not specified in AccessibleSaveDataIds, save data from other applications not specified in OtherUserSaveDataID*, and extended save data not specified in ExtSaveDataNumber. Consequently, do not specify Debug while testing operations.

4.1.4. Settings for Creating a Master ROM to Submit

When creating a master ROM for submission, you must add the following settings or change the values that were specified when developing the application.

Table 4-8. Settings for Creating a Master ROM to Submit
Section Subsection Setting
BasicInfo Title

Specify the title of your application.

Specify $(TITLE) to access the TITLE of OMakefile.

ProductCode Specify the product code and downloadable content code issued to you by Nintendo.
MediaSize

Specify the media size.

If MediaType is Card1, specify a value of 128MB, 256MB, 512MB, 1GB, 2GB, or 4GB.

If MediaType is Card2, specify a value of 512MB, 1GB, or 2GB.

For downloadable applications, specify the value that would be required if it were a card-based application.

Logo

Specify the logo data type.

  • Nintendo titles: Nintendo
  • Titles for which Nintendo has acquired a publishing license: Distributed
  • Licensee titles: Licensed
TitleInfo UniqueId

Specify the unique ID that was issued to you by Nintendo.

If you were using a prototype code, check the value specified for ExtSaveDataNumber under AccessControlInfo.

Code 4-6. Sample RSF File (for Master ROM Submission)
BasicInfo: 
  Title:        $(TITLE)
  ProductCode:  "CTR-A-00001"
  MediaSize:    512MB
  Logo:         Licensed
TitleInfo: 
  UniqueId:     0x41001 

4.1.5. Remaster Version Settings

You must update the remaster version when you modify an application that has already been released.

You cannot update the remaster version in card-based software that has already been released, but you can update the version in downloadable applications that are being played by users.

Table 4-9. Remaster Version Settings
Section Subsection Content
SystemControlInfo RemasterVersion Specify the remaster version of the CXI file.
Code 4-7. Sample RSF File (Remaster Version)
SystemControlInfo: 
  RemasterVersion:  1 

This CXI remaster version is used unchanged as a downloadable application's version. A downloadable application's version is 1 if its CXI remaster version is 1. A downloadable application's version is incremented by one every time its CXI version is updated after the application has been released.

Save data is preserved when the version is updated. You must implement new versions of your downloadable application to appropriately handle save data from all previously released versions of the application. Handle this either by never changing the save data format, or by embedding the version number in the save data and automatically making any necessary data format changes when you upgrade.

Do not change the following RSF settings before and after you update your downloadable application's version.

Table 4-10. Settings That You Must Not Change When You Update a Downloadable Application's Version
Section Subsection Content
BasicInfo Title Application title
ProductCode Product code
TitleInfo UniqueId Unique ID
Rom SaveDataSize Size of the save data region

4.2. BSF Files

A BSF file is the settings file required to create ICN (icon data) and BNR (banner data) files with ctr_makebanner.

Use the BSF file to specify the icon file, model file, and sound file used to create both icon and banner data. You must create these files in advance.

Use CTPK files created by ctr_TexturePackager as the icon files to specify for LittleIconFile and BigIconFile.

Use a CBMD file created by ctr_BannerModelConverter as the model file to specify for ModelFile.

Use a BCWAV file created by ctr_WaveConverter as the sound file to specify for SoundFile.

A BSF file also has other application settings, such as the card region and title, which is displayed on the HOME Menu and elsewhere.

For more information, see the reference for the ctr_makebanner tool in the CTR-SDK documentation.

Note:

You do not need to prepare a model file and sound file for a client program, which does not require a BNR file.

Code 4-8. Sample BSF File
LittleIconFile:   resources/little.ctpk
BigIconFile:      resources/big.ctpk
ModelFile:        resources/model.cbmd
SoundFile:        resources/sound.bcwav

Region:           Japan
Ulcd:             True
AutoSave:         False
SaveData:         True
ThumbnailFrame:   0

RatingRequired:   True
CERO:             12

JPLongName:       Test application
JPShortName:      Test application
JPPublisher:      Test

ENLongName:       TestApplication
ENShortName:      TestApplication
ENPublisher:      Test 

4.3. E-Manuals

Use CTR-ManualTools to create e-manual files. Note that an e-manual included in an application must have the filename Manual.bcma.

The size of the e-manual’s binary file (BCMA file) is a maximum of 6656 KB per language.

For more information, see the CTR-ManualTools documentation.