diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp index 0f8bbf1468..ce61805a26 100644 --- a/src/core/hle/service/acc/acc_u0.cpp +++ b/src/core/hle/service/acc/acc_u0.cpp @@ -9,16 +9,64 @@ namespace Service { namespace Account { +class IProfile final : public ServiceFramework { +public: + IProfile() : ServiceFramework("IProfile") { + static const FunctionInfo functions[] = { + {0, &IProfile::Get, "Get"}, + {1, &IProfile::GetBase, "GetBase"}, + }; + RegisterHandlers(functions); + } + +private: + void Get(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + UserData user_data{}; + IPC::RequestBuilder rb{ctx, 11}; + rb.Push(RESULT_SUCCESS); + rb.PushRaw(user_data); + } + + void GetBase(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + ProfileBase profile_base{}; + IPC::RequestBuilder rb{ctx, 11}; + rb.Push(RESULT_SUCCESS); + rb.PushRaw(profile_base); + } +}; + +class IManagerForApplication final : public ServiceFramework { +public: + IManagerForApplication() : ServiceFramework("IProfile") { + static const FunctionInfo functions[] = { + {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, + }; + RegisterHandlers(functions); + } + +private: + void CheckAvailability(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + IPC::RequestBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + rb.Push(true); // TODO: Check when this is supposed to return true and when not + } +}; + void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); IPC::RequestBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); + rb.Push(true); // TODO: Check when this is supposed to return true and when not } void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2}; + IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface(); + LOG_DEBUG(Service, "called"); } void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { @@ -28,9 +76,10 @@ void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { } void ACC_U0::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2}; + IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface(); + LOG_DEBUG(Service, "called"); } ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { diff --git a/src/core/hle/service/acc/acc_u0.h b/src/core/hle/service/acc/acc_u0.h index db5bcc4649..51676e8594 100644 --- a/src/core/hle/service/acc/acc_u0.h +++ b/src/core/hle/service/acc/acc_u0.h @@ -9,6 +9,18 @@ namespace Service { namespace Account { +// TODO: RE this structure +struct UserData { + INSERT_PADDING_BYTES(0x80); +}; +static_assert(sizeof(UserData) == 0x80, "UserData structure has incorrect size"); + +// TODO: RE this structure +struct ProfileBase { + INSERT_PADDING_BYTES(0x38); +}; +static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase structure has incorrect size"); + class ACC_U0 final : public ServiceFramework { public: ACC_U0(); diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp index 1807900367..6a2c4bce1d 100644 --- a/src/core/hle/service/am/applet_oe.cpp +++ b/src/core/hle/service/am/applet_oe.cpp @@ -318,7 +318,7 @@ private: void GetDesiredLanguage(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); - rb.Push(1); // English? + rb.Push(SystemLanguage::English); LOG_WARNING(Service, "(STUBBED) called"); } diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h index beb75bf2ad..6ee5b0e9f8 100644 --- a/src/core/hle/service/am/applet_oe.h +++ b/src/core/hle/service/am/applet_oe.h @@ -10,6 +10,12 @@ namespace Service { namespace AM { +// TODO: Add more languages +enum SystemLanguage { + Japanese = 0, + English = 1, +}; + class AppletOE final : public ServiceFramework { public: AppletOE(); diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index 08671dfd60..3715acd742 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp @@ -13,9 +13,7 @@ namespace Service { namespace Set { void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { - constexpr std::array lang_codes{{ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - }}; + constexpr std::array lang_codes{}; const auto& output_buffer = ctx.BufferDescriptorC()[0];