Skip to content

Commit

Permalink
System: Preserve controller type on core settings reset
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Oct 20, 2022
1 parent 8e95248 commit b6686b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/core/settings.cpp
Expand Up @@ -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]));
Expand Down
4 changes: 4 additions & 0 deletions src/core/system.cpp
Expand Up @@ -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);
}

Expand Down

0 comments on commit b6686b8

Please sign in to comment.