cfg: Only select preferred region once per instance. (#7284)
This commit is contained in:
parent
bd4ec251cd
commit
3113ae6616
|
@ -40,6 +40,7 @@ void Module::serialize(Archive& ar, const unsigned int) {
|
||||||
ar& cfg_config_file_buffer;
|
ar& cfg_config_file_buffer;
|
||||||
ar& cfg_system_save_data_archive;
|
ar& cfg_system_save_data_archive;
|
||||||
ar& preferred_region_code;
|
ar& preferred_region_code;
|
||||||
|
ar& preferred_region_chosen;
|
||||||
}
|
}
|
||||||
SERIALIZE_IMPL(Module)
|
SERIALIZE_IMPL(Module)
|
||||||
|
|
||||||
|
@ -656,9 +657,10 @@ static std::tuple<u32 /*region*/, SystemLanguage> AdjustLanguageInfoBlock(
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::UpdatePreferredRegionCode() {
|
void Module::UpdatePreferredRegionCode() {
|
||||||
if (!system.IsPoweredOn()) {
|
if (preferred_region_chosen || !system.IsPoweredOn()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
preferred_region_chosen = true;
|
||||||
|
|
||||||
const auto preferred_regions = system.GetAppLoader().GetPreferredRegions();
|
const auto preferred_regions = system.GetAppLoader().GetPreferredRegions();
|
||||||
if (preferred_regions.empty()) {
|
if (preferred_regions.empty()) {
|
||||||
|
|
|
@ -591,6 +591,7 @@ private:
|
||||||
std::array<u8, CONFIG_SAVEFILE_SIZE> cfg_config_file_buffer;
|
std::array<u8, CONFIG_SAVEFILE_SIZE> cfg_config_file_buffer;
|
||||||
std::unique_ptr<FileSys::ArchiveBackend> cfg_system_save_data_archive;
|
std::unique_ptr<FileSys::ArchiveBackend> cfg_system_save_data_archive;
|
||||||
u32 preferred_region_code = 0;
|
u32 preferred_region_code = 0;
|
||||||
|
bool preferred_region_chosen = false;
|
||||||
MCUData mcu_data{};
|
MCUData mcu_data{};
|
||||||
|
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
|
|
Reference in New Issue