From 16d15f5c65b82092b1d4f5d3011525bf057479f0 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 15 Aug 2022 23:54:27 +1000 Subject: [PATCH] InputManager: Don't load bindings for inactive multitap ports --- src/core/settings.h | 4 ++++ src/frontend-common/input_manager.cpp | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/core/settings.h b/src/core/settings.h index f71e95315..eeaee635a 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -267,6 +267,10 @@ struct Settings { return (multitap_mode == MultitapMode::Port1Only || multitap_mode == MultitapMode::BothPorts); } + ALWAYS_INLINE bool IsMultitapPortEnabled(u32 port) const + { + return (port == 0) ? IsPort1MultitapEnabled() : IsPort2MultitapEnabled(); + } ALWAYS_INLINE static bool IsPerGameMemoryCardType(MemoryCardType type) { diff --git a/src/frontend-common/input_manager.cpp b/src/frontend-common/input_manager.cpp index 7223d0acb..380954a6f 100644 --- a/src/frontend-common/input_manager.cpp +++ b/src/frontend-common/input_manager.cpp @@ -924,6 +924,13 @@ void InputManager::CopyConfiguration(SettingsInterface* dest_si, const SettingsI for (u32 port = 0; port < NUM_CONTROLLER_AND_CARD_PORTS; port++) { + if (Controller::PadIsMultitapSlot(port)) + { + const auto [mt_port, mt_slot] = Controller::ConvertPadToPortAndSlot(port); + if (!g_settings.IsMultitapPortEnabled(mt_port)) + continue; + } + const std::string section(Controller::GetSettingsSection(port)); const std::string type(src_si.GetStringValue(section.c_str(), "Type", Controller::GetDefaultPadType(port))); if (copy_pad_config)