InputManager: Don't load bindings for inactive multitap ports

This commit is contained in:
Connor McLaughlin 2022-08-15 23:54:27 +10:00
parent c656f5cbd7
commit 16d15f5c65
2 changed files with 11 additions and 0 deletions

View file

@ -267,6 +267,10 @@ struct Settings
{ {
return (multitap_mode == MultitapMode::Port1Only || multitap_mode == MultitapMode::BothPorts); 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) ALWAYS_INLINE static bool IsPerGameMemoryCardType(MemoryCardType type)
{ {

View file

@ -924,6 +924,13 @@ void InputManager::CopyConfiguration(SettingsInterface* dest_si, const SettingsI
for (u32 port = 0; port < NUM_CONTROLLER_AND_CARD_PORTS; port++) 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 section(Controller::GetSettingsSection(port));
const std::string type(src_si.GetStringValue(section.c_str(), "Type", Controller::GetDefaultPadType(port))); const std::string type(src_si.GetStringValue(section.c_str(), "Type", Controller::GetDefaultPadType(port)));
if (copy_pad_config) if (copy_pad_config)