citra-emu
/
citra-canary
Archived
1
0
Fork 0

Mii Selector Applet: update Mii structures

This commit is contained in:
mailwl 2017-08-12 11:10:04 +03:00
parent 9b6dbe9b54
commit 589babbf74
2 changed files with 29 additions and 34 deletions

View File

@ -66,7 +66,7 @@ ResultCode MiiSelector::StartImpl(const Service::APT::AppletStartupParameter& pa
// continue. // continue.
MiiResult result; MiiResult result;
memset(&result, 0, sizeof(result)); memset(&result, 0, sizeof(result));
result.result_code = 0; result.return_code = 0;
// Let the application know that we're closing // Let the application know that we're closing
Service::APT::MessageParameter message; Service::APT::MessageParameter message;
@ -82,5 +82,5 @@ ResultCode MiiSelector::StartImpl(const Service::APT::AppletStartupParameter& pa
} }
void MiiSelector::Update() {} void MiiSelector::Update() {}
} } // namespace Applets
} // namespace } // namespace HLE

View File

@ -16,51 +16,46 @@ namespace HLE {
namespace Applets { namespace Applets {
struct MiiConfig { struct MiiConfig {
u8 unk_000; u8 cancel_button_flag;
u8 unk_001; u8 enable_guest_mii_flag;
u8 unk_002; u8 show_on_top_screen_flag;
u8 unk_003; INSERT_PADDING_BYTES(5);
u8 unk_004; u16 title[0x40];
INSERT_PADDING_BYTES(4);
u8 show_guest_miis_flag;
INSERT_PADDING_BYTES(3); INSERT_PADDING_BYTES(3);
u16 unk_008; u32 initially_selected_mii_index;
INSERT_PADDING_BYTES(0x82); u8 guest_mii_whitelist[6];
u8 unk_08C; u8 user_mii_whitelist[0x64];
INSERT_PADDING_BYTES(3);
u16 unk_090;
INSERT_PADDING_BYTES(2); INSERT_PADDING_BYTES(2);
u32 unk_094; u32 magic_value;
u16 unk_098;
u8 unk_09A[0x64];
u8 unk_0FE;
u8 unk_0FF;
u32 unk_100;
}; };
static_assert(sizeof(MiiConfig) == 0x104, "MiiConfig structure has incorrect size"); static_assert(sizeof(MiiConfig) == 0x104, "MiiConfig structure has incorrect size");
#define ASSERT_REG_POSITION(field_name, position) \ #define ASSERT_REG_POSITION(field_name, position) \
static_assert(offsetof(MiiConfig, field_name) == position, \ static_assert(offsetof(MiiConfig, field_name) == position, \
"Field " #field_name " has invalid position") "Field " #field_name " has invalid position")
ASSERT_REG_POSITION(unk_008, 0x08); ASSERT_REG_POSITION(title, 0x08);
ASSERT_REG_POSITION(unk_08C, 0x8C); ASSERT_REG_POSITION(show_guest_miis_flag, 0x8C);
ASSERT_REG_POSITION(unk_090, 0x90); ASSERT_REG_POSITION(initially_selected_mii_index, 0x90);
ASSERT_REG_POSITION(unk_094, 0x94); ASSERT_REG_POSITION(guest_mii_whitelist, 0x94);
ASSERT_REG_POSITION(unk_0FE, 0xFE);
#undef ASSERT_REG_POSITION #undef ASSERT_REG_POSITION
struct MiiResult { struct MiiResult {
u32 result_code; u32 return_code;
u8 unk_04; u32 guest_mii_selected_flag;
INSERT_PADDING_BYTES(7); u32 selected_guest_mii_index;
u8 unk_0C[0x60]; // TODO(mailwl): expand to Mii Format structure: https://www.3dbrew.org/wiki/Mii
u8 unk_6C[0x16]; u8 selected_mii_data[0x5C];
INSERT_PADDING_BYTES(2); INSERT_PADDING_BYTES(2);
u16 mii_data_checksum;
u16 guest_mii_name[0xC];
}; };
static_assert(sizeof(MiiResult) == 0x84, "MiiResult structure has incorrect size"); static_assert(sizeof(MiiResult) == 0x84, "MiiResult structure has incorrect size");
#define ASSERT_REG_POSITION(field_name, position) \ #define ASSERT_REG_POSITION(field_name, position) \
static_assert(offsetof(MiiResult, field_name) == position, \ static_assert(offsetof(MiiResult, field_name) == position, \
"Field " #field_name " has invalid position") "Field " #field_name " has invalid position")
ASSERT_REG_POSITION(unk_0C, 0x0C); ASSERT_REG_POSITION(selected_mii_data, 0x0C);
ASSERT_REG_POSITION(unk_6C, 0x6C); ASSERT_REG_POSITION(guest_mii_name, 0x6C);
#undef ASSERT_REG_POSITION #undef ASSERT_REG_POSITION
class MiiSelector final : public Applet { class MiiSelector final : public Applet {
@ -79,5 +74,5 @@ private:
MiiConfig config; MiiConfig config;
}; };
} } // namespace Applets
} // namespace } // namespace HLE