diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-07-03 14:55:54 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-07-03 14:55:54 +0200 |
commit | 39f6d57c34a06df0340d9f68776a397161c7c965 (patch) | |
tree | ca95e39282e0e7ef9724af3ca5a8c1c803f3b5a9 /src/core | |
parent | Merge pull request #2659 from FernandoS27/safe-caches (diff) | |
download | yuzu-39f6d57c34a06df0340d9f68776a397161c7c965.tar yuzu-39f6d57c34a06df0340d9f68776a397161c7c965.tar.gz yuzu-39f6d57c34a06df0340d9f68776a397161c7c965.tar.bz2 yuzu-39f6d57c34a06df0340d9f68776a397161c7c965.tar.lz yuzu-39f6d57c34a06df0340d9f68776a397161c7c965.tar.xz yuzu-39f6d57c34a06df0340d9f68776a397161c7c965.tar.zst yuzu-39f6d57c34a06df0340d9f68776a397161c7c965.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/acc/acc.cpp | 39 |
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) { return static_cast<u32>(std::min(size, max_jpeg_image_size)); } -class IProfile final : public ServiceFramework<IProfile> { +class IProfileCommon : public ServiceFramework<IProfileCommon> { public: - explicit IProfile(Common::UUID user_id, ProfileManager& profile_manager) - : ServiceFramework("IProfile"), profile_manager(profile_manager), user_id(user_id) { + explicit IProfileCommon(const char* name, bool editor_commands, Common::UUID user_id, + ProfileManager& profile_manager) + : ServiceFramework(name), profile_manager(profile_manager), user_id(user_id) { static const FunctionInfo functions[] = { - {0, &IProfile::Get, "Get"}, - {1, &IProfile::GetBase, "GetBase"}, - {10, &IProfile::GetImageSize, "GetImageSize"}, - {11, &IProfile::LoadImage, "LoadImage"}, + {0, &IProfileCommon::Get, "Get"}, + {1, &IProfileCommon::GetBase, "GetBase"}, + {10, &IProfileCommon::GetImageSize, "GetImageSize"}, + {11, &IProfileCommon::LoadImage, "LoadImage"}, }; + RegisterHandlers(functions); + + if (editor_commands) { + static const FunctionInfo editor_functions[] = { + {100, &IProfileCommon::Store, "Store"}, + {101, &IProfileCommon::StoreWithImage, "StoreWithImage"}, + }; + + RegisterHandlers(editor_functions); + } } -private: +protected: void Get(Kernel::HLERequestContext& ctx) { LOG_INFO(Service_ACC, "called user_id={}", user_id.Format()); ProfileBase profile_base{}; @@ -126,6 +137,18 @@ private: Common::UUID user_id; ///< The user id this profile refers to. }; +class IProfile final : public IProfileCommon { +public: + IProfile(Common::UUID user_id, ProfileManager& profile_manager) + : IProfileCommon("IProfile", false, user_id, profile_manager) {} +}; + +class IProfileEditor final : public IProfileCommon { +public: + IProfileEditor(Common::UUID user_id, ProfileManager& profile_manager) + : IProfileCommon("IProfileEditor", true, user_id, profile_manager) {} +}; + class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { public: IManagerForApplication() : ServiceFramework("IManagerForApplication") { |