diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.kt index 22bb47528b..c8057f2221 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.kt @@ -27,10 +27,10 @@ enum class IntSetting( MAIN_SLOT_B(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SlotB", 255), MAIN_SERIAL_PORT_1(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SerialPort1", 255), MAIN_FALLBACK_REGION(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "FallbackRegion", 2), - MAIN_SI_DEVICE_0(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SIDevice0", 6), - MAIN_SI_DEVICE_1(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SIDevice1", 0), - MAIN_SI_DEVICE_2(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SIDevice2", 0), - MAIN_SI_DEVICE_3(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SIDevice3", 0), + MAIN_SI_DEVICE_0(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SerialDevice1", 6), + MAIN_SI_DEVICE_1(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SerialDevice2", 0), + MAIN_SI_DEVICE_2(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SerialDevice3", 0), + MAIN_SI_DEVICE_3(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "SerialDevice4", 0), MAIN_AUDIO_VOLUME(Settings.FILE_DOLPHIN, Settings.SECTION_INI_DSP, "Volume", 100), MAIN_OVERLAY_GC_CONTROLLER( Settings.FILE_DOLPHIN, diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index c9cd0333a9..a284a6866d 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -145,16 +145,35 @@ const Info MAIN_BBA_BUILTIN_IP{{System::Main, "Core", "BBA_BUILTIN_ const Info& GetInfoForSIDevice(int channel) { + // Added on 2022-03-07 to migrate parameters, remove will be possible in a future version static const std::array, 4> infos{ - Info{{System::Main, "Core", "SIDevice0"}, - SerialInterface::SIDEVICE_GC_CONTROLLER}, - Info{{System::Main, "Core", "SIDevice1"}, - SerialInterface::SIDEVICE_NONE}, - Info{{System::Main, "Core", "SIDevice2"}, - SerialInterface::SIDEVICE_NONE}, - Info{{System::Main, "Core", "SIDevice3"}, - SerialInterface::SIDEVICE_NONE}, + Info{{System::Main, "Core", "SerialDevice1"}, + Config::Get(Info{ + {System::Main, "Core", "SIDevice0"},SerialInterface::SIDEVICE_GC_CONTROLLER})}, + Info{{System::Main, "Core", "SerialDevice2"}, + Config::Get(Info{ + {System::Main, "Core", "SIDevice1"},SerialInterface::SIDEVICE_NONE})}, + Info{{System::Main, "Core", "SerialDevice3"}, + Config::Get(Info{ + {System::Main, "Core", "SIDevice2"},SerialInterface::SIDEVICE_NONE})}, + Info{{System::Main, "Core", "SerialDevice4"}, + Config::Get(Info{ + {System::Main, "Core", "SIDevice3"},SerialInterface::SIDEVICE_NONE})}, }; + + // Next version that will replace the above + /* + static const std::array, 4> infos{ + Info{{System::Main, "Core", "SerialDevice1"}, + SerialInterface::SIDEVICE_GC_CONTROLLER}, + Info{{System::Main, "Core", "SerialDevice2"}, + SerialInterface::SIDEVICE_NONE}, + Info{{System::Main, "Core", "SerialDevice3"}, + SerialInterface::SIDEVICE_NONE}, + Info{{System::Main, "Core", "SerialDevice4"}, + SerialInterface::SIDEVICE_NONE}, + };*/ + return infos[channel]; } diff --git a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp index 020e8d6da3..30519e7baa 100644 --- a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp @@ -76,6 +76,10 @@ static const INIToLocationMap& GetINIToLocationMap() {{"Wii", "Language"}, {Config::SYSCONF_LANGUAGE.GetLocation()}}, {{"Core", "HLE_BS2"}, {Config::MAIN_SKIP_IPL.GetLocation()}}, {{"Core", "GameCubeLanguage"}, {Config::MAIN_GC_LANGUAGE.GetLocation()}}, + {{"Core", "SIDevice0"}, {Config::GetInfoForSIDevice(0).GetLocation()}}, + {{"Core", "SIDevice1"}, {Config::GetInfoForSIDevice(1).GetLocation()}}, + {{"Core", "SIDevice2"}, {Config::GetInfoForSIDevice(2).GetLocation()}}, + {{"Core", "SIDevice3"}, {Config::GetInfoForSIDevice(3).GetLocation()}}, {{"Controls", "PadType0"}, {Config::GetInfoForSIDevice(0).GetLocation()}}, {{"Controls", "PadType1"}, {Config::GetInfoForSIDevice(1).GetLocation()}}, {{"Controls", "PadType2"}, {Config::GetInfoForSIDevice(2).GetLocation()}},