summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrazyMax <mtabachenko@gmail.com>2020-07-08 19:45:06 +0300
committerCrazyMax <mtabachenko@gmail.com>2020-07-08 19:45:06 +0300
commitcf76769026ae417fa3822d499f6a55ef084ec2da (patch)
treeeb1d6774bba2ef7976f6471136307bead9a44df9
parent4e2464a713e79b86f819294e5c92ee261d0f81cd (diff)
AM: fix GetDesiredLanguage:
try to get a control metadata from application update when is failed to get from the basic version. Tested on Kirby Star Allies
-rw-r--r--src/core/hle/service/am/am.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 24cfb370b..32fad35f3 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1389,7 +1389,19 @@ void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) {
u32 supported_languages = 0;
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) {
supported_languages = res.first->GetSupportedLanguages();
}