summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-19 16:15:01 -0700
committerGravatar GitHub2018-07-19 16:15:01 -0700
commitaf08034c714996aaf87c7ba2461acd29af592f11 (patch)
tree8e9eec2298b48df3573cda74694f9b0cf8e0306d /src
parentMerge pull request #727 from Subv/acc_users (diff)
parentHLE/ACC: Return an IProfile that is consistent with what was requested. (diff)
downloadyuzu-af08034c714996aaf87c7ba2461acd29af592f11.tar.gz
yuzu-af08034c714996aaf87c7ba2461acd29af592f11.tar.xz
yuzu-af08034c714996aaf87c7ba2461acd29af592f11.zip
Merge pull request #728 from Subv/acc_profile
HLE/ACC: Change the default user id and small improvements to the way we handle profiles
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/acc/acc.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 0b17c7d5d..8ee39b54c 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -2,6 +2,7 @@
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 <array>
5#include "common/logging/log.h" 6#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h" 7#include "core/hle/ipc_helpers.h"
7#include "core/hle/service/acc/acc.h" 8#include "core/hle/service/acc/acc.h"
@@ -24,18 +25,17 @@ struct UserData {
24static_assert(sizeof(UserData) == 0x80, "UserData structure has incorrect size"); 25static_assert(sizeof(UserData) == 0x80, "UserData structure has incorrect size");
25 26
26struct ProfileBase { 27struct ProfileBase {
27 u8 user_id[0x10]; 28 u128 user_id;
28 u64 timestamp; 29 u64 timestamp;
29 u8 username[0x20]; 30 std::array<u8, 0x20> username;
30}; 31};
31static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase structure has incorrect size"); 32static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase structure has incorrect size");
32 33
33using Uid = std::array<u64, 2>; 34static constexpr u128 DEFAULT_USER_ID{1ull, 0ull};
34static constexpr Uid DEFAULT_USER_ID{0x10ull, 0x20ull};
35 35
36class IProfile final : public ServiceFramework<IProfile> { 36class IProfile final : public ServiceFramework<IProfile> {
37public: 37public:
38 IProfile() : ServiceFramework("IProfile") { 38 IProfile(u128 user_id) : ServiceFramework("IProfile"), user_id(user_id) {
39 static const FunctionInfo functions[] = { 39 static const FunctionInfo functions[] = {
40 {0, nullptr, "Get"}, 40 {0, nullptr, "Get"},
41 {1, &IProfile::GetBase, "GetBase"}, 41 {1, &IProfile::GetBase, "GetBase"},
@@ -48,11 +48,18 @@ public:
48private: 48private:
49 void GetBase(Kernel::HLERequestContext& ctx) { 49 void GetBase(Kernel::HLERequestContext& ctx) {
50 LOG_WARNING(Service_ACC, "(STUBBED) called"); 50 LOG_WARNING(Service_ACC, "(STUBBED) called");
51
52 // TODO(Subv): Retrieve this information from somewhere.
51 ProfileBase profile_base{}; 53 ProfileBase profile_base{};
54 profile_base.user_id = user_id;
55 profile_base.username = {'y', 'u', 'z', 'u'};
56
52 IPC::ResponseBuilder rb{ctx, 16}; 57 IPC::ResponseBuilder rb{ctx, 16};
53 rb.Push(RESULT_SUCCESS); 58 rb.Push(RESULT_SUCCESS);
54 rb.PushRaw(profile_base); 59 rb.PushRaw(profile_base);
55 } 60 }
61
62 u128 user_id; ///< The user id this profile refers to.
56}; 63};
57 64
58class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { 65class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
@@ -112,10 +119,12 @@ void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) {
112} 119}
113 120
114void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { 121void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
122 IPC::RequestParser rp{ctx};
123 u128 user_id = rp.PopRaw<u128>();
115 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 124 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
116 rb.Push(RESULT_SUCCESS); 125 rb.Push(RESULT_SUCCESS);
117 rb.PushIpcInterface<IProfile>(); 126 rb.PushIpcInterface<IProfile>(user_id);
118 LOG_DEBUG(Service_ACC, "called"); 127 LOG_DEBUG(Service_ACC, "called user_id=0x{:016X}{:016X}", user_id[1], user_id[0]);
119} 128}
120 129
121void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { 130void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) {