summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Subv2018-07-19 16:53:42 -0500
committerGravatar Subv2018-07-19 16:53:42 -0500
commit05549e45c5ed746e1cf0f6218b4313ea8317745d (patch)
tree193d04a570d57e3535856dbf71482ffd063da0d6
parentHLE/ACC: Change the default user id to be consistent with what we tell games ... (diff)
downloadyuzu-05549e45c5ed746e1cf0f6218b4313ea8317745d.tar.gz
yuzu-05549e45c5ed746e1cf0f6218b4313ea8317745d.tar.xz
yuzu-05549e45c5ed746e1cf0f6218b4313ea8317745d.zip
HLE/ACC: Return an IProfile that is consistent with what was requested.
The default username for now is "yuzu". We should eventually allow the creation of users in the emulator and have the ability to modify their parameters.
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/acc/acc.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 83c723379..1a32faf0f 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,9 +25,9 @@ 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
@@ -34,7 +35,7 @@ static constexpr u128 DEFAULT_USER_ID{1ull, 0ull};
34 35
35class IProfile final : public ServiceFramework<IProfile> { 36class IProfile final : public ServiceFramework<IProfile> {
36public: 37public:
37 IProfile() : ServiceFramework("IProfile") { 38 IProfile(u128 user_id) : ServiceFramework("IProfile"), user_id(user_id) {
38 static const FunctionInfo functions[] = { 39 static const FunctionInfo functions[] = {
39 {0, nullptr, "Get"}, 40 {0, nullptr, "Get"},
40 {1, &IProfile::GetBase, "GetBase"}, 41 {1, &IProfile::GetBase, "GetBase"},
@@ -47,11 +48,18 @@ public:
47private: 48private:
48 void GetBase(Kernel::HLERequestContext& ctx) { 49 void GetBase(Kernel::HLERequestContext& ctx) {
49 LOG_WARNING(Service_ACC, "(STUBBED) called"); 50 LOG_WARNING(Service_ACC, "(STUBBED) called");
51
52 // TODO(Subv): Retrieve this information from somewhere.
50 ProfileBase profile_base{}; 53 ProfileBase profile_base{};
54 profile_base.user_id = user_id;
55 profile_base.username = {'y', 'u', 'z', 'u'};
56
51 IPC::ResponseBuilder rb{ctx, 16}; 57 IPC::ResponseBuilder rb{ctx, 16};
52 rb.Push(RESULT_SUCCESS); 58 rb.Push(RESULT_SUCCESS);
53 rb.PushRaw(profile_base); 59 rb.PushRaw(profile_base);
54 } 60 }
61
62 u128 user_id; ///< The user id this profile refers to.
55}; 63};
56 64
57class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { 65class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
@@ -109,10 +117,12 @@ void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) {
109} 117}
110 118
111void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { 119void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
120 IPC::RequestParser rp{ctx};
121 u128 user_id = rp.PopRaw<u128>();
112 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 122 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
113 rb.Push(RESULT_SUCCESS); 123 rb.Push(RESULT_SUCCESS);
114 rb.PushIpcInterface<IProfile>(); 124 rb.PushIpcInterface<IProfile>(user_id);
115 LOG_DEBUG(Service_ACC, "called"); 125 LOG_DEBUG(Service_ACC, "called user_id=0x{:016X}{:016X}", user_id[1], user_id[0]);
116} 126}
117 127
118void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { 128void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) {