1
mirror of https://github.com/yuzu-emu/yuzu synced 2024-11-14 20:31:26 +01:00

Merge pull request #3824 from ogniK5377/GetDisplayVersion

am: Properly implement GetDisplayVersion
This commit is contained in:
bunnei 2020-05-02 23:35:38 -04:00 committed by GitHub
commit 7459215933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1335,12 +1335,23 @@ void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) {
}
void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_AM, "(STUBBED) called");
LOG_DEBUG(Service_AM, "called");
std::array<u8, 0x10> version_string{};
FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()};
const auto res = pm.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));
}
IPC::ResponseBuilder rb{ctx, 6};
rb.Push(RESULT_SUCCESS);
rb.Push<u64>(1);
rb.Push<u64>(0);
rb.PushRaw(version_string);
}
void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) {