Difference between revisions of "FS:FormatSaveData"

From 3dbrew
Jump to navigation Jump to search
(Fix service command header)
 
(10 intermediate revisions by 4 users not shown)
Line 9: Line 9:
 
|-
 
|-
 
| 1
 
| 1
| Archive ID (Only 4 (SaveData) has been observed)
+
| [[Filesystem_services#ArchiveId|Archive ID]]. This must be either 0x4 (SaveData) or 0x567890B2, otherwise error 0xE0E046BE is returned.
 
|-
 
|-
 
| 2
 
| 2
| LowPath.Type
+
| [[Filesystem_services#PathType|Path Type]]
 
|-
 
|-
 
| 3
 
| 3
| LowPath.Size
+
| Path Size
 
|-
 
|-
 
| 4
 
| 4
| Unknown
+
| Size of a block. Only 0x200 and 0x1000 are accepted it seems. The value of this word is hard-coded to 0x200 in official titles it appears.
 
|-
 
|-
 
| 5
 
| 5
| Unknown
+
| Number of Directories
 
|-
 
|-
 
| 6
 
| 6
| Unknown
+
| Max number of Files
 
|-
 
|-
 
| 7
 
| 7
| Unknown
+
| Directory Bucket Count
 
|-
 
|-
 
| 8
 
| 8
| Unknown
+
| File Bucket Count
 
|-
 
|-
 
| 9
 
| 9
| Unknown
+
| u8, 0 = don't duplicate data, 1 = duplicate data
 
|-
 
|-
 
| 10
 
| 10
| (LowPath.Size << 14) <nowiki>|</nowiki> 2
+
| (PathSize << 14) <nowiki>|</nowiki> 2
 
|-
 
|-
 
| 11
 
| 11
| LowPath.Data ptr
+
| Path Data Pointer
 +
|}
 +
 
 +
=Response=
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Index Word
 +
!  Description
 +
|-
 +
| 0
 +
| Header code
 +
|-
 +
| 1
 +
| Result code
 
|}
 
|}
  
 
=Description=
 
=Description=
 
This clears the SaveData archive for the specified game, if the LowPath.Type is Empty then this will clear the SaveData for the current game. The target SaveData to format is determined by a Binary path, a game needs an exheader permission set in order to format the SaveData of another program.
 
This clears the SaveData archive for the specified game, if the LowPath.Type is Empty then this will clear the SaveData for the current game. The target SaveData to format is determined by a Binary path, a game needs an exheader permission set in order to format the SaveData of another program.
 +
 +
See [[RomFS#Hash_Table_Structure|here]] for an example of how bucket counts should be calculated.

Latest revision as of 00:19, 31 May 2019

Request[edit]

Index Word Description
0 Header code [0x084C0242]
1 Archive ID. This must be either 0x4 (SaveData) or 0x567890B2, otherwise error 0xE0E046BE is returned.
2 Path Type
3 Path Size
4 Size of a block. Only 0x200 and 0x1000 are accepted it seems. The value of this word is hard-coded to 0x200 in official titles it appears.
5 Number of Directories
6 Max number of Files
7 Directory Bucket Count
8 File Bucket Count
9 u8, 0 = don't duplicate data, 1 = duplicate data
10 (PathSize << 14) | 2
11 Path Data Pointer

Response[edit]

Index Word Description
0 Header code
1 Result code

Description[edit]

This clears the SaveData archive for the specified game, if the LowPath.Type is Empty then this will clear the SaveData for the current game. The target SaveData to format is determined by a Binary path, a game needs an exheader permission set in order to format the SaveData of another program.

See here for an example of how bucket counts should be calculated.