diff options
| author | 2020-05-02 23:35:38 -0400 | |
|---|---|---|
| committer | 2020-05-02 23:35:38 -0400 | |
| commit | 7459215933bc27f9cbcfb260ca8a8b6177e8f918 (patch) | |
| tree | 6f6c75b79eec00f676bab4bb3465f7f621163eae /src | |
| parent | Merge pull request #3811 from ogniK5377/audin-init (diff) | |
| parent | Update src/core/hle/service/am/am.cpp (diff) | |
| download | yuzu-7459215933bc27f9cbcfb260ca8a8b6177e8f918.tar.gz yuzu-7459215933bc27f9cbcfb260ca8a8b6177e8f918.tar.xz yuzu-7459215933bc27f9cbcfb260ca8a8b6177e8f918.zip | |
Merge pull request #3824 from ogniK5377/GetDisplayVersion
am: Properly implement GetDisplayVersion
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 17 |
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 9450de6e9..a967e6ef7 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -1335,12 +1335,23 @@ void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) { | |||
| 1335 | } | 1335 | } |
| 1336 | 1336 | ||
| 1337 | void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { | 1337 | void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { |
| 1338 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 1338 | LOG_DEBUG(Service_AM, "called"); |
| 1339 | |||
| 1340 | std::array<u8, 0x10> version_string{}; | ||
| 1341 | |||
| 1342 | FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()}; | ||
| 1343 | const auto res = pm.GetControlMetadata(); | ||
| 1344 | if (res.first != nullptr) { | ||
| 1345 | const auto& version = res.first->GetVersionString(); | ||
| 1346 | std::copy(version.begin(), version.end(), version_string.begin()); | ||
| 1347 | } else { | ||
| 1348 | constexpr u128 default_version = {1, 0}; | ||
| 1349 | std::memcpy(version_string.data(), default_version.data(), sizeof(u128)); | ||
| 1350 | } | ||
| 1339 | 1351 | ||
| 1340 | IPC::ResponseBuilder rb{ctx, 6}; | 1352 | IPC::ResponseBuilder rb{ctx, 6}; |
| 1341 | rb.Push(RESULT_SUCCESS); | 1353 | rb.Push(RESULT_SUCCESS); |
| 1342 | rb.Push<u64>(1); | 1354 | rb.PushRaw(version_string); |
| 1343 | rb.Push<u64>(0); | ||
| 1344 | } | 1355 | } |
| 1345 | 1356 | ||
| 1346 | void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) { | 1357 | void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) { |