summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/acc/acc_u0.cpp61
-rw-r--r--src/core/hle/service/acc/acc_u0.h15
-rw-r--r--src/core/hle/service/am/applet_oe.cpp8
-rw-r--r--src/core/hle/service/am/applet_oe.h6
-rw-r--r--src/core/hle/service/service.cpp2
-rw-r--r--src/core/hle/service/set/set.cpp42
-rw-r--r--src/core/hle/service/set/set.h25
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 @@
9namespace Service { 9namespace Service {
10namespace Account { 10namespace Account {
11 11
12class IProfile final : public ServiceFramework<IProfile> {
13public:
14 IProfile() : ServiceFramework("IProfile") {
15 static const FunctionInfo functions[] = {
16 {1, &IProfile::GetBase, "GetBase"},
17 };
18 RegisterHandlers(functions);
19 }
20
21private:
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
31class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
32public:
33 IManagerForApplication() : ServiceFramework("IProfile") {
34 static const FunctionInfo functions[] = {
35 {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"},
36 };
37 RegisterHandlers(functions);
38 }
39
40private:
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
49void 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
56void 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
12void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { 63void 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
69void 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
18ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { 76ACC_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 @@
9namespace Service { 9namespace Service {
10namespace Account { 10namespace Account {
11 11
12// TODO: RE this structure
13struct UserData {
14 INSERT_PADDING_BYTES(0x80);
15};
16static_assert(sizeof(UserData) == 0x80, "UserData structure has incorrect size");
17
18// TODO: RE this structure
19struct ProfileBase {
20 INSERT_PADDING_BYTES(0x38);
21};
22static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase structure has incorrect size");
23
12class ACC_U0 final : public ServiceFramework<ACC_U0> { 24class ACC_U0 final : public ServiceFramework<ACC_U0> {
13public: 25public:
14 ACC_U0(); 26 ACC_U0();
15 ~ACC_U0() = default; 27 ~ACC_U0() = default;
16 28
17private: 29private:
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 @@
10namespace Service { 10namespace Service {
11namespace AM { 11namespace AM {
12 12
13// TODO: Add more languages
14enum SystemLanguage {
15 Japanese = 0,
16 English = 1,
17};
18
13class AppletOE final : public ServiceFramework<AppletOE> { 19class AppletOE final : public ServiceFramework<AppletOE> {
14public: 20public:
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
12namespace Service {
13namespace Set {
14
15void 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
30SET::SET(const char* name) : ServiceFramework(name) {
31 static const FunctionInfo functions[] = {
32 {1, &SET::GetAvailableLanguageCodes, "GetAvailableLanguageCodes"},
33 };
34 RegisterHandlers(functions);
35}
36
37void 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
9namespace Service {
10namespace Set {
11
12class SET final : public ServiceFramework<SET> {
13public:
14 explicit SET(const char* name);
15 ~SET() = default;
16
17private:
18 void GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx);
19};
20
21/// Registers all Set services with the specified service manager.
22void InstallInterfaces(SM::ServiceManager& service_manager);
23
24} // namespace Set
25} // namespace Service