diff options
author | Liam <byteslice@airmail.cc> | 2022-10-12 00:15:30 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-10-12 00:15:30 +0200 |
commit | 6bcd676b610773727f446a8c81bcca1c64a95b10 (patch) | |
tree | cbf54dcfae491b57034fcc6841f6eaa5f3ab29c2 /src/core/hle/service/ns/ns.cpp | |
parent | Merge pull request #9048 from Kelebek1/regs (diff) | |
download | yuzu-6bcd676b610773727f446a8c81bcca1c64a95b10.tar yuzu-6bcd676b610773727f446a8c81bcca1c64a95b10.tar.gz yuzu-6bcd676b610773727f446a8c81bcca1c64a95b10.tar.bz2 yuzu-6bcd676b610773727f446a8c81bcca1c64a95b10.tar.lz yuzu-6bcd676b610773727f446a8c81bcca1c64a95b10.tar.xz yuzu-6bcd676b610773727f446a8c81bcca1c64a95b10.tar.zst yuzu-6bcd676b610773727f446a8c81bcca1c64a95b10.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/ns/ns.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index f7318c3cb..f59a1a63d 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -8,6 +8,7 @@ #include "core/file_sys/patch_manager.h" #include "core/file_sys/vfs.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/service/glue/glue_manager.h" #include "core/hle/service/ns/errors.h" #include "core/hle/service/ns/iplatform_service_manager.h" #include "core/hle/service/ns/language.h" @@ -581,7 +582,7 @@ IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterfa : ServiceFramework{system_, "IReadOnlyApplicationControlDataInterface"} { // clang-format off static const FunctionInfo functions[] = { - {0, nullptr, "GetApplicationControlData"}, + {0, &IReadOnlyApplicationControlDataInterface::GetApplicationControlData, "GetApplicationControlData"}, {1, nullptr, "GetApplicationDesiredLanguage"}, {2, nullptr, "ConvertApplicationLanguageToLanguageCode"}, {3, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, @@ -594,6 +595,33 @@ IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterfa IReadOnlyApplicationControlDataInterface::~IReadOnlyApplicationControlDataInterface() = default; +void IReadOnlyApplicationControlDataInterface::GetApplicationControlData( + Kernel::HLERequestContext& ctx) { + enum class ApplicationControlSource : u8 { + CacheOnly, + Storage, + StorageOnly, + }; + + struct RequestParameters { + ApplicationControlSource source; + u64 application_id; + }; + static_assert(sizeof(RequestParameters) == 0x10, "RequestParameters has incorrect size."); + + IPC::RequestParser rp{ctx}; + const auto parameters{rp.PopRaw<RequestParameters>()}; + const auto nacp_data{system.GetARPManager().GetControlProperty(parameters.application_id)}; + const auto result = nacp_data ? ResultSuccess : ResultUnknown; + + if (nacp_data) { + ctx.WriteBuffer(nacp_data->data(), nacp_data->size()); + } + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(result); +} + NS::NS(const char* name, Core::System& system_) : ServiceFramework{system_, name} { // clang-format off static const FunctionInfo functions[] = { |