summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-02-05 23:24:47 -0500
committerGravatar bunnei2018-02-08 18:59:23 -0500
commitdc0a137e5b502329cd130c70bea093852233d1df (patch)
tree764e95c96db1d2f8577583f57aba0d93f482b4cb /src
parentMerge pull request #169 from bunnei/gpu-mem (diff)
downloadyuzu-dc0a137e5b502329cd130c70bea093852233d1df.tar.gz
yuzu-dc0a137e5b502329cd130c70bea093852233d1df.tar.xz
yuzu-dc0a137e5b502329cd130c70bea093852233d1df.zip
acc_u0: Implement ListAllUsers.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/acc/acc_u0.cpp16
-rw-r--r--src/core/hle/service/acc/acc_u0.h1
2 files changed, 15 insertions, 2 deletions
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp
index ff9f6cca8..ee7d07aa7 100644
--- a/src/core/hle/service/acc/acc_u0.cpp
+++ b/src/core/hle/service/acc/acc_u0.cpp
@@ -9,6 +9,9 @@
9namespace Service { 9namespace Service {
10namespace Account { 10namespace Account {
11 11
12using Uid = std::array<u64, 2>;
13static constexpr Uid DEFAULT_USER_ID{0x10ull, 0x20ull};
14
12class IProfile final : public ServiceFramework<IProfile> { 15class IProfile final : public ServiceFramework<IProfile> {
13public: 16public:
14 IProfile() : ServiceFramework("IProfile") { 17 IProfile() : ServiceFramework("IProfile") {
@@ -61,6 +64,15 @@ void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) {
61 rb.Push(true); // TODO: Check when this is supposed to return true and when not 64 rb.Push(true); // TODO: Check when this is supposed to return true and when not
62} 65}
63 66
67void ACC_U0::ListAllUsers(Kernel::HLERequestContext& ctx) {
68 constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID};
69 const auto& output_buffer = ctx.BufferDescriptorC()[0];
70 Memory::WriteBlock(output_buffer.Address(), user_ids.data(), user_ids.size());
71 IPC::ResponseBuilder rb{ctx, 2};
72 rb.Push(RESULT_SUCCESS);
73 LOG_DEBUG(Service_ACC, "called");
74}
75
64void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { 76void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) {
65 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 77 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
66 rb.Push(RESULT_SUCCESS); 78 rb.Push(RESULT_SUCCESS);
@@ -85,13 +97,13 @@ void ACC_U0::GetLastOpenedUser(Kernel::HLERequestContext& ctx) {
85 LOG_WARNING(Service_ACC, "(STUBBED) called"); 97 LOG_WARNING(Service_ACC, "(STUBBED) called");
86 IPC::ResponseBuilder rb{ctx, 6}; 98 IPC::ResponseBuilder rb{ctx, 6};
87 rb.Push(RESULT_SUCCESS); 99 rb.Push(RESULT_SUCCESS);
88 rb.Push<u64>(0x0); 100 rb.PushRaw(DEFAULT_USER_ID);
89 rb.Push<u64>(0x0);
90} 101}
91 102
92ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { 103ACC_U0::ACC_U0() : ServiceFramework("acc:u0") {
93 static const FunctionInfo functions[] = { 104 static const FunctionInfo functions[] = {
94 {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, 105 {1, &ACC_U0::GetUserExistence, "GetUserExistence"},
106 {2, &ACC_U0::ListAllUsers, "ListAllUsers"},
95 {4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, 107 {4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"},
96 {5, &ACC_U0::GetProfile, "GetProfile"}, 108 {5, &ACC_U0::GetProfile, "GetProfile"},
97 {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, 109 {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"},
diff --git a/src/core/hle/service/acc/acc_u0.h b/src/core/hle/service/acc/acc_u0.h
index b38c2f95e..d7732e75b 100644
--- a/src/core/hle/service/acc/acc_u0.h
+++ b/src/core/hle/service/acc/acc_u0.h
@@ -28,6 +28,7 @@ public:
28 28
29private: 29private:
30 void GetUserExistence(Kernel::HLERequestContext& ctx); 30 void GetUserExistence(Kernel::HLERequestContext& ctx);
31 void ListAllUsers(Kernel::HLERequestContext& ctx);
31 void GetLastOpenedUser(Kernel::HLERequestContext& ctx); 32 void GetLastOpenedUser(Kernel::HLERequestContext& ctx);
32 void GetProfile(Kernel::HLERequestContext& ctx); 33 void GetProfile(Kernel::HLERequestContext& ctx);
33 void InitializeApplicationInfo(Kernel::HLERequestContext& ctx); 34 void InitializeApplicationInfo(Kernel::HLERequestContext& ctx);