diff options
Diffstat (limited to 'src/emu/ioport.cpp')
-rw-r--r-- | src/emu/ioport.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index 3c88c319a8b..02713356bf7 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -2323,20 +2323,24 @@ void ioport_manager::load_game_config(util::xml::data_node const *portnode, int if (pos && (std::string_view::npos != pos)) { parent_tag = parent_tag.substr(0, pos); - for (pos = parent_tag.rfind(':'); pos && (std::string_view::npos != pos); pos = parent_tag.rfind(':')) + if (!machine().root_device().subdevice(parent_tag)) { - parent_tag = parent_tag.substr(0, pos); - device_t const *const parent_device(machine().root_device().subdevice(parent_tag)); - if (parent_device) + for (pos = parent_tag.rfind(':'); pos && (std::string_view::npos != pos); pos = parent_tag.rfind(':')) { - device_slot_interface const *slot; - if (parent_device->interface(slot)) + std::string_view const child_tag(parent_tag.substr(pos + 1)); + parent_tag = parent_tag.substr(0, pos); + device_t const *const parent_device(machine().root_device().subdevice(parent_tag)); + if (parent_device) { - if (!m_deselected_card_config) - m_deselected_card_config = util::xml::file::create().release(); - portnode->copy_into(*m_deselected_card_config); + device_slot_interface const *slot; + if (parent_device->interface(slot) && (slot->option_list().find(std::string(child_tag)) != slot->option_list().end())) + { + if (!m_deselected_card_config) + m_deselected_card_config = util::xml::file::create().release(); + portnode->copy_into(*m_deselected_card_config); + } + break; } - break; } } } |