diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_u0.cpp | 61 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_u0.h | 15 | ||||
| -rw-r--r-- | src/core/hle/service/am/applet_oe.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/am/applet_oe.h | 6 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/set/set.cpp | 42 | ||||
| -rw-r--r-- | src/core/hle/service/set/set.h | 25 |
8 files changed, 161 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 57f578bae..8836ddf63 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -124,6 +124,8 @@ add_library(core STATIC | |||
| 124 | hle/service/pctl/pctl_a.h | 124 | hle/service/pctl/pctl_a.h |
| 125 | hle/service/service.cpp | 125 | hle/service/service.cpp |
| 126 | hle/service/service.h | 126 | hle/service/service.h |
| 127 | hle/service/set/set.cpp | ||
| 128 | hle/service/set/set.h | ||
| 127 | hle/service/sm/controller.cpp | 129 | hle/service/sm/controller.cpp |
| 128 | hle/service/sm/controller.h | 130 | hle/service/sm/controller.h |
| 129 | hle/service/sm/sm.cpp | 131 | hle/service/sm/sm.cpp |
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp index 147f4e62e..7f0192fd3 100644 --- a/src/core/hle/service/acc/acc_u0.cpp +++ b/src/core/hle/service/acc/acc_u0.cpp | |||
| @@ -9,15 +9,76 @@ | |||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace Account { | 10 | namespace Account { |
| 11 | 11 | ||
| 12 | class IProfile final : public ServiceFramework<IProfile> { | ||
| 13 | public: | ||
| 14 | IProfile() : ServiceFramework("IProfile") { | ||
| 15 | static const FunctionInfo functions[] = { | ||
| 16 | {1, &IProfile::GetBase, "GetBase"}, | ||
| 17 | }; | ||
| 18 | RegisterHandlers(functions); | ||
| 19 | } | ||
| 20 | |||
| 21 | private: | ||
| 22 | void GetBase(Kernel::HLERequestContext& ctx) { | ||
| 23 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 24 | ProfileBase profile_base{}; | ||
| 25 | IPC::RequestBuilder rb{ctx, 16}; | ||
| 26 | rb.Push(RESULT_SUCCESS); | ||
| 27 | rb.PushRaw(profile_base); | ||
| 28 | } | ||
| 29 | }; | ||
| 30 | |||
| 31 | class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { | ||
| 32 | public: | ||
| 33 | IManagerForApplication() : ServiceFramework("IProfile") { | ||
| 34 | static const FunctionInfo functions[] = { | ||
| 35 | {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, | ||
| 36 | }; | ||
| 37 | RegisterHandlers(functions); | ||
| 38 | } | ||
| 39 | |||
| 40 | private: | ||
| 41 | void CheckAvailability(Kernel::HLERequestContext& ctx) { | ||
| 42 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 43 | IPC::RequestBuilder rb{ctx, 3}; | ||
| 44 | rb.Push(RESULT_SUCCESS); | ||
| 45 | rb.Push(true); // TODO: Check when this is supposed to return true and when not | ||
| 46 | } | ||
| 47 | }; | ||
| 48 | |||
| 49 | void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) { | ||
| 50 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 51 | IPC::RequestBuilder rb{ctx, 3}; | ||
| 52 | rb.Push(RESULT_SUCCESS); | ||
| 53 | rb.Push(true); // TODO: Check when this is supposed to return true and when not | ||
| 54 | } | ||
| 55 | |||
| 56 | void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { | ||
| 57 | IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; | ||
| 58 | rb.Push(RESULT_SUCCESS); | ||
| 59 | rb.PushIpcInterface<IProfile>(); | ||
| 60 | LOG_DEBUG(Service, "called"); | ||
| 61 | } | ||
| 62 | |||
| 12 | void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { | 63 | void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { |
| 13 | LOG_WARNING(Service, "(STUBBED) called"); | 64 | LOG_WARNING(Service, "(STUBBED) called"); |
| 14 | IPC::RequestBuilder rb{ctx, 2}; | 65 | IPC::RequestBuilder rb{ctx, 2}; |
| 15 | rb.Push(RESULT_SUCCESS); | 66 | rb.Push(RESULT_SUCCESS); |
| 16 | } | 67 | } |
| 17 | 68 | ||
| 69 | void ACC_U0::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { | ||
| 70 | IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; | ||
| 71 | rb.Push(RESULT_SUCCESS); | ||
| 72 | rb.PushIpcInterface<IManagerForApplication>(); | ||
| 73 | LOG_DEBUG(Service, "called"); | ||
| 74 | } | ||
| 75 | |||
| 18 | ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { | 76 | ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { |
| 19 | static const FunctionInfo functions[] = { | 77 | static const FunctionInfo functions[] = { |
| 78 | {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, | ||
| 79 | {5, &ACC_U0::GetProfile, "GetProfile"}, | ||
| 20 | {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, | 80 | {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, |
| 81 | {101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"}, | ||
| 21 | }; | 82 | }; |
| 22 | RegisterHandlers(functions); | 83 | RegisterHandlers(functions); |
| 23 | } | 84 | } |
diff --git a/src/core/hle/service/acc/acc_u0.h b/src/core/hle/service/acc/acc_u0.h index ac243d5b8..51676e859 100644 --- a/src/core/hle/service/acc/acc_u0.h +++ b/src/core/hle/service/acc/acc_u0.h | |||
| @@ -9,13 +9,28 @@ | |||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace Account { | 10 | namespace Account { |
| 11 | 11 | ||
| 12 | // TODO: RE this structure | ||
| 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 | |||
| 12 | class ACC_U0 final : public ServiceFramework<ACC_U0> { | 24 | class ACC_U0 final : public ServiceFramework<ACC_U0> { |
| 13 | public: | 25 | public: |
| 14 | ACC_U0(); | 26 | ACC_U0(); |
| 15 | ~ACC_U0() = default; | 27 | ~ACC_U0() = default; |
| 16 | 28 | ||
| 17 | private: | 29 | private: |
| 30 | void GetUserExistence(Kernel::HLERequestContext& ctx); | ||
| 31 | void GetProfile(Kernel::HLERequestContext& ctx); | ||
| 18 | void InitializeApplicationInfo(Kernel::HLERequestContext& ctx); | 32 | void InitializeApplicationInfo(Kernel::HLERequestContext& ctx); |
| 33 | void GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx); | ||
| 19 | }; | 34 | }; |
| 20 | 35 | ||
| 21 | } // namespace Account | 36 | } // namespace Account |
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp index fd1b99a6d..687e65fe3 100644 --- a/src/core/hle/service/am/applet_oe.cpp +++ b/src/core/hle/service/am/applet_oe.cpp | |||
| @@ -286,6 +286,7 @@ public: | |||
| 286 | IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { | 286 | IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { |
| 287 | static const FunctionInfo functions[] = { | 287 | static const FunctionInfo functions[] = { |
| 288 | {1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"}, | 288 | {1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"}, |
| 289 | {21, &IApplicationFunctions::GetDesiredLanguage, "GetDesiredLanguage"}, | ||
| 289 | {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"}, | 290 | {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"}, |
| 290 | {66, &IApplicationFunctions::InitializeGamePlayRecording, | 291 | {66, &IApplicationFunctions::InitializeGamePlayRecording, |
| 291 | "InitializeGamePlayRecording"}, | 292 | "InitializeGamePlayRecording"}, |
| @@ -329,6 +330,13 @@ private: | |||
| 329 | LOG_WARNING(Service, "(STUBBED) called, result=0x%08X", result); | 330 | LOG_WARNING(Service, "(STUBBED) called, result=0x%08X", result); |
| 330 | } | 331 | } |
| 331 | 332 | ||
| 333 | void GetDesiredLanguage(Kernel::HLERequestContext& ctx) { | ||
| 334 | IPC::RequestBuilder rb{ctx, 4}; | ||
| 335 | rb.Push(RESULT_SUCCESS); | ||
| 336 | rb.Push<u64>(SystemLanguage::English); | ||
| 337 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 338 | } | ||
| 339 | |||
| 332 | void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) { | 340 | void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) { |
| 333 | IPC::RequestBuilder rb{ctx, 2}; | 341 | IPC::RequestBuilder rb{ctx, 2}; |
| 334 | rb.Push(RESULT_SUCCESS); | 342 | rb.Push(RESULT_SUCCESS); |
diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h index beb75bf2a..6ee5b0e9f 100644 --- a/src/core/hle/service/am/applet_oe.h +++ b/src/core/hle/service/am/applet_oe.h | |||
| @@ -10,6 +10,12 @@ | |||
| 10 | namespace Service { | 10 | namespace Service { |
| 11 | namespace AM { | 11 | namespace AM { |
| 12 | 12 | ||
| 13 | // TODO: Add more languages | ||
| 14 | enum SystemLanguage { | ||
| 15 | Japanese = 0, | ||
| 16 | English = 1, | ||
| 17 | }; | ||
| 18 | |||
| 13 | class AppletOE final : public ServiceFramework<AppletOE> { | 19 | class AppletOE final : public ServiceFramework<AppletOE> { |
| 14 | public: | 20 | public: |
| 15 | AppletOE(); | 21 | AppletOE(); |
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 9a49d9e9c..19213a2f4 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include "core/hle/service/nvdrv/nvdrv.h" | 24 | #include "core/hle/service/nvdrv/nvdrv.h" |
| 25 | #include "core/hle/service/pctl/pctl.h" | 25 | #include "core/hle/service/pctl/pctl.h" |
| 26 | #include "core/hle/service/service.h" | 26 | #include "core/hle/service/service.h" |
| 27 | #include "core/hle/service/set/set.h" | ||
| 27 | #include "core/hle/service/sm/controller.h" | 28 | #include "core/hle/service/sm/controller.h" |
| 28 | #include "core/hle/service/sm/sm.h" | 29 | #include "core/hle/service/sm/sm.h" |
| 29 | #include "core/hle/service/sockets/sockets.h" | 30 | #include "core/hle/service/sockets/sockets.h" |
| @@ -178,6 +179,7 @@ void Init() { | |||
| 178 | Sockets::InstallInterfaces(*SM::g_service_manager); | 179 | Sockets::InstallInterfaces(*SM::g_service_manager); |
| 179 | Time::InstallInterfaces(*SM::g_service_manager); | 180 | Time::InstallInterfaces(*SM::g_service_manager); |
| 180 | VI::InstallInterfaces(*SM::g_service_manager); | 181 | VI::InstallInterfaces(*SM::g_service_manager); |
| 182 | Set::InstallInterfaces(*SM::g_service_manager); | ||
| 181 | 183 | ||
| 182 | LOG_DEBUG(Service, "initialized OK"); | 184 | LOG_DEBUG(Service, "initialized OK"); |
| 183 | } | 185 | } |
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp new file mode 100644 index 000000000..3715acd74 --- /dev/null +++ b/src/core/hle/service/set/set.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 <chrono> | ||
| 6 | #include "common/logging/log.h" | ||
| 7 | #include "core/hle/ipc_helpers.h" | ||
| 8 | #include "core/hle/kernel/client_port.h" | ||
| 9 | #include "core/hle/kernel/client_session.h" | ||
| 10 | #include "core/hle/service/set/set.h" | ||
| 11 | |||
| 12 | namespace Service { | ||
| 13 | namespace Set { | ||
| 14 | |||
| 15 | void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { | ||
| 16 | constexpr std::array<u8, 13> lang_codes{}; | ||
| 17 | |||
| 18 | const auto& output_buffer = ctx.BufferDescriptorC()[0]; | ||
| 19 | |||
| 20 | Memory::WriteBlock(output_buffer.Address(), lang_codes.data(), lang_codes.size()); | ||
| 21 | |||
| 22 | IPC::RequestBuilder rb{ctx, 4}; | ||
| 23 | |||
| 24 | rb.Push(RESULT_SUCCESS); | ||
| 25 | rb.Push(static_cast<u64>(lang_codes.size())); | ||
| 26 | |||
| 27 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 28 | } | ||
| 29 | |||
| 30 | SET::SET(const char* name) : ServiceFramework(name) { | ||
| 31 | static const FunctionInfo functions[] = { | ||
| 32 | {1, &SET::GetAvailableLanguageCodes, "GetAvailableLanguageCodes"}, | ||
| 33 | }; | ||
| 34 | RegisterHandlers(functions); | ||
| 35 | } | ||
| 36 | |||
| 37 | void InstallInterfaces(SM::ServiceManager& service_manager) { | ||
| 38 | std::make_shared<SET>("set")->InstallAsService(service_manager); | ||
| 39 | } | ||
| 40 | |||
| 41 | } // namespace Set | ||
| 42 | } // namespace Service | ||
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h new file mode 100644 index 000000000..61e957946 --- /dev/null +++ b/src/core/hle/service/set/set.h | |||
| @@ -0,0 +1,25 @@ | |||
| 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/service.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace Set { | ||
| 11 | |||
| 12 | class SET final : public ServiceFramework<SET> { | ||
| 13 | public: | ||
| 14 | explicit SET(const char* name); | ||
| 15 | ~SET() = default; | ||
| 16 | |||
| 17 | private: | ||
| 18 | void GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx); | ||
| 19 | }; | ||
| 20 | |||
| 21 | /// Registers all Set services with the specified service manager. | ||
| 22 | void InstallInterfaces(SM::ServiceManager& service_manager); | ||
| 23 | |||
| 24 | } // namespace Set | ||
| 25 | } // namespace Service | ||