1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../css/manpage.css" type="text/css" />
7    <style type="text/css"><!--
8      span.static_style
9      {
10        font-size			: 8pt;
11        color				: white;
12        font-weight			: bold;
13        background			: #44f;
14        border-left			: solid 1px #aaf;
15        border-top			: solid 1px #aaf;
16        border-right		: solid 1px #00c;
17        border-bottom		: solid 1px #00c;
18        padding-left		: 2px;
19        padding-right		: 2px;
20      }
21
22      span.virtual_style
23      {
24        font-size			 : 8pt;
25        color				 : white;
26        font-weight			: bold;
27        background			: #0a0;
28        border-left			: solid 1px #0f0;
29        border-top			: solid 1px #0f0;
30        border-right		: solid 1px #060;
31        border-bottom		: solid 1px #060;
32        padding-left		: 2px;
33        padding-right		: 2px;
34      }
35
36      span.protected_style
37      {
38        font-size			 : 8pt;
39        color				 : white;
40        font-weight			: bold;
41        background			: #444;
42        border-left			: solid 1px #ccc;
43        border-top			: solid 1px #ccc;
44        border-right		: solid 1px #222;
45        border-bottom		: solid 1px #222;
46        padding-left		: 2px;
47        padding-right		: 2px;
48      }
49      table.table, table.table td, table.table th
50      {
51        border-collapse: collapse;
52        background-color: white;
53      }
54
55      table.table
56      {
57        width: auto;
58        margin: 1em;
59        position	: static;
60        font-family	: Arial;
61      }
62
63      table.table td, table.table th
64      {
65        padding: 0.2em;
66      }
67
68      table.table td.number, table.table th.number
69      {
70        text-align: right;
71      }
72
73      table.table tbody tr th
74      {
75        text-align: left;
76        font-weight: normal;
77        width: auto;
78      }
79
80      table.table thead tr th,
81      table.table tbody tr th.category
82      {
83        padding: 0 0.2em;
84      }
85
86      table.table caption
87      {
88        font-weight: bold;
89        padding: 0.4em;
90      }
91      table.table th
92      {
93        font-weight			: bold;
94        background			: #acf;
95      }
96        --></style>
97<title>SaveDataFiler</title>
98  </head>
99  <body>
100<h1><CODE>SaveDataFiler</CODE></h1>
101<h2>Table of Contents</h2>
102    <ul>
103<li><a href="#Summary">Overview</a></li>
104      <ul>
105<li><a href="#Summary_Usage1">Usage 1: Import into system NAND memory</a></li>
106<li><a href="#Summary_Usage2">Usage 2: Start from CTR card (or emulation memory)</a></li>
107      </ul>
108<li><a href="#Controller">How to Use</a></li>
109      <ul>
110<li><a href="#Controller_Export">Writing to SD Cards</a></li>
111<li><a href="#Controller_DestroyFile">Destroying Files</a></li>
112      </ul>
113<li><a href="#UpperScreen">Upper Screen</a></li>
114<li><a href="#UserTab">User Tab</a></li>
115<li><a href="#ExtDataTab">ExtData Tab</a></li>
116<li><a href="#SdTab">SD Tab</a></li>
117<li><a href="#ResetSharedExtData">Initializing Shared Expanded Save Data</a></li>
118<li><a href="#History">Revision History</a></li>
119    </ul>
120
121<a name="Summary"><h2>Overview</h2></a>
122    <div class="section">
123The <CODE>SaveDataFiler</CODE> tool provides features to view, import, and export the following types of save data.<br /> <br />
124      <ul>
125<li>Save data on CTR Cards</li>
126<li>Save data for download applications on SD Cards</li>
127<li>Expanded save data on SD Cards</li>
128      </ul>
129
130<h3><a name="Summary_Usage1">Usage 1: Import into system NAND memory</a></h3>
131      <div class="section">
132The <CODE>SaveDataFiler</CODE> binary is in the following location in the CTR-SDK.
133<pre>
134$HORIZON_ROOT/tools/TargetTools/CTR-TS/Release/SaveDataFiler.cia
135</pre>
136Copy the above binary to an SD Card, and import it from <a href="DevMenu.html">DevMenu</a> to the system's NAND memory. After that, it can be launched from the HOME Menu.(It can also be launched from <CODE><a href="DevMenu.html">DevMenu</a></CODE>.)<br /> <br />
137
138<h4><font color="red">Note 1: Handling of expanded save data</font></h4>
139Expanded save data can only be accessed by the system that imported it. The same applies to data obtained via the SaveDataFiler. You must import the SaveDataFiler onto all systems onto which you wish to import expanded save data. (You cannot reuse SD Cards.)
140
141<h4><font color="red">Note 2: Handling of save data in backup memory</font></h4>
142You will not be able to access the save data if the ROM region of the CTR card (or emulation memory) contains ROM data in an invalid format. Emulation memory is invalid immediately after the debugger is powered on, and the ROM region is invalid in such cases as when the SystemUpdater is written to the CTR card.
143      </div>
144
145<h3><a name="Summary_Usage2">Usage 2: Start from CTR card (or emulation memory)</a></h3>
146      <div class="section">
147If it is too much trouble to import into system NAND, there is a way to write to the CTR card.
148<pre>
149$HORIZON_ROOT/tools/TargetTools/CTR-TS/Release/SaveDataFiler.csu
150</pre>
151Use the debugger to write the binary above to the CTR card. You can also start it from the HOME or Test Menu. You can also start it from the debugger's emulation memory. <br />
152
153<h4><font color="red">Note: Handling of save data in backup memory</font></h4>
154If you start it using this method, you may not be able to successfully import save data into backup memory, or export save data from it. Import the <CODE>SaveDataFiler</CODE> into system NAND memory and use this to import or export user save data into/from backup memory.
155      </div>
156    </div>
157
158<a name="Controller"><h2>How to Use</h2></a>
159    <div class="section">
160The method of operations are as explained below. <br />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.
161
162      <table class="table"><tbody>
163<tr><th>Button</th><th>Operation</th></tr>
164<tr><td>↑↓</td><td>Move the cursor within the list</td></tr>
165<tr><td>←→</td><td>Change tab</td></tr>
166<tr><td>A</td><td>Select / Run</td></tr>
167<tr><td>B</td><td>Cancel</td></tr>
168<tr><td>X</td><td>Delete the selected item</td></tr>
169<tr><td>Y</td><td>Write the save data to the SD Card (<B>Note:</B> See <a href="#Controller_Export">Writing to SD Cards</a>)</td></tr>
170<tr><td>R+Y</td><td>Destroy the selected files (<B>Note:</B> See <a href="#Controller_DestroyFile">Destroying Files</a>)</td></tr>
171<tr><td>L+R+START</td><td>Initializes shared expanded save data (<B>Note:</B> See <a href="#ResetSharedExtData">Initializing Shared Expanded Save Data</a>)</td></tr>
172      </tbody></table>
173
174<a name="Controller_Export"><h3>Writing to SD Cards</h3></a>
175      <div class="section">
176You can use <CODE>SaveDataFiler</CODE> to write save data and expanded save data to SD Cards.<br />The written data is saved to SD Cards in the following location.
177<pre>
178sdmc:/filer/
179        +--- UserSaveData/
180        |       +--- &lt;The date and time saved&gt;/
181        |                +--- 00000000/          ←Data is saved below here(※)
182        |                +--- 00000000.dat       ←File containing format parameters
183        +--- ExtData/
184                +--- &lt;The date and time saved&gt;/
185                         +--- &lt;expanded save data number&gt;/      ←Data is saved below here
186                         +--- &lt;expanded save data number&gt;.dat   ←File containing format parameters
187
188</pre>
189Data saved in the above locations can be restored from the <a href="#SdTab"><B>SD</B> Tab</a>.<br /><br /> <B>Note:</B> In the case of data for downloadable applications, the directory name is the application's unique ID.
190      </div>
191
192<a name="Controller_DestroyFile"><h3>Destroying Files</h3></a>
193      <div class="section">
194The goal of destroying files is to put them in a state where the <CODE><a href="../api/nn/fs/ResultVerificationFailed/Overview.html">nn::fs::ResultVerificationFailed</a></CODE> 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.<br /><br /><font color="red"><STRONG>Note: </STRONG>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.</font><br />However, the process performed by <CODE>SaveDataFiler</CODE> only attempts to reproduce a destroyed state in accordance with the specification: &quot;The <CODE><a href="../api/nn/fs/ResultVerificationFailed/Overview.html">nn::fs::ResultVerificationFailed</a></CODE> error is sometimes returned if a <CODE>Read</CODE> is performed on a region that has never been written to.&quot; Consequently, sometimes the file is not destroyed. If destruction is successful, an error is displayed on the file list.(See the <B><a href="#UserTab">User tab</a></B>)<br />If the destroy-file operation fails, an error dialog like the one below will appear. Try the destroy-file operation again.
195
196<pre>
197 root:/test.txt  --- (1)
198 Can not be destroyed, please retry.
199
200
201            [ OK (A) ]
202</pre>
203      <table class="table"><tbody>
204<tr><th>Number</th><th>Description</th></tr>
205<tr><td>(1)</td><td>Displays the path to the file you tried to destroy.</td></tr>
206      </tbody></table>
207Even if the destroy-file operation fails, however, the contents of the file will still be invalid to the application.(A <CODE><a href="../api/nn/fs/ResultVerificationFailed/Overview.html">nn::fs::ResultVerificationFailed</a></CODE> error will not be returned.)<br /> <br />
208      </div>
209    </div>
210
211<a name="UpperScreen"><h2>Upper Screen</h2></a>
212    <div class="section">
213This is a description of the content of the upper screen.<br />
214<pre>
215Revision     : 34302  --- (1)
216
217File Type    : file  --- (2)
218  | LimitSize | LimitDir | LimitFile | Dup |  --- (3)
219  |    ---    |       16 |        16 |  ON |
220Level  : -5
221Summary: 8
222Module : 17
223Desc   : 392  --- (4)
224
225File Size    : 1024 bytes  --- (5)
226
227X: delete this file  --- (6)
228R+Y: destroy this file
229       :
230
231</pre>
232      <table class="table"><tbody>
233<tr><th>Number</th><th>Description</th></tr>
234<tr><td>(1)</td><td>Revision number for the <CODE>SaveDataFiler</CODE>.</td></tr>
235<tr><td>(2)</td><td>Indicates the type of item selected in the lower screen.</td></tr>
236<tr><td>(3)</td><td>When the item selected on the lower screen is an archive, the format parameters of that archive are displayed.<br />Their meanings are as follows.
237                            <table class="table"><tbody>
238<tr><td>LimitSize</td><td>(not used at present)</td></tr>
239<tr><td>LimitDir</td><td>the maximum number of directories that can be created</td></tr>
240<tr><td>LimitFile</td><td>the maximum number of files that can be created</td></tr>
241<tr><td>Dup</td><td>whether there is duplication</td></tr>
242                            </tbody></table>
243This is not displayed on the SD Tab.
244        </td></tr>
245<tr><td>(4)</td><td>When an error occurs during an archive mount or during an operation on an item selected from the lower screen, its <CODE>Result</CODE> value is displayed.<br /> To learn more about the content of errors, see the <a href="../api/nn/fs/briefing/descriptionList.html">Description List</a> for the fs library.
246                            </td></tr>
247<tr><td>(5)</td><td>When the item selected in the lower screen is a file, its size is displayed. -1 is displayed if the size could not be obtained.</td></tr>
248<tr><td>(6)</td><td>The operations guide is displayed.</td></tr>
249      </tbody></table>
250    </div>
251
252<a name="UserTab"><h2>User Tab</h2></a>
253    <div class="section">
254This tab is for manipulating save data.<br />
255
256<h3>List Display Mode</h3>
257      <div class="section">
258When this tab is selected, a list showing the CTR Card and download applications appears.<br />In addition to &quot;CTR Card,&quot; this list shows the unique IDs of the download applications imported to the SD Card.
259<pre>
260CTR Card
261F7FFF
262FFFFF
263   :
264</pre>
265If an archive is corrupted, the corresponding <CODE>Result</CODE> value appears on the upper screen when it is mounted.
266      </div>
267
268<h3>Filer Mode</h3>
269      <div class="section">
270When an item is selected from the list, the content of its save data is displayed on the lower screen.
271<pre>
272../
273Dir1/
274Dir2/
275File1
276<font color="red">File2 : Read Error (0-512)</font>
277File3
278  :
279</pre>
280When an error occurs during file operations, such as a damaged file, the filename is displayed in red. To display the corresponding <CODE>Result</CODE> value on the upper screen, align the cursor with the filename.<br /><br /> In addition, the function that was called when the error occurred is displayed next to the filename.
281      <table class="table"><tbody>
282<tr><th>Display</th><th>Description</th></tr>
283<tr><td>Open Error</td><td><CODE><a href="../api/nn/fs/FileStream/TryInitialize.html">nn::fs::FileStream::TryInitialize</a></CODE> returned an error. There was a failure in opening the file.</td></tr>
284<tr><td>Read Error</td><td><CODE><a href="../api/nn/fs/FileStream/TryRead.html">nn::fs::FileStream::TryRead</a></CODE> returned an error. There was a failure when reading the file.<br />At the same time, the byte at which the read error occurred is also displayed. (<CODE>SaveDataFiler</CODE> reads in units of 1MB, so the actual region where the error occurs may be smaller than this.)</td></tr>
285<tr><td>Size Error</td><td><CODE><a href="../api/nn/fs/FileStream/TryGetSize.html">nn::fs::FileStream::TryGetSize</a></CODE> returned an error. There was a failure in getting the file size (metadata).<br />However, if the system fails to get the metadata, it will also fail to open the file. Thus, an <CODE>Open Error</CODE> will generally be displayed.</td></tr>
286      </tbody></table>
287
288      </div>
289    </div>
290
291<a name="ExtDataTab"><h2>ExtData Tab</h2></a>
292    <div class="section">
293This tab is for manipulating the expanded save data on the SD Card.<br />
294
295<h3>List Display Mode</h3>
296      <div class="section">
297When 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.
298<pre>
29900000001
300<font color="red">00000002  -- broken --</font>
30100000003
302   :
303</pre>
304When an archive is corrupt (when the <CODE><a href="../api/nn/fs/MountExtSaveData.html">nn::fs::MountExtSaveData</a></CODE> function returns an error), the number is displayed in red. When the cursor is aligned above the filename, the <CODE>result</CODE> value is displayed in the upper screen.
305      </div>
306
307<h3>Filer Mode</h3>
308      <div class="section">
309When 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 <a href="#UserTab">User Tab</a>.
310      </div>
311    </div>
312
313<a name="SdTab"><h2>SD Tab</h2></a>
314    <div class="section">
315This tab is for manipulating the data written to SD Cards.<br /><br /> The data on the SD Card is displayed in a list.
316<pre>
317user  : 20110101000000 : 00000000
318user  :20110101121530 : 000f7fff
319ext   : 20110101000000 : 00000001
320ext   : 20110102141516 : 00000002
321  :           :              :
322 (1)         (2)            (3)
323</pre>
324      <table class="table"><tbody>
325<tr><th>Number</th><th>Description</th></tr>
326<tr><td>(1)</td><td>Indicates the save data type.<br />
327                            <table class="table"><tbody>
328<tr><td>User</td><td>Save Data</td></tr>
329<tr><td><CODE>ext</CODE></td><td>Expanded Save Data</td></tr>
330                            </tbody></table>
331        </td></tr>
332<tr><td>(2)</td><td>This is the directory name (the date and time saved) on the SD Card.</td></tr>
333<tr><td>(3)</td><td>The meaning of this item depends on the save data type.<br />
334                            <table class="table"><tbody>
335<tr><td>User</td><td>For download application data, it is the unique ID;<br />for card application data, <CODE>0</CODE> is displayed.</td></tr>
336<tr><td><CODE>ext</CODE></td><td>Displays the expanded save data number.</td></tr>
337                            </tbody></table>
338        </td></tr>
339      </tbody></table>
340
341Select 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).
342    </div>
343
344<a name="ResetSharedExtData"><h2>Initializing Shared Expanded Save Data</h2></a>
345    <div class="section">
346You 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.)<br />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.)<br />
347    </div>
348
349<a name="History"><h2>Revision History</h2></a>
350    <div class="section">
351      <dl class="history">
352        <dt>2011/06/22</dt>
353<dd>Added note about differences due to method of starting <CODE>SaveDataFiler</CODE>.</dd>
354        <dt>2011/06/13</dt>
355<dd>Added description of usage.</dd>
356<dd>Changed error message upon failure to destroy file.</dd>
357        <dt>2011/04/21</dt>
358<dd>Added a note about file destruction.</dd>
359        <dt>2011/03/23</dt>
360<dd>Added support for save data in download applications.</dd>
361        <dt>2011/03/19</dt>
362<dd>Added feature to initialize shared expanded save data.</dd>
363        <dt>2011/02/18</dt>
364<dd>Initial version.</dd>
365      </dl>
366    </div>
367  <hr><p>CONFIDENTIAL</p></body>
368</html>