summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/service/acc/acc.cpp39
1 files changed, 31 insertions, 8 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 0cd8158df..fe4b0e7c3 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -36,20 +36,31 @@ static constexpr u32 SanitizeJPEGSize(std::size_t size) {
36 return static_cast<u32>(std::min(size, max_jpeg_image_size)); 36 return static_cast<u32>(std::min(size, max_jpeg_image_size));
37} 37}
38 38
39class IProfile final : public ServiceFramework<IProfile> { 39class IProfileCommon : public ServiceFramework<IProfileCommon> {
40public: 40public:
41 explicit IProfile(Common::UUID user_id, ProfileManager& profile_manager) 41 explicit IProfileCommon(const char* name, bool editor_commands, Common::UUID user_id,
42 : ServiceFramework("IProfile"), profile_manager(profile_manager), user_id(user_id) { 42 ProfileManager& profile_manager)
43 : ServiceFramework(name), profile_manager(profile_manager), user_id(user_id) {
43 static const FunctionInfo functions[] = { 44 static const FunctionInfo functions[] = {
44 {0, &IProfile::Get, "Get"}, 45 {0, &IProfileCommon::Get, "Get"},
45 {1, &IProfile::GetBase, "GetBase"}, 46 {1, &IProfileCommon::GetBase, "GetBase"},
46 {10, &IProfile::GetImageSize, "GetImageSize"}, 47 {10, &IProfileCommon::GetImageSize, "GetImageSize"},
47 {11, &IProfile::LoadImage, "LoadImage"}, 48 {11, &IProfileCommon::LoadImage, "LoadImage"},
48 }; 49 };
50
49 RegisterHandlers(functions); 51 RegisterHandlers(functions);
52
53 if (editor_commands) {
54 static const FunctionInfo editor_functions[] = {
55 {100, &IProfileCommon::Store, "Store"},
56 {101, &IProfileCommon::StoreWithImage, "StoreWithImage"},
57 };
58
59 RegisterHandlers(editor_functions);
60 }
50 } 61 }
51 62
52private: 63protected:
53 void Get(Kernel::HLERequestContext& ctx) { 64 void Get(Kernel::HLERequestContext& ctx) {
54 LOG_INFO(Service_ACC, "called user_id={}", user_id.Format()); 65 LOG_INFO(Service_ACC, "called user_id={}", user_id.Format());
55 ProfileBase profile_base{}; 66 ProfileBase profile_base{};
@@ -126,6 +137,18 @@ private:
126 Common::UUID user_id; ///< The user id this profile refers to. 137 Common::UUID user_id; ///< The user id this profile refers to.
127}; 138};
128 139
140class IProfile final : public IProfileCommon {
141public:
142 IProfile(Common::UUID user_id, ProfileManager& profile_manager)
143 : IProfileCommon("IProfile", false, user_id, profile_manager) {}
144};
145
146class IProfileEditor final : public IProfileCommon {
147public:
148 IProfileEditor(Common::UUID user_id, ProfileManager& profile_manager)
149 : IProfileCommon("IProfileEditor", true, user_id, profile_manager) {}
150};
151
129class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { 152class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
130public: 153public:
131 IManagerForApplication() : ServiceFramework("IManagerForApplication") { 154 IManagerForApplication() : ServiceFramework("IManagerForApplication") {