loader, cfg: choose region based on language if multiple regions available
This commit is contained in:
parent
2ba62ec196
commit
697bc1a9c7
3 changed files with 28 additions and 17 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <cstring>
|
||||
#include <locale>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <fmt/format.h>
|
||||
#include "common/logging/log.h"
|
||||
#include "common/string_util.h"
|
||||
|
@ -136,13 +137,14 @@ void AppLoader_NCCH::ParseRegionLockoutInfo() {
|
|||
memcpy(&smdh, smdh_buffer.data(), sizeof(SMDH));
|
||||
u32 region_lockout = smdh.region_lockout;
|
||||
constexpr u32 REGION_COUNT = 7;
|
||||
std::vector<u32> regions;
|
||||
for (u32 region = 0; region < REGION_COUNT; ++region) {
|
||||
if (region_lockout & 1) {
|
||||
Service::CFG::GetCurrentModule()->SetPreferredRegionCode(region);
|
||||
break;
|
||||
regions.push_back(region);
|
||||
}
|
||||
region_lockout >>= 1;
|
||||
}
|
||||
Service::CFG::GetCurrentModule()->SetPreferredRegionCodes(regions);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue