summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorAmeer <aj662@drexel.edu>2020-07-09 03:15:49 +0200
committerAmeer <aj662@drexel.edu>2020-07-09 03:15:49 +0200
commit4489ea6f532a501ca4cc379d8d8fb50ce1af27d7 (patch)
tree52f62331d39f338f6ae6d0fd56831bdd577943a9 /src/core/hle/service
parentAddress PR feedback, fix axis button thresholding (diff)
parentMerge pull request #4266 from jbeich/freebsd (diff)
downloadyuzu-4489ea6f532a501ca4cc379d8d8fb50ce1af27d7.tar
yuzu-4489ea6f532a501ca4cc379d8d8fb50ce1af27d7.tar.gz
yuzu-4489ea6f532a501ca4cc379d8d8fb50ce1af27d7.tar.bz2
yuzu-4489ea6f532a501ca4cc379d8d8fb50ce1af27d7.tar.lz
yuzu-4489ea6f532a501ca4cc379d8d8fb50ce1af27d7.tar.xz
yuzu-4489ea6f532a501ca4cc379d8d8fb50ce1af27d7.tar.zst
yuzu-4489ea6f532a501ca4cc379d8d8fb50ce1af27d7.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/am/am.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 1bb544dd8..24cfb370b 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -10,6 +10,7 @@
#include "core/core.h"
#include "core/file_sys/control_metadata.h"
#include "core/file_sys/patch_manager.h"
+#include "core/file_sys/registered_cache.h"
#include "core/file_sys/savedata_factory.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/kernel.h"
@@ -1353,14 +1354,25 @@ void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
std::array<u8, 0x10> version_string{};
- FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()};
- const auto res = pm.GetControlMetadata();
+ const auto res = [this] {
+ const auto title_id = system.CurrentProcess()->GetTitleID();
+
+ FileSys::PatchManager pm{title_id};
+ auto res = pm.GetControlMetadata();
+ if (res.first != nullptr) {
+ return res;
+ }
+
+ FileSys::PatchManager pm_update{FileSys::GetUpdateTitleID(title_id)};
+ return pm_update.GetControlMetadata();
+ }();
+
if (res.first != nullptr) {
const auto& version = res.first->GetVersionString();
std::copy(version.begin(), version.end(), version_string.begin());
} else {
- constexpr u128 default_version = {1, 0};
- std::memcpy(version_string.data(), default_version.data(), sizeof(u128));
+ constexpr char default_version[]{"1.0.0"};
+ std::memcpy(version_string.data(), default_version, sizeof(default_version));
}
IPC::ResponseBuilder rb{ctx, 6};