diff options
| author | 2018-04-10 10:18:52 +0300 | |
|---|---|---|
| committer | 2018-04-10 10:18:52 +0300 | |
| commit | 3769a80faca76c7ed77540607fef03ef26b28501 (patch) | |
| tree | 7ef4349f360eafd9ed9bbcbfeefb29969be4e324 /src | |
| parent | Merge pull request #314 from jroweboy/tegra-progress-3b (diff) | |
| download | yuzu-3769a80faca76c7ed77540607fef03ef26b28501.tar.gz yuzu-3769a80faca76c7ed77540607fef03ef26b28501.tar.xz yuzu-3769a80faca76c7ed77540607fef03ef26b28501.zip | |
Service/ACC: convert to module, add acc:aa, acc:su, acc:u1 services
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc.cpp | 130 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc.h | 19 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_aa.cpp | 22 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_aa.h | 18 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_su.cpp | 55 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_su.h | 18 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_u0.cpp | 113 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_u0.h | 28 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_u1.cpp | 42 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_u1.h | 18 |
11 files changed, 342 insertions, 127 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 97d795d5f..9877b83fe 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -88,8 +88,14 @@ add_library(core STATIC | |||
| 88 | hle/romfs.h | 88 | hle/romfs.h |
| 89 | hle/service/acc/acc.cpp | 89 | hle/service/acc/acc.cpp |
| 90 | hle/service/acc/acc.h | 90 | hle/service/acc/acc.h |
| 91 | hle/service/acc/acc_aa.cpp | ||
| 92 | hle/service/acc/acc_aa.h | ||
| 93 | hle/service/acc/acc_su.cpp | ||
| 94 | hle/service/acc/acc_su.h | ||
| 91 | hle/service/acc/acc_u0.cpp | 95 | hle/service/acc/acc_u0.cpp |
| 92 | hle/service/acc/acc_u0.h | 96 | hle/service/acc/acc_u0.h |
| 97 | hle/service/acc/acc_u1.cpp | ||
| 98 | hle/service/acc/acc_u1.h | ||
| 93 | hle/service/am/am.cpp | 99 | hle/service/am/am.cpp |
| 94 | hle/service/am/am.h | 100 | hle/service/am/am.h |
| 95 | hle/service/am/applet_ae.cpp | 101 | hle/service/am/applet_ae.cpp |
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 5716577d6..cfb6e05a5 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp | |||
| @@ -2,14 +2,142 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/logging/log.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | ||
| 5 | #include "core/hle/service/acc/acc.h" | 7 | #include "core/hle/service/acc/acc.h" |
| 8 | #include "core/hle/service/acc/acc_aa.h" | ||
| 9 | #include "core/hle/service/acc/acc_su.h" | ||
| 6 | #include "core/hle/service/acc/acc_u0.h" | 10 | #include "core/hle/service/acc/acc_u0.h" |
| 11 | #include "core/hle/service/acc/acc_u1.h" | ||
| 7 | 12 | ||
| 8 | namespace Service { | 13 | namespace Service { |
| 9 | namespace Account { | 14 | namespace Account { |
| 10 | 15 | ||
| 16 | // TODO: RE this structure | ||
| 17 | struct UserData { | ||
| 18 | INSERT_PADDING_WORDS(1); | ||
| 19 | u32 icon_id; | ||
| 20 | u8 bg_color_id; | ||
| 21 | INSERT_PADDING_BYTES(0x7); | ||
| 22 | INSERT_PADDING_BYTES(0x10); | ||
| 23 | INSERT_PADDING_BYTES(0x60); | ||
| 24 | }; | ||
| 25 | static_assert(sizeof(UserData) == 0x80, "UserData structure has incorrect size"); | ||
| 26 | |||
| 27 | struct ProfileBase { | ||
| 28 | u8 user_id[0x10]; | ||
| 29 | u64 timestamp; | ||
| 30 | u8 username[0x20]; | ||
| 31 | }; | ||
| 32 | static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase structure has incorrect size"); | ||
| 33 | |||
| 34 | using Uid = std::array<u64, 2>; | ||
| 35 | static constexpr Uid DEFAULT_USER_ID{0x10ull, 0x20ull}; | ||
| 36 | |||
| 37 | class IProfile final : public ServiceFramework<IProfile> { | ||
| 38 | public: | ||
| 39 | IProfile() : ServiceFramework("IProfile") { | ||
| 40 | static const FunctionInfo functions[] = { | ||
| 41 | {1, &IProfile::GetBase, "GetBase"}, | ||
| 42 | }; | ||
| 43 | RegisterHandlers(functions); | ||
| 44 | } | ||
| 45 | |||
| 46 | private: | ||
| 47 | void GetBase(Kernel::HLERequestContext& ctx) { | ||
| 48 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 49 | ProfileBase profile_base{}; | ||
| 50 | IPC::ResponseBuilder rb{ctx, 16}; | ||
| 51 | rb.Push(RESULT_SUCCESS); | ||
| 52 | rb.PushRaw(profile_base); | ||
| 53 | } | ||
| 54 | }; | ||
| 55 | |||
| 56 | class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { | ||
| 57 | public: | ||
| 58 | IManagerForApplication() : ServiceFramework("IManagerForApplication") { | ||
| 59 | static const FunctionInfo functions[] = { | ||
| 60 | {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, | ||
| 61 | {1, &IManagerForApplication::GetAccountId, "GetAccountId"}, | ||
| 62 | }; | ||
| 63 | RegisterHandlers(functions); | ||
| 64 | } | ||
| 65 | |||
| 66 | private: | ||
| 67 | void CheckAvailability(Kernel::HLERequestContext& ctx) { | ||
| 68 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 69 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 70 | rb.Push(RESULT_SUCCESS); | ||
| 71 | rb.Push(true); // TODO: Check when this is supposed to return true and when not | ||
| 72 | } | ||
| 73 | |||
| 74 | void GetAccountId(Kernel::HLERequestContext& ctx) { | ||
| 75 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 76 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 77 | rb.Push(RESULT_SUCCESS); | ||
| 78 | rb.Push<u64>(0x12345678ABCDEF); | ||
| 79 | } | ||
| 80 | }; | ||
| 81 | |||
| 82 | void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { | ||
| 83 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 84 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 85 | rb.Push(RESULT_SUCCESS); | ||
| 86 | rb.Push(true); // TODO: Check when this is supposed to return true and when not | ||
| 87 | } | ||
| 88 | |||
| 89 | void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) { | ||
| 90 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 91 | constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID}; | ||
| 92 | ctx.WriteBuffer(user_ids.data(), user_ids.size()); | ||
| 93 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 94 | rb.Push(RESULT_SUCCESS); | ||
| 95 | } | ||
| 96 | |||
| 97 | void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { | ||
| 98 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 99 | constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID}; | ||
| 100 | ctx.WriteBuffer(user_ids.data(), user_ids.size()); | ||
| 101 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 102 | rb.Push(RESULT_SUCCESS); | ||
| 103 | } | ||
| 104 | |||
| 105 | void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { | ||
| 106 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 107 | rb.Push(RESULT_SUCCESS); | ||
| 108 | rb.PushIpcInterface<IProfile>(); | ||
| 109 | LOG_DEBUG(Service_ACC, "called"); | ||
| 110 | } | ||
| 111 | |||
| 112 | void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { | ||
| 113 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 114 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 115 | rb.Push(RESULT_SUCCESS); | ||
| 116 | } | ||
| 117 | |||
| 118 | void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { | ||
| 119 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 120 | rb.Push(RESULT_SUCCESS); | ||
| 121 | rb.PushIpcInterface<IManagerForApplication>(); | ||
| 122 | LOG_DEBUG(Service_ACC, "called"); | ||
| 123 | } | ||
| 124 | |||
| 125 | void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { | ||
| 126 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 127 | IPC::ResponseBuilder rb{ctx, 6}; | ||
| 128 | rb.Push(RESULT_SUCCESS); | ||
| 129 | rb.PushRaw(DEFAULT_USER_ID); | ||
| 130 | } | ||
| 131 | |||
| 132 | Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) | ||
| 133 | : ServiceFramework(name), module(std::move(module)) {} | ||
| 134 | |||
| 11 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 135 | void InstallInterfaces(SM::ServiceManager& service_manager) { |
| 12 | std::make_shared<ACC_U0>()->InstallAsService(service_manager); | 136 | auto module = std::make_shared<Module>(); |
| 137 | std::make_shared<ACC_AA>(module)->InstallAsService(service_manager); | ||
| 138 | std::make_shared<ACC_SU>(module)->InstallAsService(service_manager); | ||
| 139 | std::make_shared<ACC_U0>(module)->InstallAsService(service_manager); | ||
| 140 | std::make_shared<ACC_U1>(module)->InstallAsService(service_manager); | ||
| 13 | } | 141 | } |
| 14 | 142 | ||
| 15 | } // namespace Account | 143 | } // namespace Account |
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h index 44d024f48..2d2f57b7d 100644 --- a/src/core/hle/service/acc/acc.h +++ b/src/core/hle/service/acc/acc.h | |||
| @@ -9,6 +9,25 @@ | |||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace Account { | 10 | namespace Account { |
| 11 | 11 | ||
| 12 | class Module final { | ||
| 13 | public: | ||
| 14 | class Interface : public ServiceFramework<Interface> { | ||
| 15 | public: | ||
| 16 | Interface(std::shared_ptr<Module> module, const char* name); | ||
| 17 | |||
| 18 | void GetUserExistence(Kernel::HLERequestContext& ctx); | ||
| 19 | void ListAllUsers(Kernel::HLERequestContext& ctx); | ||
| 20 | void ListOpenUsers(Kernel::HLERequestContext& ctx); | ||
| 21 | void GetLastOpenedUser(Kernel::HLERequestContext& ctx); | ||
| 22 | void GetProfile(Kernel::HLERequestContext& ctx); | ||
| 23 | void InitializeApplicationInfo(Kernel::HLERequestContext& ctx); | ||
| 24 | void GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx); | ||
| 25 | |||
| 26 | protected: | ||
| 27 | std::shared_ptr<Module> module; | ||
| 28 | }; | ||
| 29 | }; | ||
| 30 | |||
| 12 | /// Registers all ACC services with the specified service manager. | 31 | /// Registers all ACC services with the specified service manager. |
| 13 | void InstallInterfaces(SM::ServiceManager& service_manager); | 32 | void InstallInterfaces(SM::ServiceManager& service_manager); |
| 14 | 33 | ||
diff --git a/src/core/hle/service/acc/acc_aa.cpp b/src/core/hle/service/acc/acc_aa.cpp new file mode 100644 index 000000000..76deaa07f --- /dev/null +++ b/src/core/hle/service/acc/acc_aa.cpp | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/acc/acc_aa.h" | ||
| 6 | |||
| 7 | namespace Service { | ||
| 8 | namespace Account { | ||
| 9 | |||
| 10 | ACC_AA::ACC_AA(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:aa") { | ||
| 11 | static const FunctionInfo functions[] = { | ||
| 12 | {0, nullptr, "EnsureCacheAsync"}, | ||
| 13 | {1, nullptr, "LoadCache"}, | ||
| 14 | {2, nullptr, "GetDeviceAccountId"}, | ||
| 15 | {50, nullptr, "RegisterNotificationTokenAsync"}, | ||
| 16 | {51, nullptr, "UnregisterNotificationTokenAsync"}, | ||
| 17 | }; | ||
| 18 | RegisterHandlers(functions); | ||
| 19 | } | ||
| 20 | |||
| 21 | } // namespace Account | ||
| 22 | } // namespace Service | ||
diff --git a/src/core/hle/service/acc/acc_aa.h b/src/core/hle/service/acc/acc_aa.h new file mode 100644 index 000000000..5069c6890 --- /dev/null +++ b/src/core/hle/service/acc/acc_aa.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/acc/acc.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace Account { | ||
| 11 | |||
| 12 | class ACC_AA final : public Module::Interface { | ||
| 13 | public: | ||
| 14 | explicit ACC_AA(std::shared_ptr<Module> module); | ||
| 15 | }; | ||
| 16 | |||
| 17 | } // namespace Account | ||
| 18 | } // namespace Service | ||
diff --git a/src/core/hle/service/acc/acc_su.cpp b/src/core/hle/service/acc/acc_su.cpp new file mode 100644 index 000000000..538f9d9b1 --- /dev/null +++ b/src/core/hle/service/acc/acc_su.cpp | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/acc/acc_su.h" | ||
| 6 | |||
| 7 | namespace Service { | ||
| 8 | namespace Account { | ||
| 9 | |||
| 10 | ACC_SU::ACC_SU(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:su") { | ||
| 11 | static const FunctionInfo functions[] = { | ||
| 12 | {0, nullptr, "GetUserCount"}, | ||
| 13 | {1, &ACC_SU::GetUserExistence, "GetUserExistence"}, | ||
| 14 | {2, &ACC_SU::ListAllUsers, "ListAllUsers"}, | ||
| 15 | {3, &ACC_SU::ListOpenUsers, "ListOpenUsers"}, | ||
| 16 | {4, &ACC_SU::GetLastOpenedUser, "GetLastOpenedUser"}, | ||
| 17 | {5, &ACC_SU::GetProfile, "GetProfile"}, | ||
| 18 | {6, nullptr, "GetProfileDigest"}, | ||
| 19 | {50, nullptr, "IsUserRegistrationRequestPermitted"}, | ||
| 20 | {51, nullptr, "TrySelectUserWithoutInteraction"}, | ||
| 21 | {60, nullptr, "ListOpenContextStoredUsers"}, | ||
| 22 | {100, nullptr, "GetUserRegistrationNotifier"}, | ||
| 23 | {101, nullptr, "GetUserStateChangeNotifier"}, | ||
| 24 | {102, nullptr, "GetBaasAccountManagerForSystemService"}, | ||
| 25 | {103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, | ||
| 26 | {104, nullptr, "GetProfileUpdateNotifier"}, | ||
| 27 | {105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, | ||
| 28 | {110, nullptr, "StoreSaveDataThumbnail"}, | ||
| 29 | {111, nullptr, "ClearSaveDataThumbnail"}, | ||
| 30 | {112, nullptr, "LoadSaveDataThumbnail"}, | ||
| 31 | {113, nullptr, "GetSaveDataThumbnailExistence"}, | ||
| 32 | {190, nullptr, "GetUserLastOpenedApplication"}, | ||
| 33 | {191, nullptr, "ActivateOpenContextHolder"}, | ||
| 34 | {200, nullptr, "BeginUserRegistration"}, | ||
| 35 | {201, nullptr, "CompleteUserRegistration"}, | ||
| 36 | {202, nullptr, "CancelUserRegistration"}, | ||
| 37 | {203, nullptr, "DeleteUser"}, | ||
| 38 | {204, nullptr, "SetUserPosition"}, | ||
| 39 | {205, nullptr, "GetProfileEditor"}, | ||
| 40 | {206, nullptr, "CompleteUserRegistrationForcibly"}, | ||
| 41 | {210, nullptr, "CreateFloatingRegistrationRequest"}, | ||
| 42 | {230, nullptr, "AuthenticateServiceAsync"}, | ||
| 43 | {250, nullptr, "GetBaasAccountAdministrator"}, | ||
| 44 | {290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, | ||
| 45 | {291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, | ||
| 46 | {299, nullptr, "SuspendBackgroundDaemon"}, | ||
| 47 | {997, nullptr, "DebugInvalidateTokenCacheForUser"}, | ||
| 48 | {998, nullptr, "DebugSetUserStateClose"}, | ||
| 49 | {999, nullptr, "DebugSetUserStateOpen"}, | ||
| 50 | }; | ||
| 51 | RegisterHandlers(functions); | ||
| 52 | } | ||
| 53 | |||
| 54 | } // namespace Account | ||
| 55 | } // namespace Service | ||
diff --git a/src/core/hle/service/acc/acc_su.h b/src/core/hle/service/acc/acc_su.h new file mode 100644 index 000000000..3894a6991 --- /dev/null +++ b/src/core/hle/service/acc/acc_su.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/acc/acc.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace Account { | ||
| 11 | |||
| 12 | class ACC_SU final : public Module::Interface { | ||
| 13 | public: | ||
| 14 | explicit ACC_SU(std::shared_ptr<Module> module); | ||
| 15 | }; | ||
| 16 | |||
| 17 | } // namespace Account | ||
| 18 | } // namespace Service | ||
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp index 52c3491d5..7b9c667ef 100644 --- a/src/core/hle/service/acc/acc_u0.cpp +++ b/src/core/hle/service/acc/acc_u0.cpp | |||
| @@ -2,120 +2,31 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/logging/log.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | ||
| 7 | #include "core/hle/service/acc/acc_u0.h" | 5 | #include "core/hle/service/acc/acc_u0.h" |
| 8 | 6 | ||
| 9 | namespace Service { | 7 | namespace Service { |
| 10 | namespace Account { | 8 | namespace Account { |
| 11 | 9 | ||
| 12 | using Uid = std::array<u64, 2>; | 10 | ACC_U0::ACC_U0(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:u0") { |
| 13 | static constexpr Uid DEFAULT_USER_ID{0x10ull, 0x20ull}; | ||
| 14 | |||
| 15 | class IProfile final : public ServiceFramework<IProfile> { | ||
| 16 | public: | ||
| 17 | IProfile() : ServiceFramework("IProfile") { | ||
| 18 | static const FunctionInfo functions[] = { | ||
| 19 | {1, &IProfile::GetBase, "GetBase"}, | ||
| 20 | }; | ||
| 21 | RegisterHandlers(functions); | ||
| 22 | } | ||
| 23 | |||
| 24 | private: | ||
| 25 | void GetBase(Kernel::HLERequestContext& ctx) { | ||
| 26 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 27 | ProfileBase profile_base{}; | ||
| 28 | IPC::ResponseBuilder rb{ctx, 16}; | ||
| 29 | rb.Push(RESULT_SUCCESS); | ||
| 30 | rb.PushRaw(profile_base); | ||
| 31 | } | ||
| 32 | }; | ||
| 33 | |||
| 34 | class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { | ||
| 35 | public: | ||
| 36 | IManagerForApplication() : ServiceFramework("IManagerForApplication") { | ||
| 37 | static const FunctionInfo functions[] = { | ||
| 38 | {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, | ||
| 39 | {1, &IManagerForApplication::GetAccountId, "GetAccountId"}, | ||
| 40 | }; | ||
| 41 | RegisterHandlers(functions); | ||
| 42 | } | ||
| 43 | |||
| 44 | private: | ||
| 45 | void CheckAvailability(Kernel::HLERequestContext& ctx) { | ||
| 46 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 47 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 48 | rb.Push(RESULT_SUCCESS); | ||
| 49 | rb.Push(true); // TODO: Check when this is supposed to return true and when not | ||
| 50 | } | ||
| 51 | |||
| 52 | void GetAccountId(Kernel::HLERequestContext& ctx) { | ||
| 53 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 54 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 55 | rb.Push(RESULT_SUCCESS); | ||
| 56 | rb.Push<u64>(0x12345678ABCDEF); | ||
| 57 | } | ||
| 58 | }; | ||
| 59 | |||
| 60 | void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) { | ||
| 61 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 62 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 63 | rb.Push(RESULT_SUCCESS); | ||
| 64 | rb.Push(true); // TODO: Check when this is supposed to return true and when not | ||
| 65 | } | ||
| 66 | |||
| 67 | void ACC_U0::ListAllUsers(Kernel::HLERequestContext& ctx) { | ||
| 68 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 69 | constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID}; | ||
| 70 | ctx.WriteBuffer(user_ids.data(), user_ids.size()); | ||
| 71 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 72 | rb.Push(RESULT_SUCCESS); | ||
| 73 | } | ||
| 74 | |||
| 75 | void ACC_U0::ListOpenUsers(Kernel::HLERequestContext& ctx) { | ||
| 76 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 77 | constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID}; | ||
| 78 | ctx.WriteBuffer(user_ids.data(), user_ids.size()); | ||
| 79 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 80 | rb.Push(RESULT_SUCCESS); | ||
| 81 | } | ||
| 82 | |||
| 83 | void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { | ||
| 84 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 85 | rb.Push(RESULT_SUCCESS); | ||
| 86 | rb.PushIpcInterface<IProfile>(); | ||
| 87 | LOG_DEBUG(Service_ACC, "called"); | ||
| 88 | } | ||
| 89 | |||
| 90 | void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { | ||
| 91 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 92 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 93 | rb.Push(RESULT_SUCCESS); | ||
| 94 | } | ||
| 95 | |||
| 96 | void ACC_U0::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { | ||
| 97 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 98 | rb.Push(RESULT_SUCCESS); | ||
| 99 | rb.PushIpcInterface<IManagerForApplication>(); | ||
| 100 | LOG_DEBUG(Service_ACC, "called"); | ||
| 101 | } | ||
| 102 | |||
| 103 | void ACC_U0::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { | ||
| 104 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | ||
| 105 | IPC::ResponseBuilder rb{ctx, 6}; | ||
| 106 | rb.Push(RESULT_SUCCESS); | ||
| 107 | rb.PushRaw(DEFAULT_USER_ID); | ||
| 108 | } | ||
| 109 | |||
| 110 | ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { | ||
| 111 | static const FunctionInfo functions[] = { | 11 | static const FunctionInfo functions[] = { |
| 12 | {0, nullptr, "GetUserCount"}, | ||
| 112 | {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, | 13 | {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, |
| 113 | {2, &ACC_U0::ListAllUsers, "ListAllUsers"}, | 14 | {2, &ACC_U0::ListAllUsers, "ListAllUsers"}, |
| 114 | {3, &ACC_U0::ListOpenUsers, "ListOpenUsers"}, | 15 | {3, &ACC_U0::ListOpenUsers, "ListOpenUsers"}, |
| 115 | {4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, | 16 | {4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, |
| 116 | {5, &ACC_U0::GetProfile, "GetProfile"}, | 17 | {5, &ACC_U0::GetProfile, "GetProfile"}, |
| 18 | {6, nullptr, "GetProfileDigest"}, | ||
| 19 | {50, nullptr, "IsUserRegistrationRequestPermitted"}, | ||
| 20 | {51, nullptr, "TrySelectUserWithoutInteraction"}, | ||
| 21 | {60, nullptr, "ListOpenContextStoredUsers"}, | ||
| 117 | {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, | 22 | {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, |
| 118 | {101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"}, | 23 | {101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"}, |
| 24 | {102, nullptr, "AuthenticateApplicationAsync"}, | ||
| 25 | {103, nullptr, "CheckNetworkServiceAvailabilityAsync"}, | ||
| 26 | {110, nullptr, "StoreSaveDataThumbnail"}, | ||
| 27 | {111, nullptr, "ClearSaveDataThumbnail"}, | ||
| 28 | {120, nullptr, "CreateGuestLoginRequest"}, | ||
| 29 | {130, nullptr, "LoadOpenContext"}, | ||
| 119 | }; | 30 | }; |
| 120 | RegisterHandlers(functions); | 31 | RegisterHandlers(functions); |
| 121 | } | 32 | } |
diff --git a/src/core/hle/service/acc/acc_u0.h b/src/core/hle/service/acc/acc_u0.h index 222f37282..d4f36e172 100644 --- a/src/core/hle/service/acc/acc_u0.h +++ b/src/core/hle/service/acc/acc_u0.h | |||
| @@ -4,36 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/acc/acc.h" |
| 8 | 8 | ||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace Account { | 10 | namespace Account { |
| 11 | 11 | ||
| 12 | // TODO: RE this structure | 12 | class ACC_U0 final : public Module::Interface { |
| 13 | struct UserData { | ||
| 14 | INSERT_PADDING_BYTES(0x80); | ||
| 15 | }; | ||
| 16 | static_assert(sizeof(UserData) == 0x80, "UserData structure has incorrect size"); | ||
| 17 | |||
| 18 | // TODO: RE this structure | ||
| 19 | struct ProfileBase { | ||
| 20 | INSERT_PADDING_BYTES(0x38); | ||
| 21 | }; | ||
| 22 | static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase structure has incorrect size"); | ||
| 23 | |||
| 24 | class ACC_U0 final : public ServiceFramework<ACC_U0> { | ||
| 25 | public: | 13 | public: |
| 26 | ACC_U0(); | 14 | explicit ACC_U0(std::shared_ptr<Module> module); |
| 27 | ~ACC_U0() = default; | ||
| 28 | |||
| 29 | private: | ||
| 30 | void GetUserExistence(Kernel::HLERequestContext& ctx); | ||
| 31 | void ListAllUsers(Kernel::HLERequestContext& ctx); | ||
| 32 | void ListOpenUsers(Kernel::HLERequestContext& ctx); | ||
| 33 | void GetLastOpenedUser(Kernel::HLERequestContext& ctx); | ||
| 34 | void GetProfile(Kernel::HLERequestContext& ctx); | ||
| 35 | void InitializeApplicationInfo(Kernel::HLERequestContext& ctx); | ||
| 36 | void GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx); | ||
| 37 | }; | 15 | }; |
| 38 | 16 | ||
| 39 | } // namespace Account | 17 | } // namespace Account |
diff --git a/src/core/hle/service/acc/acc_u1.cpp b/src/core/hle/service/acc/acc_u1.cpp new file mode 100644 index 000000000..dea353554 --- /dev/null +++ b/src/core/hle/service/acc/acc_u1.cpp | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/acc/acc_u1.h" | ||
| 6 | |||
| 7 | namespace Service { | ||
| 8 | namespace Account { | ||
| 9 | |||
| 10 | ACC_U1::ACC_U1(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:u1") { | ||
| 11 | static const FunctionInfo functions[] = { | ||
| 12 | {0, nullptr, "GetUserCount"}, | ||
| 13 | {1, &ACC_U1::GetUserExistence, "GetUserExistence"}, | ||
| 14 | {2, &ACC_U1::ListAllUsers, "ListAllUsers"}, | ||
| 15 | {3, &ACC_U1::ListOpenUsers, "ListOpenUsers"}, | ||
| 16 | {4, &ACC_U1::GetLastOpenedUser, "GetLastOpenedUser"}, | ||
| 17 | {5, &ACC_U1::GetProfile, "GetProfile"}, | ||
| 18 | {6, nullptr, "GetProfileDigest"}, | ||
| 19 | {50, nullptr, "IsUserRegistrationRequestPermitted"}, | ||
| 20 | {51, nullptr, "TrySelectUserWithoutInteraction"}, | ||
| 21 | {60, nullptr, "ListOpenContextStoredUsers"}, | ||
| 22 | {100, nullptr, "GetUserRegistrationNotifier"}, | ||
| 23 | {101, nullptr, "GetUserStateChangeNotifier"}, | ||
| 24 | {102, nullptr, "GetBaasAccountManagerForSystemService"}, | ||
| 25 | {103, nullptr, "GetProfileUpdateNotifier"}, | ||
| 26 | {104, nullptr, "CheckNetworkServiceAvailabilityAsync"}, | ||
| 27 | {105, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, | ||
| 28 | {110, nullptr, "StoreSaveDataThumbnail"}, | ||
| 29 | {111, nullptr, "ClearSaveDataThumbnail"}, | ||
| 30 | {112, nullptr, "LoadSaveDataThumbnail"}, | ||
| 31 | {113, nullptr, "GetSaveDataThumbnailExistence"}, | ||
| 32 | {190, nullptr, "GetUserLastOpenedApplication"}, | ||
| 33 | {191, nullptr, "ActivateOpenContextHolder"}, | ||
| 34 | {997, nullptr, "DebugInvalidateTokenCacheForUser"}, | ||
| 35 | {998, nullptr, "DebugSetUserStateClose"}, | ||
| 36 | {999, nullptr, "DebugSetUserStateOpen"}, | ||
| 37 | }; | ||
| 38 | RegisterHandlers(functions); | ||
| 39 | } | ||
| 40 | |||
| 41 | } // namespace Account | ||
| 42 | } // namespace Service | ||
diff --git a/src/core/hle/service/acc/acc_u1.h b/src/core/hle/service/acc/acc_u1.h new file mode 100644 index 000000000..432d5b3e9 --- /dev/null +++ b/src/core/hle/service/acc/acc_u1.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/acc/acc.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace Account { | ||
| 11 | |||
| 12 | class ACC_U1 final : public Module::Interface { | ||
| 13 | public: | ||
| 14 | explicit ACC_U1(std::shared_ptr<Module> module); | ||
| 15 | }; | ||
| 16 | |||
| 17 | } // namespace Account | ||
| 18 | } // namespace Service | ||