Difference between revisions of "Cabinet Applet"

From Nintendo Switch Brew
Jump to navigation Jump to search
(Created page with "This is the cabinet (amiibo) applet. See AM_services#Library_Applets. == Library Applet Versions == {| class="wikitable" border="1" |- ! System Version || Value |- | [1.0...")
 
 
(5 intermediate revisions by one other user not shown)
Line 12: Line 12:
 
== AmiiboSettingsStartParam ==
 
== AmiiboSettingsStartParam ==
 
This is "nn::nfp::AmiiboSettingsStartParam".
 
This is "nn::nfp::AmiiboSettingsStartParam".
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 ||
 +
|-
 +
| 0x8 || 0x20 ||
 +
|-
 +
| 0x28 || 0x1 ||
 +
|}
  
 
== StartParamForAmiiboSettings ==
 
== StartParamForAmiiboSettings ==
Line 20: Line 31:
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x1A8 ||  
+
| 0x0 || 0x1 || Left at value 0 by sdknso.
 +
|-
 +
| 0x1 || 0x1 || Type
 +
|-
 +
| 0x2 || 0x1 || Flags
 +
|-
 +
| 0x3 || 0x1 || [[#AmiiboSettingsStartParam]]+0x28
 +
|-
 +
| 0x4 || 0x8 || [[#AmiiboSettingsStartParam]]+0x0
 +
|-
 +
| 0xC || 0x58 || [[NFC_services|nn::nfp::TagInfo]], only enabled when flags bit1 is set. If enabled, this must match the scanned amiibo.
 +
|-
 +
| 0x64 || 0x100 || [[NFC_services|nn::nfp::RegisterInfo]], only enabled when flags bit2 is set.
 +
|-
 +
| 0x164 || 0x20 || [[#StartParamForAmiiboSettings]]+0x8
 +
|-
 +
| 0x184 || 0x24 || Left at all-zero by sdknso.
 +
|}
 +
 
 +
Types:
 +
* 0 <code>StartNicknameAndOwnerSettings</code> If RegisterInfo is enabled, this will be used for writing, with an option for the user to change it.
 +
* 1 <code>StartGameDataEraser</code>
 +
* 2 <code>StartRestorer</code>
 +
* 3 <code>StartFormatter</code>
 +
 
 +
== AmiiboSettingsReturnFlag ==
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Cancel
 +
|-
 +
| 2 || Has [[NFC_services|nn::nfp::TagInfo]]
 +
|-
 +
| 4 || Has [[NFC_services|nn::nfp::RegisterInfo]]
 +
|-
 +
| 6 || Has TagInfo and RegisterInfo
 
|}
 
|}
  
Line 30: Line 78:
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x1 || Flags. 0 = error, non-zero = success.
+
| 0x0 || 0x1 || [[#AmiiboSettingsReturnFlag]]
 
|-
 
|-
 
| 0x1 || 0x3 || Padding
 
| 0x1 || 0x3 || Padding
Line 36: Line 84:
 
| 0x4 || 0x8 || [[NFC_services|nn::nfp::DeviceHandle]]
 
| 0x4 || 0x8 || [[NFC_services|nn::nfp::DeviceHandle]]
 
|-
 
|-
| 0xC || 0x58 ||  
+
| 0xC || 0x58 || [[NFC_services|nn::nfp::TagInfo]]
 
|-
 
|-
 
| 0x64 || 0x100 || [[NFC_services|nn::nfp::RegisterInfo]], only available when flags bit2 is set.
 
| 0x64 || 0x100 || [[NFC_services|nn::nfp::RegisterInfo]], only available when flags bit2 is set.
 
|-
 
|-
| 0x164 || 0x24 ||  
+
| 0x164 || 0x24 || Ignored by sdknso.
 
|}
 
|}
  

Latest revision as of 17:31, 24 March 2023

This is the cabinet (amiibo) applet. See AM_services#Library_Applets.

Library Applet Versions

System Version Value
[1.0.0+] 0x1

AmiiboSettingsStartParam

This is "nn::nfp::AmiiboSettingsStartParam".

Offset Size Description
0x0 0x8
0x8 0x20
0x28 0x1

StartParamForAmiiboSettings

This is "nn::nfp::StartParamForAmiiboSettings". This struct is 0x1A8-bytes.

Offset Size Description
0x0 0x1 Left at value 0 by sdknso.
0x1 0x1 Type
0x2 0x1 Flags
0x3 0x1 #AmiiboSettingsStartParam+0x28
0x4 0x8 #AmiiboSettingsStartParam+0x0
0xC 0x58 nn::nfp::TagInfo, only enabled when flags bit1 is set. If enabled, this must match the scanned amiibo.
0x64 0x100 nn::nfp::RegisterInfo, only enabled when flags bit2 is set.
0x164 0x20 #StartParamForAmiiboSettings+0x8
0x184 0x24 Left at all-zero by sdknso.

Types:

  • 0 StartNicknameAndOwnerSettings If RegisterInfo is enabled, this will be used for writing, with an option for the user to change it.
  • 1 StartGameDataEraser
  • 2 StartRestorer
  • 3 StartFormatter

AmiiboSettingsReturnFlag

Value Description
0 Cancel
2 Has nn::nfp::TagInfo
4 Has nn::nfp::RegisterInfo
6 Has TagInfo and RegisterInfo

ReturnValueForAmiiboSettings

This is "nn::nfp::ReturnValueForAmiiboSettings". This struct is 0x188-bytes.

Offset Size Description
0x0 0x1 #AmiiboSettingsReturnFlag
0x1 0x3 Padding
0x4 0x8 nn::nfp::DeviceHandle
0xC 0x58 nn::nfp::TagInfo
0x64 0x100 nn::nfp::RegisterInfo, only available when flags bit2 is set.
0x164 0x24 Ignored by sdknso.

Usage

User-processes should push a common arguments struct as well as the #StartParamForAmiiboSettings struct. Once the applet finishes running successfully, it will return an output storage containing a #ReturnValueForAmiiboSettings. sdknso doesn't validate the storage size, an error is thrown if #ReturnValueForAmiiboSettings+0x0 is 0.