diff options
author | 2017-06-10 19:31:16 +1000 | |
---|---|---|
committer | 2017-06-10 19:31:16 +1000 | |
commit | 6975b237af5248e5dc260ca0477c480f64b3980e (patch) | |
tree | 4a59e0013ca178847785c50b32458920383d2fb2 | |
parent | 88b41d3566bfe00b31345cfea858bb039aaab070 (diff) |
Attempt basic validation of slot cards
Note that this currently segfaults on anything ISA, and probably other
stuff. For example, any of the following will crash:
* mame -valid c386sx16
* mame -valid 386i
* mame -valid b128
Pushing before dinner so others can take a look
-rw-r--r-- | src/emu/validity.cpp | 21 | ||||
-rw-r--r-- | src/emu/validity.h | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index b4fca6495b1..d8d4829c9ff 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -1831,6 +1831,27 @@ void validity_checker::validate_devices() // done with this device m_current_device = nullptr; + + // if it's a slot, iterate over possible cards (don't recurse, or you'll stack infinite tee connectors) + device_slot_interface *const slot = dynamic_cast<device_slot_interface *>(&device); + if (slot && !slot->fixed()) + { + for (auto &option : slot->option_list()) + { + if (option.second->selectable()) + { + device_t *const card = m_current_config->device_add(&slot->device(), "_dummy", option.second->devtype(), 0); + for (device_t &card_dev : device_iterator(*card)) + { + m_current_device = &card_dev; + card_dev.findit(true); + card_dev.validity_check(*this); + m_current_device = nullptr; + } + m_current_config->device_remove(&slot->device(), "_dummy"); + } + } + } } } diff --git a/src/emu/validity.h b/src/emu/validity.h index eaaa9f7336f..de599199b73 100644 --- a/src/emu/validity.h +++ b/src/emu/validity.h @@ -114,7 +114,7 @@ private: // current state const game_driver * m_current_driver; - const machine_config * m_current_config; + machine_config * m_current_config; const device_t * m_current_device; const char * m_current_ioport; int_map m_region_map; |