SaveDataFiler

Table of Contents

Overview

The SaveDataFiler tool provides features to view, import, and export the following types of save data.

How to Use

The SaveDataFiler binary is in the following location in the CTR-SDK.
$HORIZON_ROOT/tools/TargetTools/CTR-TS/Release/SaveDataFiler.cia
Copy the above binary to an SD Card, and import it from DevMenu to the system's NAND memory. After that, it can be launched from the HOME Menu.(It can also be launched from DevMenu.)

Button Assignments

The method of operations are as explained below.
The buttons that can be used vary by each screen. When the tool runs, use the guide displayed on the upper screen as a reference for operations.
ButtonOperation
↑↓Move the cursor within the list
←→Change tab
ASelect / Run
BCancel
XDelete the selected item
YWrite the save data to the SD Card (Note: See Writing to SD Cards)
R+YDestroy the selected files (Note: See Destroying Files)
L+R+STARTInitializes shared expanded save data.※「See Initializing shared expanded save data.

Writing to SD Cards

You can use SaveDataFiler to write save data and expanded save data to SD Cards.
The written data is saved to SD Cards in the following location.
sdmc:/filer/
        +--- UserSaveData/
        |       +--- <The date and time saved>/
        |                +--- 00000000/          ←Data is saved below here(※)
        |                +--- 00000000.dat       ←File containing format parameters
        +--- ExtData/
                +--- <The date and time saved>/
                         +--- <expanded save data number>/      ←Data is saved below here
                         +--- <expanded save data number>.dat   ←File containing format parameters

Data saved in the above location can be restored from the SD Tab.

Note: In the case of data for download applications, the directory name is the application's unique ID.

Destroying Files

The goal of destroying files is to put them in a state where the nn::fs::ResultVerificationFailed error is returned when they are loaded using functions from the FS library. You can use this to test error processing for files that are damaged when a card is removed during a write or a when a file is illegally spoofed.

Note: In the case of save data, the file destruction does not take place if using automatic redundancy. During development, be sure to test save data in the non-redundant state.
However, the process performed by SaveDataFiler only attempts to reproduce a destroyed state in accordance with the specification: "The nn::fs::ResultVerificationFailed error is sometimes returned if a Read is performed on a region that has never been written to." Consequently, sometimes the file is not destroyed. If destruction is successful, an error is displayed on the file list.(「See the User Tab)
If destruction fails, the DESCRIPTION_CANCEL_REQUESTED error dialog will display. If this happens, try to destroy the file again.

Upper Screen

This is a description of the content of the upper screen.
Revision     : 34302  --- (1)

File Type    : file  --- (2)
  | LimitSize | LimitDir | LimitFile | Dup |  --- (3)
  |    ---    |       16 |        16 |  ON |
Level  : -5
Summary: 8
Module : 17
Desc   : 392  --- (4)

File Size    : 1024 bytes  --- (5)

X: delete this file  --- (6)
R+Y: destroy this file
       :

NumberDescription
(1)Revision number for the SaveDataFiler.
(2)Indicates the type of item selected in the lower screen.
(3)When the item selected on the lower screen is an archive, the format parameters of that archive are displayed.
Their meanings are as follows.
LimitSize(not used at present)
LimitDirthe maximum number of directories that can be created
LimitFilethe maximum number of files that can be created
Dupwhether there is duplication
This is not displayed on the SD Tab.
(4)When an error occurs during an archive mount or during an operation on an item selected from the lower screen, its Result value is displayed.
To learn more about the content of errors, see the Description List for the fs library.
(5)When the item selected in the lower screen is a file, its size is displayed.
(6)The operations guide is displayed.

User Tab

This tab is for manipulating save data.

List Display Mode

When this tab is selected, a list showing the CTR Card and download applications appears.
In addition to "CTR Card," this list shows the unique IDs of the download applications imported to the SD Card.
CTR Card
F7FFF
FFFFF
   :
If an archive is corrupted, the corresponding Result value appears on the upper screen when it is mounted.

Filer Mode

When an item is selected from the list, the content of its save data is displayed on the lower screen.
../
Dir1/
Dir2/
File1
File2 : Read Error (0-512)
File3
  :
When an error occurs during file operations, such as a damaged file, the filename is displayed in red. To display the corresponding Result value on the upper screen, align the cursor with the filename. The function that was invoked when the error occurred will also be displayed next to the filename.
DisplayDescription
Open ErrorAn error was returned from nn::fs::FileStream::TryInitialize. There was a failure in opening the file.
Read ErrorAn error was returned from nn::fs::FileStream::TryRead. There was a failure when reading the file.
At the same time, the byte at which the read error occurred is also displayed. (SaveDataFiler reads in units of 1MB, so the actual region where the error occurs may be smaller than this.)
Size ErrorAn error was returned from nn::fs::FileStream::TryGetSize. There was a failure in getting the file size (metadata).

ExtData Tab

This tab is for manipulating the expanded save data on the SD Card.

List Display Mode

When this tab is selected, the expanded save data on the SD Card is displayed in a list. The displayed numbers are the expanded save data numbers.
00000001
00000002  -- broken --
00000003
   :
When an archive is damaged (when the nn::fs::MountExtSaveData function returns an error), the number is displayed in red. When the cursor is aligned above the filename, the result value is displayed in the upper screen.

Filer Mode

When an archive is selected from the list, the content of the expanded save data are displayed. The displayed content is the same as for the User Tab.

SD Tab

This tab is for manipulating the data written to SD Cards.

The data on the SD Card is displayed in a list.
user  : 20110101000000 : 00000000
user  :20110101121530 : 000f7fff
ext   : 20110101000000 : 00000001
ext   : 20110102141516 : 00000002
  :           :              :
 (1)         (2)            (3)
NumberDescription
(1)Indicates the save data type.
UserSave Data
extExpanded Save Data
(2)This is the directory name (the date and time saved) on the SD Card.
(3)The meaning of this item depends on the save data type.
UserFor download application data, it is the unique ID;
for card application data, 0 is displayed.
extDisplays the expanded save data number.
Select from the list and press the A Button to import the data. When this happens, the save data in the application or the expanded save data on the SD Card is formatted (deleted).

Initializing Shared Expanded Save Data

You can delete the shared expanded save data in system NAND memory by pressing L + R + START. (Press the START Button while holding down the L and R Buttons.)
If you return to the HOME Menu with the shared expanded save data deleted, the system will not operate correctly. After using this feature, you must restart the system. The data will be rebuilt when the HOME Menu or TestMenu (development menu) launches. (Startup will take a little longer than usual.)

Revision History

2011/04/21
Added a note about file destruction.
2011/03/23
Added support for save data in download applications.
2011/03/19
Added feature to initialize shared expanded save data.
2011/02/18
Initial version.

CONFIDENTIAL