diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 1d2ee115..520ae1a6 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -857,6 +857,7 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings) g_dma.SetHaltTicks(g_settings.dma_halt_ticks); } +#ifndef LIBRETRO bool controllers_updated = false; for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++) { @@ -879,6 +880,7 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings) UpdateSoftwareCursor(); } } +#endif if (g_settings.multitap_mode != old_settings.multitap_mode) System::UpdateMultitaps(); diff --git a/src/core/settings.cpp b/src/core/settings.cpp index eff8ff30..fabc20ec 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -273,7 +273,8 @@ void Settings::Load(SettingsInterface& si) bios_patch_tty_enable = si.GetBoolValue("BIOS", "PatchTTYEnable", false); bios_patch_fast_boot = si.GetBoolValue("BIOS", "PatchFastBoot", DEFAULT_FAST_BOOT_VALUE); - /* controller_types[0] = +#ifndef LIBRETRO + controller_types[0] = ParseControllerTypeName( si.GetStringValue("Controller1", "Type", GetControllerTypeName(DEFAULT_CONTROLLER_1_TYPE)).c_str()) .value_or(DEFAULT_CONTROLLER_1_TYPE); @@ -285,7 +286,8 @@ void Settings::Load(SettingsInterface& si) GetControllerTypeName(DEFAULT_CONTROLLER_2_TYPE)) .c_str()) .value_or(DEFAULT_CONTROLLER_2_TYPE); - } */ + } +#endif memory_card_types[0] = ParseMemoryCardTypeName( diff --git a/src/duckstation-libretro/libretro_host_interface.cpp b/src/duckstation-libretro/libretro_host_interface.cpp index 32ac1d77..74e9b351 100644 --- a/src/duckstation-libretro/libretro_host_interface.cpp +++ b/src/duckstation-libretro/libretro_host_interface.cpp @@ -585,7 +585,7 @@ bool LibretroHostInterface::retro_load_game(const struct retro_game_info* game) void LibretroHostInterface::retro_set_controller_port_device(unsigned port, unsigned device) { if (port >= NUM_CONTROLLER_AND_CARD_PORTS) - return; + return; switch (device) { @@ -628,7 +628,7 @@ void LibretroHostInterface::retro_set_controller_port_device(unsigned port, unsi } System::UpdateControllers(); System::ResetControllers(); - System::UpdateControllerSettings(); + HostInterface::UpdateSoftwareCursor(); } void LibretroHostInterface::retro_run_frame() @@ -783,7 +783,9 @@ void LibretroHostInterface::OnSystemPaused(bool paused) {} void LibretroHostInterface::OnSystemDestroyed() {} -void LibretroHostInterface::OnControllerTypeChanged(u32 slot) {} +void LibretroHostInterface::OnControllerTypeChanged(u32 slot) { + Log_InfoPrintf("Why are we reading this?"); +} void LibretroHostInterface::SetMouseMode(bool relative, bool hide_cursor) {} @@ -939,7 +941,17 @@ void LibretroHostInterface::UpdateSettings() Settings::GetRendererDisplayName(g_settings.gpu_renderer)); g_settings.gpu_renderer = old_settings.gpu_renderer; } - + + for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++) + { + if (g_settings.controller_types[i] != old_settings.controller_types[i]) + { + ReportFormattedMessage("Switch to %s prevented. Sticking with %s.", + Settings::GetControllerTypeDisplayName(g_settings.controller_types[i]), Settings::GetControllerTypeDisplayName(old_settings.controller_types[i])); + g_settings.controller_types[i] = old_settings.controller_types[i]; + } + } + if (g_settings.memory_card_types[0] == MemoryCardType::Libretro && old_settings.memory_card_types[0] != MemoryCardType::Libretro) { ReportFormattedMessage("Setting memory card 1 to Save RAM mode will apply on core reload, to prevent save loss.");