System: Preserve controller type on core settings reset

This commit is contained in:
Connor McLaughlin 2022-10-21 00:29:42 +10:00
parent 8e95248ef3
commit b6686b8239
2 changed files with 5 additions and 4 deletions

View file

@ -511,10 +511,7 @@ void Settings::Save(SettingsInterface& si) const
si.SetBoolValue("BIOS", "PatchFastBoot", bios_patch_fast_boot);
for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++)
{
si.SetStringValue(TinyString::FromFormat("Controller%u", i + 1u), "Type",
GetControllerTypeName(controller_types[i]));
}
si.SetStringValue(Controller::GetSettingsSection(i).c_str(), "Type", GetControllerTypeName(controller_types[i]));
si.SetStringValue("MemoryCards", "Card1Type", GetMemoryCardTypeName(memory_card_types[0]));
si.SetStringValue("MemoryCards", "Card2Type", GetMemoryCardTypeName(memory_card_types[1]));

View file

@ -800,6 +800,10 @@ void System::SetDefaultSettings(SettingsInterface& si)
temp.display_show_cpu = g_settings.display_show_cpu;
temp.display_show_gpu = g_settings.display_show_gpu;
// keep controller, we reset it elsewhere
for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++)
temp.controller_types[i] = g_settings.controller_types[i];
temp.Save(si);
}