Filesystem services: Difference between revisions

TimmSkiller (talk | contribs)
TimmSkiller (talk | contribs)
Rework system savedata + (shared) extdata path formats
Line 1,142: Line 1,142:
Note that ExeFS files only support reading from offset=0 and with size=file_size.  
Note that ExeFS files only support reading from offset=0 and with size=file_size.  


=== SystemSaveData Archive Path Data Format ===
=== SystemSaveData / Extdata / Shared Extdata Archive Path Data Format ===
==== FS ====
 
{| class="wikitable" border="1"
==== DataAccessPath ====
|-
!  Index word
!  Description
|-
| 0
| [[Mediatypes|Mediatype]] (must be zero for NAND)
|-
| 1
| saveid
|}
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.


==== FSPXI ====
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
!  Offset !! Size !! Description
!  Offset !! Size !! Description
|-
|-
| 0x0 || 0x1 || u8 [[Mediatypes|Mediatype]] (must be zero for NAND)
| 0x0 || 0x1 || u8 [[Mediatypes|Mediatype]]
|-
|-
| 0x1 || 0x1 ||
| 0x1 || 0x1 || only for NAND data (System Savedata / Shared Extdata), otherwise left 0:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,173: Line 1,161:
| 1 || Accesses from/to <code>nand:/fixdata</code>
| 1 || Accesses from/to <code>nand:/fixdata</code>
|-
|-
| 2 || Accesses from/to <code>nand:/data/<ID0 of a source console's [[Filesystem_services#DeviceMoveContext|Device Move Context]]></code>
| 2 || Accesses from/to <code>nand:/data/<ID0 from source console's [[Filesystem_services#DeviceMoveContext|Device Move Context]]></code>
|}
|}
|-
|-
| 0x2 || 0x2 || padding
| 0x2 || 0x2 || padding
|}
|}
The file lowpath is a binary lowpath containing the u64 saveid, however the high word of the saveid is always zero. The mounted file is the cleartext savegame image. Up to 32 SystemSaveData image files can be opened under a single mounted FSPXI archive.


=== UserSaveDataForCheck Archive Path Data Format ===
==== SystemSaveData ====
 
===== FS =====
 
====== Archive Path ======
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,187: Line 1,178:
|-
|-
| 0  
| 0  
| [[Mediatypes|Mediatype]] (must be non-zero)
| [[Filesystem_services#DataAccessPath|DataAccessPath]]
|-
|-
| 1
| 1
| Lower word saveid
| save ID low (save ID high is usually 0)
|-
| 2
| Upper word saveid
|}
|}
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.


=== 0x567890B4 Archive Path Data Format ===
====== File Path ======
The file path is a cleartext ASCII or UTF16 file path (<code><file path></code>).
 
The file path would access the file at <code><base path>/sysdata/<save ID low>/<save ID high>/<file path></code>.
Note that <code>/<file path></code> refers to the virtual file system inside the </code><save ID high></code> file.
 
===== FSPXI / FS System Savedata Transfer / FSPXI System Savedata Transfer =====
 
====== Archive Path ======
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,204: Line 1,199:
|-
|-
| 0  
| 0  
| [[Mediatypes|Mediatype]]
| [[Filesystem_services#DataAccessPath|DataAccessPath]]
|-
| 1
| <code><nowiki>Lower_word_saveid >> 8</nowiki></code> ?
|-
| 2
| Unknown. Game calculate this using formula <code><nowiki>0xFFFFFF00 | unknown_b</nowiki></code>
|}
|}


=== 0x12345681 Archive Path Data Format ===
====== File Path ======
Archive path:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Index word !! Description
! Index word !! Description
|-
|-
| 0 ||  
| 0 || save ID low
|-
| 1 || save ID high
|}
 
The file path would access the file at <code><base path>/sysdata/<save ID low>/<save ID high></code>.
 
==== Extdata / Shared Extdata ====
 
===== FS / FS Extdata Transfer / FSPXI Extdata Transfer =====
 
====== Archive Path ======
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset !! Size !! Description
! Index word
! Description
|-
|-
| 0x0 || 0x1 || Media Type
| 0
| [[Filesystem_services#DataAccessPath|DataAccessPath]]
|-
|-
| 0x1 || 0x1 || bool, for writing
| 1
| ext save ID low
|-
|-
| 0x2 || 0x2 || padding
| 2
|}
| ext save ID high
|}
|}


File path:
This refers to the extdata filesystem structure's base directory at <code><base path>/extdata/<ext save ID low>/<ext save ID high></code>.
 
====== File Path ======
The file path is a cleartext ASCII or UTF16 file path (<code><file path></code>).
 
For FS Extdata, this would acccess <code><base path>/extdata/<save ID low>/<save ID high>/<directory ID>/<file ID>/<file path></code>, and <code>/<file path></code> refers to the virtual file system inside the </code><file ID></code> file.
 
For FS / FSPXI Extdata Transfer, this accesses <code><base path>/extdata/<save ID low>/<save ID high>/<file path></code>.
 
=== UserSaveDataForCheck Archive Path Data Format ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Index word !! Description
! Index word
! Description
|-
| 0
| [[Mediatypes|Mediatype]] (must be non-zero)
|-
|-
| 0 || [[System_SaveData|System Savedata Save ID]]
| 1
| Lower word saveid
|-
|-
| 1 || 0
| 2
| Upper word saveid
|}
|}


=== ExtSaveData Archive Path Data Format ===
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.
 
=== 0x567890B4 Archive Path Data Format ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,252: Line 1,271:
|-
|-
| 1
| 1
| Lower word saveid
| <code><nowiki>Lower_word_saveid >> 8</nowiki></code> ?
|-
|-
| 2
| 2
| Upper word saveid
| Unknown. Game calculate this using formula <code><nowiki>0xFFFFFF00 | unknown_b</nowiki></code>
|}
|}
For FS, the file/directory lowpath is a text path in the [[extdata]] filesystem. For FSPXI, the file lowpath is a text path relative to the "/extdata/<ExtdataIDHigh>/<ExtdataIDLow>" directory on SD/NAND, for the cleartext extdata image to mount.


=== 0x2345678A Archive Path Data Format ===
=== 0x2345678A Archive Path Data Format ===