Line 290: |
Line 290: |
| If the code were to request an invalid input type, panic. But this never happens. | | If the code were to request an invalid input type, panic. But this never happens. |
| | | |
− | === RwPermissions === | + | The output values for [[#ReadWrite]] CanMountRegisteredUpdatePartition and [[#Call]] CanRegisterUpdatePartition are masked with the cached value of [[SMC#IsDebugMode|DebugMode]]. |
| + | |
| + | === ReadWrite === |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Type(s) || Mask || Name || Value || Used by | + | ! AccessibilityType || Mask || Name || Value || Used by |
| |- | | |- |
| | 0x0 || 0x8000000000000801 || CanMountLogo || 1 || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]] | | | 0x0 || 0x8000000000000801 || CanMountLogo || 1 || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]] |
Line 315: |
Line 317: |
| | 0x9 || 0x8000000200000000<br/>([1.0.0-5.1.0] 0x8000000000000084) || CanMountCloudBackupWorkStorage || 3 || OpenCloudBackupWorkStorageFileSystem | | | 0x9 || 0x8000000200000000<br/>([1.0.0-5.1.0] 0x8000000000000084) || CanMountCloudBackupWorkStorage || 3 || OpenCloudBackupWorkStorageFileSystem |
| |- | | |- |
− | | 0xA || 0x8000000000000000<br/>([7.0.0-7.0.1] 0x4000000000000000)<br/>([6.0.0-6.2.0] 0x8000000000000084)<br/>([1.0.0-5.1.0] 0x8000000000000080) || CanMountCustomStorage || 3 || OpenCustomStorageFileSystem | + | | 0xA || 0x8000000000000000<br/>([7.0.0-7.0.1] 0x4000000000000000)<br/>([6.0.0-6.2.0] 0x8000000000000084)<br/>([1.0.0-5.1.0] 0x8000000000000080) || CanMountCustomStorage0 || 3 || OpenCustomStorageFileSystem |
| |- | | |- |
| | 0xB || 0x8000000000000084<br/>([6.0.0-6.2.0] 0x8000000000000080)<br/>([1.0.0-5.1.0] 0x8000000000008080) || CanMountBisCalibrationFile || 3 || [[#OpenBisFileSystem]] | | | 0xB || 0x8000000000000084<br/>([6.0.0-6.2.0] 0x8000000000000080)<br/>([1.0.0-5.1.0] 0x8000000000008080) || CanMountBisCalibrationFile || 3 || [[#OpenBisFileSystem]] |
Line 373: |
Line 375: |
| | 0x26 || 0x8000000000000080<br/>([6.0.0-6.2.0] 0xC000000000200000)<br/>([3.0.0-5.1.0] 0x8000000000000100)<br/>([1.0.0-2.3.0] 0xC000000000400000) || CanOpenBisPartitionSystemProperPartition || 3 || [[#OpenBisStorage]] | | | 0x26 || 0x8000000000000080<br/>([6.0.0-6.2.0] 0xC000000000200000)<br/>([3.0.0-5.1.0] 0x8000000000000100)<br/>([1.0.0-2.3.0] 0xC000000000400000) || CanOpenBisPartitionSystemProperPartition || 3 || [[#OpenBisStorage]] |
| |- | | |- |
− | | [3.0.0+] 0x27 || 0xC000000000200000<br/>([6.0.0-6.2.0] 0x8000000000000100)<br/>([1.0.0-5.1.0] 0x8000000000100008) || CanOpenSdCardStorage || || | + | | [3.0.0+] 0x27 || 0xC000000000200000<br/>([6.0.0-6.2.0] 0x8000000000000100)<br/>([3.0.0-5.1.0] 0x8000000000100008) || CanOpenSdCardStorage || || |
| |- | | |- |
− | | [3.0.0+] 0x28 || 0x8000000000000100<br/>([6.0.0-6.2.0] 0x8000000000100008)<br/>([1.0.0-5.1.0] 0xC000000000400000) || CanOpenGameCardStorage || 3 || [[#OpenGameCardStorage]], [[#EraseGameCard]] (bit1), [[#WriteToGameCard]] (bit1), [[#GetGameCardErrorInfo]] (bit1), [[#EraseAndWriteParamDirectly]] (bit1), [[#ReadParamDirectly]] (bit1), [[#ForceEraseGameCard]] (bit1) | + | | [3.0.0+] 0x28 || 0x8000000000000100<br/>([6.0.0-6.2.0] 0x8000000000100008)<br/>([3.0.0-5.1.0] 0xC000000000400000) || CanOpenGameCardStorage || 3 || [[#OpenGameCardStorage]], [[#EraseGameCard]] (bit1), [[#WriteToGameCard]] (bit1), [[#GetGameCardErrorInfo]] (bit1), [[#EraseAndWriteParamDirectly]] (bit1), [[#ReadParamDirectly]] (bit1), [[#ForceEraseGameCard]] (bit1) |
| |- | | |- |
− | | [4.0.0+] 0x29 || 0x8000000000100008<br/>([6.0.0-6.2.0] 0xC000000000400000)<br/>([1.0.0-5.1.0] 0x8000000000010000) || CanMountSystemDataPrivate || 1 || [[#OpenFileSystem]], [[#OpenDataStorageByDataId]] | + | | [4.0.0+] 0x29 || 0x8000000000100008<br/>([6.0.0-6.2.0] 0xC000000000400000)<br/>([4.0.0-5.1.0] 0x8000000000010000) || CanMountSystemDataPrivate || 1 || [[#OpenFileSystem]], [[#OpenDataStorageByDataId]] |
| |- | | |- |
− | | [5.0.0+] 0x2A || 0xC000000000400000<br/>([6.0.0-6.2.0] 0x8000000000010000)<br/>([1.0.0-5.1.0] 0x8000000000000000) || CanMountHost || 3 || [[#OpenHostFileSystem]] | + | | [5.0.0+] 0x2A || 0xC000000000400000<br/>([6.0.0-6.2.0] 0x8000000000010000)<br/>([5.0.0-5.1.0] 0x8000000000000000) || CanMountHost || 3 || [[#OpenHostFileSystem]] |
| |- | | |- |
− | | [6.0.0+] 0x2B || 0x8000000000010000<br/>([1.0.0-6.2.0]0x8000000000000000) || CanMountRegisteredUpdatePartition || 1 || [[#OpenRegisteredUpdatePartition]] | + | | [6.0.0+] 0x2B || 0x8000000000010000<br/>([6.0.0-6.2.0] 0x8000000000000000) || CanMountRegisteredUpdatePartition || 1 || [[#OpenRegisteredUpdatePartition]] |
| |- | | |- |
| | [7.0.0+] 0x2C || 0x8000000000000000 || CanOpenSaveDataInternalStorage || 3 || [[#OpenSaveDataInternalStorageFileSystem]] | | | [7.0.0+] 0x2C || 0x8000000000000000 || CanOpenSaveDataInternalStorage || 3 || [[#OpenSaveDataInternalStorageFileSystem]] |
Line 388: |
Line 390: |
| |} | | |} |
| | | |
− | === BoolPermissions === | + | === Call === |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Type(s) || Mask || Name || Used by | + | ! OperationType || Mask || Name || Used by |
| |- | | |- |
| | 0x0 || 0x8000000000000080 || CanInvalidateBisCache || [[#InvalidateBisCache]] | | | 0x0 || 0x8000000000000080 || CanInvalidateBisCache || [[#InvalidateBisCache]] |
Line 469: |
Line 471: |
| | [5.0.0+] 0x25 || 0x8000000200000000<br/>([1.0.0-5.1.0] 0x8000000080200000) || CanOpenSaveDataTransferManagerVersion2 || [[#OpenSaveDataTransferManagerVersion2]] | | | [5.0.0+] 0x25 || 0x8000000200000000<br/>([1.0.0-5.1.0] 0x8000000080200000) || CanOpenSaveDataTransferManagerVersion2 || [[#OpenSaveDataTransferManagerVersion2]] |
| |- | | |- |
− | | [5.0.0+] 0x26 || 0x8000000200000000<br/>([6.0.0-8.1.0] 0x8000000200002000)<br/>([5.0.0-5.1.0] 0x8000000080000110) || || OpenSaveDataTransferManagerForSaveDataRepair | + | | [5.0.0+] 0x26 || 0x8000000200000000<br/>([6.0.0-8.1.0] 0x8000000200002000)<br/>([5.0.0-5.1.0] 0x8000000080000110) || CanOpenSaveDataTransferManagerForSaveDataRepair || OpenSaveDataTransferManagerForSaveDataRepair |
| |- | | |- |
− | | [5.0.0+] 0x27 || 0x8000000000000000<br/>([8.0.0-8.1.0] 0x8000000240002000)<br/>([6.0.0-7.0.1] 0x8000000200002000)<br/>([5.0.0-5.1.0] 0x8000000000100008) || || OpenSaveDataTransferManagerForSaveDataRepair | + | | [5.0.0+] 0x27 || 0x8000000000000000<br/>([8.0.0-8.1.0] 0x8000000240002000)<br/>([6.0.0-7.0.1] 0x8000000200002000)<br/>([5.0.0-5.1.0] 0x8000000000100008) || CanOpenSaveDataTransferManagerForSaveDataRepairTool || OpenSaveDataTransferManagerForSaveDataRepair |
| |- | | |- |
| | [5.0.0+] 0x28 || 0x8000000200002000<br/>([6.0.0-8.1.0] 0x8000000000000000)<br/>([5.0.0-5.1.0] 0x8000000080010000) || CanOpenOpenSaveDataTransferProhibiter || [[#OpenSaveDataTransferProhibiter]] | | | [5.0.0+] 0x28 || 0x8000000200002000<br/>([6.0.0-8.1.0] 0x8000000000000000)<br/>([5.0.0-5.1.0] 0x8000000080010000) || CanOpenOpenSaveDataTransferProhibiter || [[#OpenSaveDataTransferProhibiter]] |
Line 513: |
Line 515: |
| | [9.0.0+] 0x3B || 0x8000000000000010 || CanChallengeCardExistence || ChallengeCardExistence | | | [9.0.0+] 0x3B || 0x8000000000000010 || CanChallengeCardExistence || ChallengeCardExistence |
| |- | | |- |
− | | [9.0.0+] 0x3C || 0x8000000800000000 || || [[#CreateSaveDataFileSystem]], CreateSaveDataFileSystemWithHashSalt | + | | [9.0.0+] 0x3C || 0x8000000800000000 || CanCreateOwnSaveData || [[#CreateSaveDataFileSystem]], CreateSaveDataFileSystemWithHashSalt |
| |- | | |- |
− | | [9.0.0+] 0x3D || 0x8000000800000000 || || [[#ReadSaveDataFileSystemExtraData]] | + | | [9.0.0+] 0x3D || 0x8000000800000000 || CanReadOwnSaveDataFileSystemExtraData || [[#ReadSaveDataFileSystemExtraData]] |
| |- | | |- |
− | | [9.0.0+] 0x3E || 0x8000000800000000 || || ExtendSaveDataFileSystem | + | | [9.0.0+] 0x3E || 0x8000000800000000 || CanExtendOwnSaveData || ExtendSaveDataFileSystem |
| |- | | |- |
− | | [9.0.0+] 0x3F || 0x8000000800000000 || || [[#OpenSaveDataTransferProhibiter]] | + | | [9.0.0+] 0x3F || 0x8000000800000000 || CanOpenOwnSaveDataTransferProhibiter || [[#OpenSaveDataTransferProhibiter]] |
| |- | | |- |
− | | [9.0.0+] 0x40 || 0x8000000800000000 || || [[#FindSaveDataWithFilter]] | + | | [9.0.0+] 0x40 || 0x8000000800000000 || CanFindOwnSaveDataWithFilter || [[#FindSaveDataWithFilter]] |
| |} | | |} |
| | | |
Line 569: |
Line 571: |
| | | |
| == CreateSaveDataFileSystem == | | == CreateSaveDataFileSystem == |
− | Takes a 0x40-byte Save-struct entry, a 0x40-byte SaveCreate-struct entry, and a 0x10-byte input struct. | + | Takes a 0x40-byte [[#SaveDataAttribute]], a 0x40-byte [[#SaveDataCreationInfo]], and a 0x10-byte input struct. |
| | | |
| Only the first 0x5-bytes in the 0x10-byte struct are initialized: all-zero when automatically creating savedata during savecommon mount by official user-processes. In the dedicated save-creation code in official user-processes: +0 u32 = 0x40060, +4 u8 = 1. | | Only the first 0x5-bytes in the 0x10-byte struct are initialized: all-zero when automatically creating savedata during savecommon mount by official user-processes. In the dedicated save-creation code in official user-processes: +0 u32 = 0x40060, +4 u8 = 1. |
Line 576: |
Line 578: |
| | | |
| == CreateSaveDataFileSystemBySystemSaveDataId == | | == CreateSaveDataFileSystemBySystemSaveDataId == |
− | Takes a 0x40-byte Save-struct entry and a 0x40-byte SaveCreate-struct entry. | + | Takes a 0x40-byte [[#SaveDataAttribute]] and a 0x40-byte [[#SaveDataCreationInfo]]. |
| | | |
| Creates savedata in the SYSTEM [[Flash_Filesystem|NAND]] partition. | | Creates savedata in the SYSTEM [[Flash_Filesystem|NAND]] partition. |
Line 592: |
Line 594: |
| | | |
| == OpenSaveDataFileSystem == | | == OpenSaveDataFileSystem == |
− | Takes an input u8 [[#SaveDataSpaceId]] and a 0x40-byte Save-struct entry. Official user-process code is only known to use value 1 for the u8. | + | Takes an input u8 [[#SaveDataSpaceId]] and a 0x40-byte [[#SaveDataAttribute]]. Official user-process code is only known to use value 1 for the u8. |
| | | |
| Returns an [[#IFileSystem]]. | | Returns an [[#IFileSystem]]. |
Line 601: |
Line 603: |
| | | |
| == OpenSaveDataFileSystemBySystemSaveDataId == | | == OpenSaveDataFileSystemBySystemSaveDataId == |
− | Takes an input u8 [[#SaveDataSpaceId]] and a 0x40-byte Save-struct entry. Web-applet only uses value0 for the input u8. | + | Takes an input u8 [[#SaveDataSpaceId]] and a 0x40-byte [[#SaveDataAttribute]]. Web-applet only uses value0 for the input u8. |
| | | |
| Returns an [[#IFileSystem]]. | | Returns an [[#IFileSystem]]. |
Line 654: |
Line 656: |
| | | |
| == OpenDataStorageByDataId == | | == OpenDataStorageByDataId == |
− | Takes a [[#StorageId]] and a TitleID. | + | Takes a [[NCM_services#StorageId|StorageID]] and a TitleID. |
| | | |
| Returns a [[IPC_Marshalling#Domain_message|domain object ID]] implementing the [[#IStorage]] interface for data archives. | | Returns a [[IPC_Marshalling#Domain_message|domain object ID]] implementing the [[#IStorage]] interface for data archives. |
Line 970: |
Line 972: |
| | 116 || [4.0.0+] ResumeMmcPatrol | | | 116 || [4.0.0+] ResumeMmcPatrol |
| |- | | |- |
− | | 200 || IsGameCardInserted | + | | 200 || [[#IsGameCardInserted]] |
| |- | | |- |
| | 201 || EraseGameCard | | | 201 || EraseGameCard |
| |- | | |- |
− | | 202 || GetGameCardHandle | + | | 202 || [[#GetGameCardHandle]] |
| |- | | |- |
| | 203 || [[#GetGameCardUpdatePartitionInfo]] | | | 203 || [[#GetGameCardUpdatePartitionInfo]] |
Line 982: |
Line 984: |
| | 205 || GetGameCardAttribute | | | 205 || GetGameCardAttribute |
| |- | | |- |
− | | 206 || GetGameCardDeviceCertificate | + | | 206 || [[#GetGameCardDeviceCertificate]] |
| |- | | |- |
| | 207 || GetGameCardAsicInfo | | | 207 || GetGameCardAsicInfo |
Line 1,008: |
Line 1,010: |
| | 218 || [3.0.0+] GetGameCardDeviceId | | | 218 || [3.0.0+] GetGameCardDeviceId |
| |- | | |- |
− | | 219 || [8.0.0+] ChallengeCardExistence | + | | 219 || [8.0.0+] [[#ChallengeCardExistence]] |
| |- | | |- |
− | | 220 || [9.0.0+] GetGameCardCompatibilityType | + | | 220 || [9.0.0+] [[#GetGameCardCompatibilityType]] |
| |- | | |- |
| | 300 || SetSpeedEmulationMode | | | 300 || SetSpeedEmulationMode |
Line 1,026: |
Line 1,028: |
| | 501 || [6.0.0+] [[#ClearDeviceSimulationEvent]] | | | 501 || [6.0.0+] [[#ClearDeviceSimulationEvent]] |
| |} | | |} |
| + | |
| + | == IsGameCardInserted == |
| + | No input, returns a bool. |
| + | |
| + | == GetGameCardHandle == |
| + | No input, returns an u32 '''GameCardHandle'''. |
| | | |
| == GetGameCardUpdatePartitionInfo == | | == GetGameCardUpdatePartitionInfo == |
Line 1,034: |
Line 1,042: |
| | | |
| [[NS_Services|NS]] appears to only use this with [[Content_Manager_services#GetTitleIdInfo]] and [[Content_Manager_services#GetUpdateTitleList]] with storageid=nandsys, for checking whether a sysupdate is required. | | [[NS_Services|NS]] appears to only use this with [[Content_Manager_services#GetTitleIdInfo]] and [[Content_Manager_services#GetUpdateTitleList]] with storageid=nandsys, for checking whether a sysupdate is required. |
| + | |
| + | == GetGameCardDeviceCertificate == |
| + | Takes a type-0x6 output buffer, an u32 '''GameCardHandle''' and an u64 '''DeviceCertificateBufferSize'''. No output. |
| + | |
| + | == ChallengeCardExistence == |
| + | Takes a type-0x6 output buffer, two type-0x5 input buffers and an u32 '''GameCardHandle'''. No output. |
| + | |
| + | [9.0.0+] The [[Account_services|account]] system module uses this as part of a new challenge-response mechanism for [[Network#aauth|application authentication]]. |
| + | |
| + | == GetGameCardCompatibilityType == |
| + | Takes an u32 '''GameCardHandle''', returns an u8 '''CompatibilityType''' (0x00 = Global, 0x01 = China) from [[Gamecard_Format#Gamecard_Info|Gamecard Info]]. |
| | | |
| == GetSdmmcConnectionStatus == | | == GetSdmmcConnectionStatus == |
Line 1,051: |
Line 1,070: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
− | | 0 || GetEventHandle | + | | 0 || [[#GetEventHandle]] |
| |} | | |} |
| + | |
| + | == GetEventHandle == |
| + | No input, returns an output Event handle. With official sw the EventClearMode is user-specified. |
| | | |
| = ISaveDataTransferManager = | | = ISaveDataTransferManager = |
Line 1,496: |
Line 1,518: |
| | 7 || ApplicationPackage | | | 7 || ApplicationPackage |
| |- | | |- |
− | | 8 || RegisteredUpdate | + | | 8 || [4.0.0+] RegisteredUpdate |
− | |}
| |
− | | |
− | = StorageId =
| |
− | {| class="wikitable" border="1"
| |
− | |-
| |
− | ! Value || Name
| |
− | |-
| |
− | | 0 || None
| |
− | |-
| |
− | | 1 || Host
| |
− | |-
| |
− | | 2 || GameCard
| |
− | |-
| |
− | | 3 || NandSystem
| |
− | |-
| |
− | | 4 || NandUser
| |
− | |-
| |
− | | 5 || SdCard
| |
| |} | | |} |
| | | |
Line 1,542: |
Line 1,546: |
| | 1 || User | | | 1 || User |
| |- | | |- |
− | | 2 || SdSystem | + | | 2 || SdCard |
| + | |- |
| + | | 3 || [3.0.0+] TemporaryStorage |
| |- | | |- |
| | 100 || [3.0.0+] ProperSystem | | | 100 || [3.0.0+] ProperSystem |
Line 1,550: |
Line 1,556: |
| | | |
| = SaveDataType = | | = SaveDataType = |
| + | This is "nn::fs::SaveDataType". |
| + | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 1,574: |
Line 1,582: |
| ! Value || Name | | ! Value || Name |
| |- | | |- |
− | | 0 || Nand | + | | 0 || System |
| |- | | |- |
| | 1 || SdCard | | | 1 || SdCard |
Line 1,581: |
Line 1,589: |
| = CloudBackupWorkStorageId = | | = CloudBackupWorkStorageId = |
| This is "nn::fs::CloudBackupWorkStorageId". | | This is "nn::fs::CloudBackupWorkStorageId". |
| + | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
| ! Value || Name | | ! Value || Name |
| |- | | |- |
− | | 0 || Nand | + | | 0 || System |
| |- | | |- |
| | 1 || SdCard | | | 1 || SdCard |
Line 1,597: |
Line 1,606: |
| ! Value || Name | | ! Value || Name |
| |- | | |- |
− | | 0 || Nand | + | | 0 || System |
| |- | | |- |
| | 1 || SdCard | | | 1 || SdCard |
Line 1,636: |
Line 1,645: |
| |} | | |} |
| | | |
− | = Save Struct = | + | = SaveDataAttribute = |
| This is "nn::fs::SaveDataAttribute". | | This is "nn::fs::SaveDataAttribute". |
| | | |
Line 1,690: |
Line 1,699: |
| For DeviceSaveData, this struct is all-zero except for the [[#SaveDataType]] field. | | For DeviceSaveData, this struct is all-zero except for the [[#SaveDataType]] field. |
| | | |
− | = SaveCreate Struct = | + | = SaveDataCreationInfo = |
| + | This is "nn::fs::SaveDataCreationInfo". |
| + | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 1,733: |
Line 1,744: |
| | | |
| = DeviceSaveData = | | = DeviceSaveData = |
− | This is accessed using the same commands for SaveData with the same input u8, the only difference compared to SaveData is the Save-struct. | + | This is accessed using the same commands for SaveData with the same input u8, the only difference compared to SaveData is the [[#SaveDataAttribute]]. |
| | | |
| = BcatSaveData = | | = BcatSaveData = |
− | This is accessed using the same commands for SaveData with the same input u8. The Save-struct is the same as DeviceSaveData, except that the titleID field is set to <input titleID>. See above regarding SaveCreate-struct. | + | This is accessed using the same commands for SaveData with the same input u8. The [[#SaveDataAttribute]] is the same as DeviceSaveData, except that the titleID field is set to <input titleID>. See above regarding [[#SaveDataCreationInfo]]. |
| | | |
| The 0x10-byte struct passed to [[#CreateSaveDataFileSystem]] has the first 0x5-bytes set to all-zero. | | The 0x10-byte struct passed to [[#CreateSaveDataFileSystem]] has the first 0x5-bytes set to all-zero. |