Changes

Jump to navigation Jump to search
5,918 bytes added ,  21:00, 17 October 2015
Common types.
Line 814: Line 814:     
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].
 
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].
 +
 +
= Common Types =
 +
== MediaType ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0
 +
| NAND
 +
|-
 +
| 1
 +
| SD
 +
|-
 +
| 2
 +
| Game Card
 +
|}
 +
 +
== OpenFlags ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Bit
 +
!  Description
 +
|-
 +
| 0
 +
| Read
 +
|-
 +
| 1
 +
| Write
 +
|-
 +
| 2
 +
| Create
 +
|}
 +
 +
== Attributes ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Flag
 +
!  Description
 +
|-
 +
| 0x00000001
 +
| Is Read-Only
 +
|-
 +
| 0x00000100
 +
| Is Archive
 +
|-
 +
| 0x00010000
 +
| Is Hidden
 +
|-
 +
| 0x01000000
 +
| Is Directory
 +
|}
 +
 +
== ArchiveResource ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x4
 +
| Sector byte-size
 +
|-
 +
| 0x4
 +
| 0x4
 +
| Cluster byte-size
 +
|-
 +
| 0x8
 +
| 0x4
 +
| Partition capacity in clusters
 +
|-
 +
| 0xC
 +
| 0x4
 +
| Available free space in clusters
 +
|}
 +
 +
== ArchiveId ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Idcode
 +
!  Description
 +
!  Accessible via [[Filesystem_services|FS]]
 +
!  Accessible via [[Filesystem_services_PXI|FSPXI]]
 +
!  Requires binary [[FS:OpenFile|Lowpath]]
 +
|-
 +
| 0x00000003
 +
| Application RomFS
 +
| Yes
 +
| No
 +
| No
 +
|-
 +
| 0x00000004
 +
| SaveData (the saveID/mediatype for this is loaded from data originally from the user process' exheader)
 +
| Yes
 +
| No
 +
| No
 +
|-
 +
| 0x00000006
 +
| ExtSaveData
 +
| Yes
 +
| No
 +
| Yes
 +
|-
 +
| 0x00000007
 +
| Shared ExtSaveData
 +
| Yes
 +
| No
 +
| Yes
 +
|-
 +
| 0x00000008
 +
| SystemSaveData
 +
| Yes
 +
| No
 +
| Yes
 +
|-
 +
| 0x00000009
 +
| SDMC
 +
| Yes
 +
| Yes
 +
| No
 +
|-
 +
| 0x0000000A
 +
| SDMC Write-Only
 +
| Yes
 +
| No
 +
| No
 +
|-
 +
| 0x12345678
 +
| ExtSaveData for BOSS
 +
| Yes
 +
| No
 +
| Yes
 +
|-
 +
| 0x12345679
 +
| CARD SPI FS
 +
| Yes
 +
| Yes
 +
| No
 +
|-
 +
| 0x1234567B
 +
| ExtSaveData, and ExtSaveData for BOSS
 +
| No
 +
| Yes
 +
| Yes
 +
|-
 +
| 0x1234567C
 +
| SystemSaveData
 +
| No
 +
| Yes
 +
| Yes
 +
|-
 +
| 0x1234567D
 +
| NAND RW
 +
| Yes
 +
| Yes
 +
| No
 +
|-
 +
| 0x1234567E
 +
| NAND RO
 +
| Yes
 +
| Yes
 +
| No
 +
|-
 +
| 0x1234567F
 +
| NAND RO Write FS
 +
| No
 +
| Yes
 +
| No
 +
|-
 +
| 0x2345678A
 +
| User/GameCard SaveData (for check), and other uses (FS can only mount the latter) (lo hi mediatype reserved)
 +
| Yes
 +
| Yes
 +
| Yes
 +
|-
 +
| 0x2345678B
 +
| ?
 +
| No
 +
| No
 +
| Yes
 +
|-
 +
| 0x2345678C
 +
| ?
 +
| No
 +
| No
 +
| Yes
 +
|-
 +
| 0x2345678D
 +
| ?
 +
| No
 +
| No
 +
| No
 +
|-
 +
| 0x2345678E
 +
| SaveData, ExeFS, and RomFS (For [[Filesystem_services|fs:LDR]], only ExeFS)
 +
| Yes
 +
| Yes
 +
| Yes
 +
|-
 +
| 0x567890AB
 +
| NAND CTR FS
 +
| No
 +
| Yes
 +
| No
 +
|-
 +
| 0x567890AC
 +
| TWL PHOTO
 +
| Yes
 +
| Yes
 +
| No
 +
|-
 +
| 0x567890AD
 +
| ?
 +
| No
 +
| Yes
 +
| No
 +
|-
 +
| 0x567890AE
 +
| NAND TWL FS
 +
| Yes
 +
| Yes
 +
| No
 +
|-
 +
| 0x567890AF
 +
| NAND W FS
 +
| Yes
 +
| Yes
 +
| No
 +
|-
 +
| 0x567890B0
 +
| ?
 +
| No
 +
| Yes
 +
| No
 +
|-
 +
| 0x567890B1
 +
| Gamecard SaveData (for check). This is a wrapper for UserSaveDataForCheck: the OpenArchive code for that is called with archive-lowpath TID=0/mediatype=2(gamecard).
 +
| Yes
 +
| No
 +
| No
 +
|-
 +
| 0x567890B2
 +
| UserSaveData (for check). This is the same as the regular SaveData archive, except with this the savedata ID and mediatype is loaded from the input archive lowpath.
 +
| Yes
 +
| No
 +
| Yes
 +
|-
 +
| 0x567890B4
 +
| ? SaveData from Demo Version of Retail Game
 +
| Yes
 +
| No
 +
| No
 +
|}
 +
 +
