Mii Selector

Mii Selector

This is the library applet used to select a Mii. Internally it is called appletEd.

Launching the applet #

appletEd can be launched by calling APT:StartLibraryApplet with AppID 0x402. It expects a pointer to a buffer of 0x104 bytes to be passed as parameter. It does not use other resources, so an invalid handle of value 0 is expected.

After returning from the applet, part of the parameter buffer is filled with the data of any selected Mii and some other related values.

Parameter Buffer #

The applet can be configured to work in a flexible way by setting values in a 0x104 byte long buffer that is passed when launching it.

Index ByteSizeTypeNameDescription
0x00011*u8Cancel button flagIf set to a nonzero value, a Button labeled (B) Cancel is displayed at the bottom of the applet. This allows to cancel the selection of a Mii.
0x00111*u8Enable Guest Mii selection flagIf set to a nonzero value, 6 predefined Guest Miis can be selected on their own page.
0x00211*u8Show on top screen flagIf set to a nonzero value, the applet is displayed at the top screen instead of the touchscreen.
0x00355*u8UnknownMay be padding to align the following data to a 8-byte boundary.
0x008128 (0x80)64*u16TitleThis is a UTF16-LE[ 🔗 https://en.wikipedia.org/wiki/UTF-16%5D-encoded, zero-terminated string that is displayed at the top of the applet. If the first character is set to '\x0000' (null-terminator), a default title is displayed.
0x08844*u8UnknownMay be padding.
0x08C11*u8Show Guest Miis flagIf set to a nonzero value, the applet initially shows the page where the Guest Miis are located. Otherwise, it displays the user-created/-imported Miis after launch.
0x08D33*u8UnknownMay be padding to align the following data to a 8-byte boundary.
0x09041*u32Initially selected Mii indexIf set to a value i, the cursor is initially placed on the i+1st Mii in the Mii database. If Show Guest Miis is set and i is in [0,…,5], the cursor is placed on the i+1st Guest Mii. In any other case a user’s personal Mii is selected.
0x09466*u8Guest Mii whitelistFor each nonzero byte in this array, the corresponding Guest Mii is made selectable. Otherwise they are greyed out and can’t be selected.
0x09A100 (0x64)100*u8User Mii whitelistLike the above, only for the Miis found in the system’s database. A Mii’s index in this array corresponds to its index in the system database.
0x0FE21*u16UnknownMay be padding to align the following data to a 8-byte boundary.
0x10041*u32Magic value 0x13DE28CF (little Endian)Without this value, the applet refuses to display any Miis.

Return Buffer #

After selecting a Mii or canceling the operation, appletEd writes 0x84 byte to the parameter buffer it was passed, starting at offset 0.

Index ByteSizeTypeNameDescription
0x0041*u32Return codeSet to 1 if the action was canceled, 0 if a Mii was selected.
0x0441*u32Guest Mii selected flagSet to 1 if a Guest Mii was selected, 0 if it was a user Mii.
0x0841*u32Selected Guest Mii indexIf a Guest Mii was selected, this is set to the value corresponding to its index (i.e. 3 for Guest D). Set to 0xFFFFFFFF (-1) if a user Mii was selected.
0x0C92 (0x5c)1*struct miiSelected Mii dataIf a Mii was selected, its data is copied here. The same format as in the system’s Mii database is used.
0x6822*u8Unknown-
0x6a21*u16Mii data checksum (?)This may be a checksum of the returned Mii data.
0x6c2412*u16Guest Mii nameThe localized name as a UTF16-LE string of a Guest Mii if one was selected, zeroed otherwise.