summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/validity.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-06-10 19:31:16 +1000
committer Vas Crabb <vas@vastheman.com>2017-06-10 19:31:16 +1000
commit6975b237af5248e5dc260ca0477c480f64b3980e (patch)
tree4a59e0013ca178847785c50b32458920383d2fb2 /src/emu/validity.cpp
parent88b41d3566bfe00b31345cfea858bb039aaab070 (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
Diffstat (limited to 'src/emu/validity.cpp')
-rw-r--r--src/emu/validity.cpp21
1 files changed, 21 insertions, 0 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");
+ }
+ }
+ }
}
}