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
This commit is contained in:
Vas Crabb 2017-06-10 19:31:16 +10:00
parent 88b41d3566
commit 6975b237af
2 changed files with 22 additions and 1 deletions

View File

@ -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");
}
}
}
}
}

View File

@ -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;