Filesystem services: Difference between revisions
Simplify tables by listing only the latest state and add new values |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
== OpenCodeFileSystem == | == OpenCodeFileSystem == | ||
Takes | Takes a type-0x19 input buffer containing a [[#FspPath]] and an input [[NCM_services#ProgramId|ProgramId]]. Returns an [[#IFileSystem]]. | ||
[10.0.0+] This now takes an additional type-0x1A output buffer. | [10.0.0+] This now takes an additional type-0x1A output buffer. | ||
[16.0.0+] This now takes an additional input [[#ContentAttributes]]. | |||
[17.0.0+] This now takes a type-0x6 output buffer instead of a type-0x1A output buffer. | |||
== IsArchivedProgram == | == IsArchivedProgram == | ||
Takes an u64 ProcessId. Returns a bool (1 if the process id's [[# | Takes an input u64 ProcessId. Returns a bool (1 if the process id's [[#FspPath]] ends in ".nca"). | ||
== SetCurrentProcess == | == SetCurrentProcess == | ||
Takes | Takes an input u64 ProcessId. No output. | ||
= fsp-pr = | = fsp-pr = | ||
Line 70: | Line 74: | ||
| 7 || [2.0.0+] [[#OpenFileSystemWithPatch]] | | 7 || [2.0.0+] [[#OpenFileSystemWithPatch]] | ||
|- | |- | ||
| 8 || [16.0.0+] OpenFileSystemWithIdObsolete ([2.0.0-15.0.1] | | 8 || [16.0.0+] [[#OpenFileSystemWithIdObsolete]] ([2.0.0-15.0.1] OpenFileSystemWithId) | ||
|- | |- | ||
| 9 || [3.0.0+] OpenDataFileSystemByProgramId | | 9 || [3.0.0+] OpenDataFileSystemByProgramId | ||
|- | |- | ||
| 10 || [16.0.0+] OpenFileSystemWithId | | 10 || [16.0.0+] [[#OpenFileSystemWithId]] | ||
|- | |- | ||
| 11 || [[#OpenBisFileSystem]] | | 11 || [[#OpenBisFileSystem]] | ||
Line 308: | Line 312: | ||
| 1019 || [13.0.0+] UnsetDebugOption | | 1019 || [13.0.0+] UnsetDebugOption | ||
|- | |- | ||
| 1100 || [4.0.0+] | | 1020 || [18.0.0+] OpenMemoryStressor | ||
|- | |||
| 1100 || [4.0.0-17.0.1] OverrideSaveDataTransferTokenSignVerificationKey | |||
|- | |||
| 1101 || [18.0.0+] OverrideSaveDataTransferKeyForTest | |||
|- | |- | ||
| 1110 || [6.0.0+] CorruptSaveDataFileSystemByOffset | | 1110 || [6.0.0+] CorruptSaveDataFileSystemByOffset | ||
Line 589: | Line 597: | ||
== OpenFileSystem == | == OpenFileSystem == | ||
Takes a type-0x19 input [[# | Takes a type-0x19 input buffer containing a [[#FspPath]] and an input [[#FileSystemProxyType]]. Returns an [[#IFileSystem]]. | ||
[2.0.0+] This function was removed. | [2.0.0+] This function was removed. | ||
== SetCurrentProcess == | == SetCurrentProcess == | ||
Takes | Takes an input u64 ProcessId. No output. | ||
== OpenFileSystemWithPatch == | == OpenFileSystemWithPatch == | ||
Takes an input [[#FileSystemProxyType]] and an | Takes an input [[#FileSystemProxyType]] and an input [[NCM_services#ProgramId|ProgramId]]. Returns an [[#IFileSystem]]. | ||
Web-applet loads the [[#FileSystemProxyType]] (which must be '''Manual''') from u32_table[inparam]. | Web-applet loads the [[#FileSystemProxyType]] (which must be '''Manual''') from u32_table[inparam]. | ||
Line 603: | Line 611: | ||
Note: web-applet strings refer to both this cmd and [[#OpenFileSystemWithId]] as "MountContent", but official nn_sf_sync symbols use "OpenXX" names. | Note: web-applet strings refer to both this cmd and [[#OpenFileSystemWithId]] as "MountContent", but official nn_sf_sync symbols use "OpenXX" names. | ||
== | == OpenFileSystemWithIdObsolete == | ||
Takes a type-0x19 input buffer, an [[#FileSystemProxyType]] and an | Takes a type-0x19 input buffer containing a [[#FspPath]], an input [[#FileSystemProxyType]] and an input [[NCM_services#ProgramId|ProgramId]]. Returns an [[#IFileSystem]]. | ||
The [[#IFileSystem]] must be '''Meta''' if the NCA type is 0. | The [[#IFileSystem]] must be '''Meta''' if the NCA type is 0. | ||
Line 617: | Line 625: | ||
When [[#FileSystemProxyType]] is '''Meta''', it uses in64=0xffffffffffffffff internally, otherwise it checks if in64 is set to 0xffffffffffffffff then throws an error if so. When the in64 used internally is not 0xffffffffffffffff, it's compared with the NCA [[NCM_services#ProgramId|ProgramId]], then an error is thrown on mismatch. | When [[#FileSystemProxyType]] is '''Meta''', it uses in64=0xffffffffffffffff internally, otherwise it checks if in64 is set to 0xffffffffffffffff then throws an error if so. When the in64 used internally is not 0xffffffffffffffff, it's compared with the NCA [[NCM_services#ProgramId|ProgramId]], then an error is thrown on mismatch. | ||
== OpenFileSystemWithId == | |||
Takes a type-0x19 input buffer containing a [[#FspPath]], an input [[#ContentAttributes]], an input [[#FileSystemProxyType]] and an input [[NCM_services#ProgramId|ProgramId]]. Returns an [[#IFileSystem]]. | |||
== OpenBisFileSystem == | == OpenBisFileSystem == | ||
Takes a type-0x19 input buffer | Takes a type-0x19 input buffer containing a [[#FspPath]] and an input [[#BisPartitionId]]. Returns an [[#IFileSystem]]. | ||
Official user-process code sets instr[0] = 0 normally. | |||
Only partitionIDs for FAT partitions are usable with this, otherwise error 0x2EE202 is returned. Seems to be about the same as [[#OpenBisStorage]] except this mounts the partition filesystem instead of allowing direct access to the partition sectors. | Only partitionIDs for FAT partitions are usable with this, otherwise error 0x2EE202 is returned. Seems to be about the same as [[#OpenBisStorage]] except this mounts the partition filesystem instead of allowing direct access to the partition sectors. | ||
Line 1,107: | Line 1,120: | ||
|- | |- | ||
| 221 || [17.0.0+] GetGameCardAsicCertificate | | 221 || [17.0.0+] GetGameCardAsicCertificate | ||
|- | |||
| 222 || [18.0.0+] GetGameCardCardHeader | |||
|- | |- | ||
| 300 || [[#SetSpeedEmulationMode]] | | 300 || [[#SetSpeedEmulationMode]] | ||
|- | |- | ||
| 301 || [[#GetSpeedEmulationMode]] | | 301 || [[#GetSpeedEmulationMode]] | ||
|- | |||
| 302 || [18.0.0+] SetApplicationStorageSpeed | |||
|- | |- | ||
| 400 || [5.0.0+] [[#SuspendSdmmcControl]] | | 400 || [5.0.0+] [[#SuspendSdmmcControl]] | ||
Line 1,465: | Line 1,482: | ||
|- | |- | ||
| 0 || [[#GetChallenge]] | | 0 || [[#GetChallenge]] | ||
|- | |||
| 8 || [18.0.0+] SetMode | |||
|- | |||
| 9 || [18.0.0+] SetAttribute | |||
|- | |- | ||
| 16 || [[#SetKeySeedPackage]] | | 16 || [[#SetKeySeedPackage]] | ||
Line 1,476: | Line 1,497: | ||
| 63 || [17.0.0+] OpenSaveDataImporter | | 63 || [17.0.0+] OpenSaveDataImporter | ||
|- | |- | ||
| 64 || [6.0.0 | | 64 || [6.0.0-17.0.1] [[#OpenSaveDataImporterDeprecated]] ([5.0.0-5.1.0] OpenSaveDataImporter) | ||
|- | |- | ||
| 65 || [[#OpenSaveDataImporterForDiffImport]] | | 65 || [5.0.0-17.0.1] [[#OpenSaveDataImporterForDiffImport]] | ||
|- | |- | ||
| 66 || [6.0.0 | | 66 || [6.0.0-17.0.1] [[#OpenSaveDataImporterForDuplicateDiffImport]] | ||
|- | |- | ||
| 67 || [6.0.0-16.1.0] [[#OpenSaveDataImporter]] | | 67 || [6.0.0-16.1.0] [[#OpenSaveDataImporter]] | ||
Line 1,488: | Line 1,509: | ||
| 69 || [6.0.0+] [[#CancelSuspendingImport]] | | 69 || [6.0.0+] [[#CancelSuspendingImport]] | ||
|- | |- | ||
| 70 || [10.0.0+] | | 70 || [10.0.0+] CancelSuspendingImportByAttribute | ||
|- | |- | ||
| 80 || [11.0.0+] | | 80 || [11.0.0+] SwapSecondary | ||
|} | |} | ||
Line 1,537: | Line 1,558: | ||
| 0 || [[#SetDivisionCount]] | | 0 || [[#SetDivisionCount]] | ||
|- | |- | ||
| 1 || [6.0.0+] [[# | | 1 || [6.0.0+] [[#ReadSaveDataExtraData]] | ||
|- | |- | ||
| 16 || [[#OpenSaveDataDiffChunkIterator]] | | 16 || [[#OpenSaveDataDiffChunkIterator]] | ||
Line 1,551: | Line 1,572: | ||
| 67 || [6.0.0+] [[#SuspendExport]] | | 67 || [6.0.0+] [[#SuspendExport]] | ||
|- | |- | ||
| 70 || [6.0.0 | | 70 || [6.0.0-17.0.1] [[#GetKeySeed]] | ||
|- | |- | ||
| 71 || [6.0.0+] [[#GetInitialDataMac]] | | 71 || [6.0.0+] [[#GetInitialDataMac]] | ||
Line 1,558: | Line 1,579: | ||
|- | |- | ||
| 73 || [9.0.0+] [[#GetInitialDataMacKeyGeneration]] | | 73 || [9.0.0+] [[#GetInitialDataMacKeyGeneration]] | ||
|- | |||
| 74 || [18.0.0+] [[#GetKeySeed]] | |||
|- | |- | ||
| 80 || [6.0.0+] [[#GetImportInitialDataAad]] | | 80 || [6.0.0+] [[#GetImportInitialDataAad]] | ||
Line 1,605: | Line 1,628: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [6.0.0+] [[# | | 0 || [6.0.0+] [[#ReadSaveDataExtraData]] | ||
|- | |- | ||
| 16 || [[#OpenSaveDataDiffChunkIterator]] | | 16 || [[#OpenSaveDataDiffChunkIterator]] | ||
Line 1,628: | Line 1,651: | ||
|} | |} | ||
== | == ReadSaveDataExtraData == | ||
No input/output, takes a type-0x6 output buffer. | No input/output, takes a type-0x6 output buffer. | ||
Line 1,875: | Line 1,898: | ||
|- | |- | ||
| 4 || Data | | 4 || Data | ||
|} | |||
= ContentAttributes = | |||
This is "nn::fs::ContentAttributes". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value || Name | |||
|- | |||
| 0 || None | |||
|- | |||
| 15 || All | |||
|} | |} | ||
Line 2,203: | Line 2,238: | ||
|} | |} | ||
= | = MemoryReportInfo = | ||
This is "nn::fs:: | This is "nn::fs::MemoryReportInfo". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 2,213: | Line 2,248: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
| | | 0x8 | ||
| | | PooledBufferFreeSizePeak | ||
|- | |- | ||
| | | 0x8 | ||
| | | 0x8 | ||
| | | PooledBufferRetriedCount | ||
|- | |- | ||
| 0x10 | |||
| 0x8 | | 0x8 | ||
| | | PooledBufferReduceAllocationCount | ||
| | |- | ||
| 0x18 | |||
| 0x8 | |||
| BufferManagerFreeSizePeak | |||
|- | |||
| 0x20 | |||
| 0x8 | |||
| BufferManagerRetriedCount | |||
|- | |||
| 0x28 | |||
| 0x8 | |||
| ExpHeapFreeSizePeak | |||
|- | |||
| 0x30 | |||
| 0x8 | |||
| BufferPoolFreeSizePeak | |||
|- | |||
| 0x38 | |||
| 0x8 | |||
| PatrolReadAllocateBufferSuccessCount | |||
|- | |||
| 0x40 | |||
| 0x8 | |||
| PatrolReadAllocateBufferFailureCount | |||
|- | |||
| 0x48 | |||
| 0x8 | |||
| BufferManagerTotalAllocatableSizePeak | |||
|- | |||
| 0x50 | |||
| 0x8 | |||
| BufferPoolAllocateSizeMax | |||
|- | |||
| 0x58 | |||
| 0x8 | |||
| PooledBufferFailedIdealAllocationCountOnAsyncAccess | |||
|- | |- | ||
| | | 0x60 | ||
| | | 0x20 | ||
| | | Reserved | ||
|} | |} | ||
= | = StorageErrorInfo = | ||
This is "nn::fs:: | This is "nn::fs::StorageErrorInfo". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 2,240: | Line 2,311: | ||
| 0x0 | | 0x0 | ||
| 0x4 | | 0x4 | ||
| | | NumActivationFailures | ||
|- | |- | ||
| 0x4 | | 0x4 | ||
| 0x4 | | 0x4 | ||
| | | NumActivationErrorCorrections | ||
|- | |- | ||
| 0x8 | | 0x8 | ||
| 0x4 | | 0x4 | ||
| | | NumReadWriteFailures | ||
|- | |- | ||
| 0xC | | 0xC | ||
| 0x4 | | 0x4 | ||
| | | NumReadWriteErrorCorrections | ||
|} | |} | ||
= | = GameCardErrorInfo = | ||
This is "nn::fs:: | This is "nn::fs::GameCardErrorInfo". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Offset | ||
! Size | |||
! Description | |||
|- | |- | ||
| | | 0x0 | ||
| 0x2 | |||
| GameCardCrcErrorCount | |||
|- | |- | ||
| | | 0x2 | ||
| 0x2 | |||
| Reserved | |||
|- | |- | ||
| | | 0x4 | ||
| 0x2 | |||
| AsicCrcErrorCount | |||
|- | |- | ||
| | | 0x6 | ||
| | | 0x2 | ||
| Reserved | |||
|- | |- | ||
| 0x8 | |||
| 0x2 | |||
| RefreshCount | |||
|- | |- | ||
| | | 0xA | ||
| 0x2 | |||
| Reserved | |||
|- | |- | ||
| | | 0xC | ||
| 0x2 | |||
| ReadRetryCount | |||
|- | |- | ||
| | | 0xE | ||
| 0x2 | |||
| TimeoutRetryErrorCount | |||
|} | |} | ||
= | = GameCardErrorReportInfo = | ||
This is "nn::fs:: | This is "nn::fs::GameCardErrorReportInfo". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Offset | ||
! Size | |||
! Description | |||
|- | |- | ||
| | | 0x0 | ||
| 0x10 | |||
| [[#GameCardErrorInfo|ErrorInfo]] | |||
|- | |- | ||
| | | 0x10 | ||
| 0x2 | |||
| AsicReinitializeFailureDetail | |||
|- | |- | ||
| | | 0x12 | ||
| 0x2 | |||
| InsertionCount | |||
|- | |- | ||
| | | 0x14 | ||
| 0x2 | |||
| RemovalCount | |||
|- | |- | ||
| | | 0x16 | ||
| | | 0x2 | ||
| AsicReinitializeCount | |||
|- | |- | ||
| 0x18 | |||
| 0x4 | |||
| AsicInitializeCount | |||
|- | |- | ||
| | | 0x1C | ||
| 0x2 | |||
| AsicReinitializeFailureCount | |||
|- | |- | ||
| | | 0x1E | ||
| 0x2 | |||
| AwakenFailureCount | |||
|- | |||
| 0x20 | |||
| 0x2 | |||
| Reserved | |||
|- | |- | ||
| | | 0x22 | ||
| 0x2 | |||
| RefreshCount | |||
|- | |- | ||
| | | 0x24 | ||
| 0x4 | |||
| LastReadErrorPageAddress | |||
|- | |- | ||
| | | 0x28 | ||
| 0x4 | |||
| LastReadErrorPageCount | |||
|- | |- | ||
| | | 0x2C | ||
| | | 0x4 | ||
| AwakenCount | |||
|- | |- | ||
| 0x30 | |||
| 0x4 | |||
| ReadCountFromInsert | |||
|- | |- | ||
| | | 0x34 | ||
| 0x4 | |||
| ReadCountFromAwaken | |||
|- | |- | ||
| | | 0x38 | ||
| 0x8 | |||
| Reserved | |||
|} | |} | ||
= | = GameCardHandle = | ||
This is "nn::fs:: | This is "nn::fs::GameCardHandle". This is an u32. | ||
= GameCardPartition = | |||
This is "nn::fs::GameCardPartition". | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 2,348: | Line 2,452: | ||
! Value || Name | ! Value || Name | ||
|- | |- | ||
| 0 || | | 0 || Update | ||
|- | |- | ||
| 1 || | | 1 || Normal | ||
|- | |||
| 2 || Secure | |||
|- | |||
| 3 || [4.0.0+] Logo | |||
|} | |} | ||
= | = GameCardPartitionRaw = | ||
This is "nn::fs:: | This is "nn::fs::GameCardPartitionRaw". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Value || Name | ||
|- | |- | ||
| | | 0 || NormalReadOnly | ||
| | |||
| | |||
|- | |- | ||
| | | 1 || SecureReadOnly | ||
| | |||
| | |||
|- | |- | ||
| | | 2 || RootWriteOnly | ||
| | |||
| | |||
|} | |} | ||
= | = GameCardAttribute = | ||
This is "nn:: | This is "nn::fs::GameCardAttribute". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Value || Name | ||
| | |||
| | |||
|- | |- | ||
| 1 || AutoBootFlag | |||
|- | |||
| 2 || HistoryEraseFlag | |||
|- | |||
| 4 || [4.0.0+] RepairToolFlag | |||
|- | |||
| 8 || [9.0.0+] DifferentRegionCupToTerraDeviceFlag | |||
|- | |||
| 16 || [9.0.0+] DifferentRegionCupToGlobalDeviceFlag | |||
|} | |||
= GameCardSize = | |||
This is "nn::fs::GameCardSize". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value || Name | |||
|- | |||
| 1 || Size1GB | |||
|- | |||
| 2 || Size2GB | |||
|- | |||
| 4 || Size4GB | |||
|- | |||
| 8 || Size8GB | |||
|- | |||
| 16 || Size16GB | |||
|- | |||
| 32 || Size32GB | |||
|} | |||
= GameCardClockRate = | |||
This is "nn::fs::GameCardClockRate". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value || Name | |||
|- | |||
| 25 || ClockRate25MHz | |||
|- | |||
| 50 || ClockRate50MHz | |||
|} | |||
= GameCardCompatibilityType = | |||
This is "nn::fs::GameCardCompatibilityType". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value || Name | |||
|- | |||
| 0 || Global | |||
|- | |||
| 1 || China | |||
|} | |||
= GameCardUpdatePartitionInfo = | |||
This is "nn::fs::GameCardUpdatePartitionInfo". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x4 | |||
| Version | |||
|- | |||
| 0x4 | |||
| 0x4 | |||
| Reserved | |||
|- | |||
| 0x8 | |||
| 0x8 | |||
| Id | |||
|} | |||
= GameCardIdSet = | |||
This is "nn::gc::GameCardIdSet". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x4 | |||
| [[#CardId1|Id1]] | |||
|- | |||
| 0x4 | |||
| 0x4 | |||
| [[#CardId2|Id2]] | |||
|- | |||
| 0x8 | |||
| 0x4 | |||
| [[#CardId3|Id3]] | |||
|} | |||
= CardId1 = | |||
This is "nn::gc::detail::CardId1". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x1 | |||
| [[#MakerCodeForCardId1|MakerCode]] | |||
|- | |||
| 0x1 | |||
| 0x1 | |||
| [[#MemoryCapacity|MemoryCapacity]] | |||
|- | |||
| 0x2 | |||
| 0x1 | |||
| Reserved | |||
|- | |||
| 0x3 | |||
| 0x1 | |||
| MemoryType | |||
|} | |||
= CardId2 = | |||
This is "nn::gc::detail::CardId2". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x1 | |||
| CardSecurityNumber | |||
|- | |||
| 0x1 | |||
| 0x1 | |||
| CardType | |||
|- | |||
| 0x2 | |||
| 0x2 | | 0x2 | ||
| Reserved | | Reserved | ||
|} | |} | ||
= | = CardId3 = | ||
This is "nn::gc::detail:: | This is "nn::gc::detail::CardId3". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 2,411: | Line 2,639: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
| | | 0x4 | ||
| Reserved | | Reserved | ||
|} | |} | ||
= | = MakerCodeForCardId1 = | ||
This is "nn::gc::detail:: | This is "nn::gc::detail::MakerCodeForCardId1". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Value || Name | ||
|- | |||
| 0x36 || Unknown | |||
|- | |||
| 0xC2 || MegaChips | |||
|- | |- | ||
| | | 0xAE || Lapis | ||
| | |||
| | |||
|} | |} | ||
= | = MemoryCapacity = | ||
This is "nn::gc:: | This is "nn::gc::detail::MemoryCapacity". | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Value || Name | ||
|- | |||
| 0xFA || 1GB | |||
|- | |||
| 0xF8 || 2GB | |||
|- | |||
| 0xF0 || 4GB | |||
|- | |- | ||
| | | 0xE0 || 8GB | ||
| | |||
| | |||
|- | |- | ||
| | | 0xE1 || 16GB | ||
| | |||
| | |||
|- | |- | ||
| | | 0xE2 || 32GB | ||
| | |||
| | |||
|} | |} | ||
Line 2,534: | Line 2,752: | ||
|} | |} | ||
= | = FspPath = | ||
This is "nn::fssrv::sf::FspPath". This is a 0x301-byte string. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" |