frontend: Only populate BIOS Selection menu with system and slot cards that actually have BIOS options (addresses crash in MT06675).

This commit is contained in:
Vas Crabb 2020-10-21 00:07:57 +11:00
parent 7135b4deb1
commit 1532827ccf
2 changed files with 22 additions and 11 deletions

View File

@ -93,10 +93,15 @@ machine_static_info::machine_static_info(const ui_options &options, machine_conf
m_imperfect_features |= device.type().imperfect_features();
// look for BIOS options
for (tiny_rom_entry const *rom = device.rom_region(); !m_has_bioses && rom && !ROMENTRY_ISEND(rom); ++rom)
device_t const *const parent(device.owner());
device_slot_interface const *const slot(dynamic_cast<device_slot_interface const *>(parent));
if (!parent || (slot && (slot->get_card_device() == &device)))
{
if (ROMENTRY_ISSYSTEM_BIOS(rom))
m_has_bioses = true;
for (tiny_rom_entry const *rom = device.rom_region(); !m_has_bioses && rom && !ROMENTRY_ISEND(rom); ++rom)
{
if (ROMENTRY_ISSYSTEM_BIOS(rom))
m_has_bioses = true;
}
}
// if we don't have ports passed in, build here

View File

@ -50,19 +50,25 @@ menu_bios_selection::menu_bios_selection(mame_ui_manager &mui, render_container
void menu_bios_selection::populate(float &customtop, float &custombottom)
{
/* cycle through all devices for this system */
// cycle through all devices for this system
for (device_t &device : device_iterator(machine().root_device()))
{
tiny_rom_entry const *rom(device.rom_region());
if (rom && !ROMENTRY_ISEND(rom))
device_t const *const parent(device.owner());
device_slot_interface const *const slot(dynamic_cast<device_slot_interface const *>(parent));
if (!parent || (slot && (slot->get_card_device() == &device)))
{
const char *val = "default";
for ( ; !ROMENTRY_ISEND(rom); rom++)
tiny_rom_entry const *rom(device.rom_region());
if (rom && !ROMENTRY_ISEND(rom))
{
if (ROMENTRY_ISSYSTEM_BIOS(rom) && ROM_GETBIOSFLAGS(rom) == device.system_bios())
val = rom->hashdata;
char const *val = nullptr;
for ( ; !ROMENTRY_ISEND(rom) && !val; rom++)
{
if (ROMENTRY_ISSYSTEM_BIOS(rom) && ROM_GETBIOSFLAGS(rom) == device.system_bios())
val = rom->hashdata;
}
if (val)
item_append(!parent ? "driver" : (device.tag() + 1), val, FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, (void *)&device);
}
item_append(!device.owner() ? "driver" : (device.tag() + 1), val, FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, (void *)&device);
}
}