Difference between revisions of "MiiEdit Applet"

From Nintendo Switch Brew
Jump to navigation Jump to search
Line 9: Line 9:
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || Always set to value 0x3.
+
| 0x0 || 0x4 || s32. Always set to value 0x3 ([10.2.0+] 0x4).
 
|-
 
|-
 
| 0x4 || 0x4 || [[#AppletMode]]
 
| 0x4 || 0x4 || [[#AppletMode]]
Line 16: Line 16:
 
|-
 
|-
 
| 0xC || 8*0x10(0x80) || ValidUuidArray ("nn::util::Uuid" array). Only used with [[#AppletMode]] AppendMiiImage/UpdateMiiImage.
 
| 0xC || 8*0x10(0x80) || ValidUuidArray ("nn::util::Uuid" array). Only used with [[#AppletMode]] AppendMiiImage/UpdateMiiImage.
 +
|-
 +
| 0xC || 0x58 || [10.2.0+] CharInfo. Only used with [[#AppletMode]] EditMii.
 
|-
 
|-
 
| 0x8C || 0x10 || UsedUuid ("nn::util::Uuid"). Only used with [[#AppletMode]] UpdateMiiImage.
 
| 0x8C || 0x10 || UsedUuid ("nn::util::Uuid"). Only used with [[#AppletMode]] UpdateMiiImage.
Line 37: Line 39:
  
 
When Result is Cancel with [[#AppletMode]] ShowMiiEdit, sdknso will return rc=0, same as Success.
 
When Result is Cancel with [[#AppletMode]] ShowMiiEdit, sdknso will return rc=0, same as Success.
 +
 +
== AppletOutputForCharInfoEditing ==
 +
This is "nn::mii::AppletOutputForCharInfoEditing". This struct is 0x80-bytes.
 +
 +
This was added with [10.2.0+].
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || Handled the same as [[#AppletOutput]]+0.
 +
|-
 +
| 0x4 || 0x58 || CharInfo
 +
|-
 +
| 0x5C || 0x24 || Unused
 +
|}
  
 
== AppletMode ==
 
== AppletMode ==
Line 52: Line 70:
 
|-
 
|-
 
| 3 || UpdateMiiImage
 
| 3 || UpdateMiiImage
 +
|-
 +
| 4 || [10.2.0+] CreateMii
 +
|-
 +
| 5 || [10.2.0+] EditMii
 
|-
 
|-
 
|}
 
|}
  
 
== Usage ==
 
== Usage ==
User-processes should push a storage containing the [[#AppletInput]] struct (commonargs is not used). Once the applet finishes running successfully, it will return an output storage containing an [[#AppletOutput]].
+
User-processes should push a storage containing the [[#AppletInput]] struct (commonargs is not used). Once the applet finishes running successfully, it will return an output storage containing an [[#AppletOutput]] ([[#AppletOutputForCharInfoEditing]] with [[#AppletMode]] CreateMii/EditMii).
  
 
[[Category:Library Applets]]
 
[[Category:Library Applets]]

Revision as of 04:32, 17 December 2020

This is the MiiEdit applet. See AM_services#Library_Applets.

AppletInput

This is "nn::mii::AppletInput". This struct is 0x100-bytes.

Offset Size Description
0x0 0x4 s32. Always set to value 0x3 ([10.2.0+] 0x4).
0x4 0x4 #AppletMode
0x8 0x4 SpecialMiiKeyCode
0xC 8*0x10(0x80) ValidUuidArray ("nn::util::Uuid" array). Only used with #AppletMode AppendMiiImage/UpdateMiiImage.
0xC 0x58 [10.2.0+] CharInfo. Only used with #AppletMode EditMii.
0x8C 0x10 UsedUuid ("nn::util::Uuid"). Only used with #AppletMode UpdateMiiImage.
0x9C 0x64 Unused by sdknso.

AppletOutput

This is "nn::mii::AppletOutput". This struct is 0x20-bytes.

Offset Size Description
0x0 0x4 Result: 0 = Success, 1 = Cancel.
0x4 0x4 s32 Index. Only set when Result is Success, where #AppletMode isn't ShowMiiEdit.
0x8 0x18 Unused by sdknso.

When Result is Cancel with #AppletMode ShowMiiEdit, sdknso will return rc=0, same as Success.

AppletOutputForCharInfoEditing

This is "nn::mii::AppletOutputForCharInfoEditing". This struct is 0x80-bytes.

This was added with [10.2.0+].

Offset Size Description
0x0 0x4 Handled the same as #AppletOutput+0.
0x4 0x58 CharInfo
0x5C 0x24 Unused

AppletMode

This is "nn::mii::AppletMode".

Value Description
0 ShowMiiEdit
1 AppendMii
2 AppendMiiImage
3 UpdateMiiImage
4 [10.2.0+] CreateMii
5 [10.2.0+] EditMii

Usage

User-processes should push a storage containing the #AppletInput struct (commonargs is not used). Once the applet finishes running successfully, it will return an output storage containing an #AppletOutput (#AppletOutputForCharInfoEditing with #AppletMode CreateMii/EditMii).