Archives listed as not requiring a binary lowpath, use lowpath type [[FS:OpenFile|empty]].
 +
 +
Archives CTR NAND, NAND RO Write FS, TWL NAND, NAND W FS, and CARD SPI FS require the corresponding process exheader access control mount flag to be set, in the exheader for any of the currently running ARM11 processes, for [[Filesystem_services_PXI|FSPXI]]. The access rights checked by [[Filesystem services|FS]] module for archive mounting with fs:USER, are stored in the process' exheader accessinfo.
 +
 +
The CARDSPI archive allows access to the gamecard CARD1 raw savedata flash(aka "cardspi:/" in [[FIRM|Process9]]), the file lowpath must be WCHAR "/". The "NAND W FS" archive allows access to the raw NAND image(aka "wnand:/" in Process9), the file lowpath must be WCHAR "/".
 +
 +
== PathType ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0x0
 +
| INVALID - Specifies an invalid path.
 +
|-
 +
| 0x1
 +
| EMPTY - Specifies an empty path.
 +
|-
 +
| 0x2
 +
| BINARY - Non-text based path. Meaning is per-archive.
 +
|-
 +
| 0x3
 +
| CHAR - Text-based path with 8-bit characters.
 +
|-
 +
| 0x4
 +
| WCHAR - Text-based path with 16-bit characters.
 +
|}
 +
 +
=== Binary LowPath ===
 +
The format of the data that a binary LowPath points to is custom per archive.
 +
 +
==== SystemSaveData Archive Path Data Format ====
 +
===== FS =====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  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"
 +
|-
 +
!  Index word
 +
!  Description
 +
|-
 +
| 0
 +
| u8 [[Mediatypes|Mediatype]] (must be zero for NAND)
 +
|}
 +
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 ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Index word
 +
!  Description
 +
|-
 +
| 0
 +
| [[Mediatypes|Mediatype]] (must be non-zero)
 +
|-
 +
| 1
 +
| Lower word saveid
 +
|-
 +
| 2
 +
| Upper word saveid
 +
|}
 +
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.
 +
 +
==== ExtSaveData Archive Path Data Format ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Index word
 +
!  Description
 +
|-
 +
| 0
 +
| [[Mediatypes|Mediatype]]
 +
|-
 +
| 1
 +
| Lower word saveid
 +
|-
 +
| 2
 +
| Upper word saveid
 +
|}
 +
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.
 +
 +
==== [[RomFS]] ====
 +
The raw FS image for the main CXI RomFS(for the current app this is accessible via archiveid 0x3) can be accessed via an all-zero 0xc-byte binary file-lowpath. This allows access to the raw level-3 IVFC image: the user process must handle parsing the filesystem used in this image itself.
 +
 +
In this scenario, OpenFile returns a handle to the RomFS archive.
    
=Errors=
 
=Errors=
 
See [[Filesystem_services_PXI]].
 
See [[Filesystem_services_PXI]].
1,434

edits

Navigation menu