diff options
author | Liam <byteslice@airmail.cc> | 2023-07-15 02:16:39 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-08-08 17:09:37 +0200 |
commit | 84cb20bc72031947ac9e625b4a2b5e0059dda441 (patch) | |
tree | 94e816691b3800153f7955b03ae63cc36dfdb9dc /src/core/hle/service/glue | |
parent | Merge pull request #11216 from lat9nq/no-mesa-astc (diff) | |
download | yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.gz yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.bz2 yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.lz yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.xz yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.zst yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.zip |
Diffstat (limited to 'src/core/hle/service/glue')
-rw-r--r-- | src/core/hle/service/glue/arp.cpp | 36 | ||||
-rw-r--r-- | src/core/hle/service/glue/glue_manager.cpp | 11 | ||||
-rw-r--r-- | src/core/hle/service/glue/glue_manager.h | 4 |
3 files changed, 29 insertions, 22 deletions
diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp index ed6fcb5f6..6f1151b03 100644 --- a/src/core/hle/service/glue/arp.cpp +++ b/src/core/hle/service/glue/arp.cpp @@ -65,18 +65,19 @@ void ARP_R::GetApplicationLaunchProperty(HLERequestContext& ctx) { return; } - const auto res = manager.GetLaunchProperty(*title_id); + ApplicationLaunchProperty launch_property{}; + const auto res = manager.GetLaunchProperty(&launch_property, *title_id); - if (res.Failed()) { + if (res != ResultSuccess) { LOG_ERROR(Service_ARP, "Failed to get launch property!"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res.Code()); + rb.Push(res); return; } IPC::ResponseBuilder rb{ctx, 6}; rb.Push(ResultSuccess); - rb.PushRaw(*res); + rb.PushRaw(launch_property); } void ARP_R::GetApplicationLaunchPropertyWithApplicationId(HLERequestContext& ctx) { @@ -85,18 +86,19 @@ void ARP_R::GetApplicationLaunchPropertyWithApplicationId(HLERequestContext& ctx LOG_DEBUG(Service_ARP, "called, title_id={:016X}", title_id); - const auto res = manager.GetLaunchProperty(title_id); + ApplicationLaunchProperty launch_property{}; + const auto res = manager.GetLaunchProperty(&launch_property, title_id); - if (res.Failed()) { + if (res != ResultSuccess) { LOG_ERROR(Service_ARP, "Failed to get launch property!"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res.Code()); + rb.Push(res); return; } IPC::ResponseBuilder rb{ctx, 6}; rb.Push(ResultSuccess); - rb.PushRaw(*res); + rb.PushRaw(launch_property); } void ARP_R::GetApplicationControlProperty(HLERequestContext& ctx) { @@ -113,16 +115,17 @@ void ARP_R::GetApplicationControlProperty(HLERequestContext& ctx) { return; } - const auto res = manager.GetControlProperty(*title_id); + std::vector<u8> nacp_data; + const auto res = manager.GetControlProperty(&nacp_data, *title_id); - if (res.Failed()) { + if (res != ResultSuccess) { LOG_ERROR(Service_ARP, "Failed to get control property!"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res.Code()); + rb.Push(res); return; } - ctx.WriteBuffer(*res); + ctx.WriteBuffer(nacp_data); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); @@ -134,16 +137,17 @@ void ARP_R::GetApplicationControlPropertyWithApplicationId(HLERequestContext& ct LOG_DEBUG(Service_ARP, "called, title_id={:016X}", title_id); - const auto res = manager.GetControlProperty(title_id); + std::vector<u8> nacp_data; + const auto res = manager.GetControlProperty(&nacp_data, title_id); - if (res.Failed()) { + if (res != ResultSuccess) { LOG_ERROR(Service_ARP, "Failed to get control property!"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res.Code()); + rb.Push(res); return; } - ctx.WriteBuffer(*res); + ctx.WriteBuffer(nacp_data); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); diff --git a/src/core/hle/service/glue/glue_manager.cpp b/src/core/hle/service/glue/glue_manager.cpp index 4bf67921b..22f001704 100644 --- a/src/core/hle/service/glue/glue_manager.cpp +++ b/src/core/hle/service/glue/glue_manager.cpp @@ -15,7 +15,8 @@ ARPManager::ARPManager() = default; ARPManager::~ARPManager() = default; -ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) const { +Result ARPManager::GetLaunchProperty(ApplicationLaunchProperty* out_launch_property, + u64 title_id) const { if (title_id == 0) { return Glue::ResultInvalidProcessId; } @@ -25,10 +26,11 @@ ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) return Glue::ResultProcessIdNotRegistered; } - return iter->second.launch; + *out_launch_property = iter->second.launch; + return ResultSuccess; } -ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { +Result ARPManager::GetControlProperty(std::vector<u8>* out_control_property, u64 title_id) const { if (title_id == 0) { return Glue::ResultInvalidProcessId; } @@ -38,7 +40,8 @@ ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { return Glue::ResultProcessIdNotRegistered; } - return iter->second.control; + *out_control_property = iter->second.control; + return ResultSuccess; } Result ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch, diff --git a/src/core/hle/service/glue/glue_manager.h b/src/core/hle/service/glue/glue_manager.h index 1cf53d9d9..216aa34c1 100644 --- a/src/core/hle/service/glue/glue_manager.h +++ b/src/core/hle/service/glue/glue_manager.h @@ -32,12 +32,12 @@ public: // Returns the ApplicationLaunchProperty corresponding to the provided title ID if it was // previously registered, otherwise ResultProcessIdNotRegistered if it was never registered or // ResultInvalidProcessId if the title ID is 0. - ResultVal<ApplicationLaunchProperty> GetLaunchProperty(u64 title_id) const; + Result GetLaunchProperty(ApplicationLaunchProperty* out_launch_property, u64 title_id) const; // Returns a vector of the raw bytes of NACP data (necessarily 0x4000 in size) corresponding to // the provided title ID if it was previously registered, otherwise ResultProcessIdNotRegistered // if it was never registered or ResultInvalidProcessId if the title ID is 0. - ResultVal<std::vector<u8>> GetControlProperty(u64 title_id) const; + Result GetControlProperty(std::vector<u8>* out_control_property, u64 title_id) const; // Adds a new entry to the internal database with the provided parameters, returning // ResultProcessIdNotRegistered if attempting to re-register a title ID without an intermediate |