forked from ShuriZma/suyu
1
0
Fork 0

applets/mii: Cleanup MiiEdit applet types

This commit is contained in:
Morph 2022-03-17 05:15:48 -04:00
parent 7c44a4ede3
commit 1d5f6b173d
1 changed files with 44 additions and 23 deletions

View File

@ -12,8 +12,13 @@
namespace Service::AM::Applets { namespace Service::AM::Applets {
enum class MiiEditAppletVersion : s32 {
Version3 = 0x3, // 1.0.0 - 10.1.1
Version4 = 0x4, // 10.2.0+
};
// This is nn::mii::AppletMode // This is nn::mii::AppletMode
enum class MiiAppletMode : u32 { enum class MiiEditAppletMode : u32 {
ShowMiiEdit = 0, ShowMiiEdit = 0,
AppendMii = 1, AppendMii = 1,
AppendMiiImage = 2, AppendMiiImage = 2,
@ -22,41 +27,57 @@ enum class MiiAppletMode : u32 {
EditMii = 5, EditMii = 5,
}; };
struct MiiCharInfo { enum class MiiEditResult : u32 {
Service::Mii::MiiInfo mii_data{}; Success,
INSERT_PADDING_BYTES(0x28); Cancel,
}; };
static_assert(sizeof(MiiCharInfo) == 0x80, "MiiCharInfo has incorrect size.");
// This is nn::mii::AppletInput struct MiiEditCharInfo {
struct MiiAppletInput { Service::Mii::MiiInfo mii_info{};
s32 version{};
MiiAppletMode applet_mode{};
u32 special_mii_key_code{};
union {
std::array<Common::UUID, 8> valid_uuid;
MiiCharInfo mii_char_info;
}; };
Common::UUID used_uuid; static_assert(sizeof(MiiEditCharInfo) == 0x58, "MiiEditCharInfo has incorrect size.");
struct MiiEditAppletInputCommon {
MiiEditAppletVersion version{};
MiiEditAppletMode applet_mode{};
};
static_assert(sizeof(MiiEditAppletInputCommon) == 0x8,
"MiiEditAppletInputCommon has incorrect size.");
struct MiiEditAppletInputV3 {
u32 special_mii_key_code{};
std::array<Common::UUID, 8> valid_uuids{};
Common::UUID used_uuid{};
INSERT_PADDING_BYTES(0x64); INSERT_PADDING_BYTES(0x64);
}; };
static_assert(sizeof(MiiAppletInput) == 0x100, "MiiAppletInput has incorrect size."); static_assert(sizeof(MiiEditAppletInputV3) == 0x100 - sizeof(MiiEditAppletInputCommon),
"MiiEditAppletInputV3 has incorrect size.");
struct MiiEditAppletInputV4 {
u32 special_mii_key_code{};
MiiEditCharInfo char_info{};
INSERT_PADDING_BYTES(0x28);
Common::UUID used_uuid{};
INSERT_PADDING_BYTES(0x64);
};
static_assert(sizeof(MiiEditAppletInputV4) == 0x100 - sizeof(MiiEditAppletInputCommon),
"MiiEditAppletInputV4 has incorrect size.");
// This is nn::mii::AppletOutput // This is nn::mii::AppletOutput
struct MiiAppletOutput { struct MiiEditAppletOutput {
u32 result{}; MiiEditResult result{};
s32 index{}; s32 index{};
INSERT_PADDING_BYTES(0x18); INSERT_PADDING_BYTES(0x18);
}; };
static_assert(sizeof(MiiAppletOutput) == 0x20, "MiiAppletOutput has incorrect size."); static_assert(sizeof(MiiEditAppletOutput) == 0x20, "MiiEditAppletOutput has incorrect size.");
// This is nn::mii::AppletOutputForCharInfoEditing // This is nn::mii::AppletOutputForCharInfoEditing
struct AppletOutputForCharInfoEditing { struct MiiEditAppletOutputForCharInfoEditing {
u32 result{}; MiiEditResult result{};
Service::Mii::MiiInfo mii_data{}; MiiEditCharInfo char_info{};
INSERT_PADDING_BYTES(0x24); INSERT_PADDING_BYTES(0x24);
}; };
static_assert(sizeof(AppletOutputForCharInfoEditing) == 0x80, static_assert(sizeof(MiiEditAppletOutputForCharInfoEditing) == 0x80,
"AppletOutputForCharInfoEditing has incorrect size."); "MiiEditAppletOutputForCharInfoEditing has incorrect size.");
} // namespace Service::AM::Applets } // namespace Service::AM::Applets