summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar David Marcec2020-04-29 22:13:56 +1000
committerGravatar David Marcec2020-04-29 22:13:56 +1000
commit9acd336422a0d29d9ee80e93e5f323cfafa87faa (patch)
treebcb4bcfad1f0ff9dc7172bcdee909c7d24de5f59
parentMerge pull request #3771 from benru/dump-romfs-with-updates (diff)
downloadyuzu-9acd336422a0d29d9ee80e93e5f323cfafa87faa.tar.gz
yuzu-9acd336422a0d29d9ee80e93e5f323cfafa87faa.tar.xz
yuzu-9acd336422a0d29d9ee80e93e5f323cfafa87faa.zip
am: Properly implement GetDisplayVersion
Properly implement IApplicationFunctions::GetDisplayVersion
-rw-r--r--src/core/hle/service/am/am.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 5695d2521..276a3fc0c 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1343,12 +1343,23 @@ void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) {
1343} 1343}
1344 1344
1345void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { 1345void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
1346 LOG_WARNING(Service_AM, "(STUBBED) called"); 1346 LOG_DEBUG(Service_AM, "called");
1347
1348 std::array<u8, 0x10> version_string{};
1349
1350 FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()};
1351 const auto res = pm.GetControlMetadata();
1352 if (res.first != nullptr) {
1353 const auto& version = res.first->GetVersionString();
1354 std::copy(version.begin(), version.end(), version_string.begin());
1355 } else {
1356 const u128 default_version = {1, 0};
1357 std::memcpy(version_string.data(), default_version.data(), sizeof(u128));
1358 }
1347 1359
1348 IPC::ResponseBuilder rb{ctx, 6}; 1360 IPC::ResponseBuilder rb{ctx, 6};
1349 rb.Push(RESULT_SUCCESS); 1361 rb.Push(RESULT_SUCCESS);
1350 rb.Push<u64>(1); 1362 rb.PushRaw(version_string);
1351 rb.Push<u64>(0);
1352} 1363}
1353 1364
1354void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) { 1365void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) {