summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/miscmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/ui/miscmenu.cpp')
-rw-r--r--src/frontend/mame/ui/miscmenu.cpp50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp
index 3aec236ab72..89a86760851 100644
--- a/src/frontend/mame/ui/miscmenu.cpp
+++ b/src/frontend/mame/ui/miscmenu.cpp
@@ -79,17 +79,16 @@ void menu_bios_selection::populate(float &customtop, float &custombottom)
/* cycle through all devices for this system */
for (device_t &device : device_iterator(machine().root_device()))
{
- if (device.rom_region() != nullptr && !ROMENTRY_ISEND(device.rom_region()))
+ tiny_rom_entry const *rom(device.rom_region());
+ if (rom && !ROMENTRY_ISEND(rom))
{
const char *val = "default";
- for (const rom_entry *rom = device.rom_region(); !ROMENTRY_ISEND(rom); rom++)
+ for ( ; !ROMENTRY_ISEND(rom); rom++)
{
if (ROMENTRY_ISSYSTEM_BIOS(rom) && ROM_GETBIOSFLAGS(rom) == device.system_bios())
- {
- val = ROM_GETHASHDATA(rom);
- }
+ val = rom->hashdata;
}
- item_append(device.owner() == nullptr ? "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);
}
}
@@ -118,13 +117,14 @@ void menu_bios_selection::handle()
{
device_t *dev = (device_t *)menu_event->itemref;
int cnt = 0;
- for (const rom_entry &rom : dev->rom_region_vector())
+ for (const tiny_rom_entry *rom = dev->rom_region(); rom && !ROMENTRY_ISEND(rom); ++rom)
{
- if (ROMENTRY_ISSYSTEM_BIOS(&rom)) cnt ++;
+ if (ROMENTRY_ISSYSTEM_BIOS(rom))
+ ++cnt;
}
int val = dev->system_bios() + ((menu_event->iptkey == IPT_UI_LEFT) ? -1 : +1);
- if (val<1) val=cnt;
- if (val>cnt) val=1;
+ if (val < 1) val = cnt;
+ if (val > cnt) val = 1;
dev->set_system_bios(val);
if (strcmp(dev->tag(),":")==0) {
machine().options().set_value("bios", val-1, OPTION_PRIORITY_CMDLINE);
@@ -804,40 +804,38 @@ void menu_machine_configure::setup_bios()
if (m_drv->rom == nullptr)
return;
- auto entries = rom_build_entries(m_drv->rom);
-
std::string specbios(m_opts.bios());
- std::string default_name;
- for (const rom_entry &rom : entries)
- if (ROMENTRY_ISDEFAULT_BIOS(&rom))
- default_name = ROM_GETNAME(&rom);
+ char const *default_name(nullptr);
+ for (tiny_rom_entry const *rom = m_drv->rom; !ROMENTRY_ISEND(rom); ++rom)
+ {
+ if (ROMENTRY_ISDEFAULT_BIOS(rom))
+ default_name = rom->name;
+ }
std::size_t bios_count = 0;
- for (const rom_entry &rom : entries)
+ for (tiny_rom_entry const *rom = m_drv->rom; !ROMENTRY_ISEND(rom); ++rom)
{
- if (ROMENTRY_ISSYSTEM_BIOS(&rom))
+ if (ROMENTRY_ISSYSTEM_BIOS(rom))
{
- std::string name(ROM_GETHASHDATA(&rom));
- std::string biosname(ROM_GETNAME(&rom));
- int bios_flags = ROM_GETBIOSFLAGS(&rom);
- std::string bios_number = std::to_string(bios_flags - 1);
+ std::string name(rom->hashdata);
+ u32 const bios_flags(ROM_GETBIOSFLAGS(rom));
+ std::string const bios_number(std::to_string(bios_flags - 1));
// check biosnumber and name
- if (bios_number == specbios || biosname == specbios)
+ if ((bios_number == specbios) || (specbios == rom->name))
m_curbios = bios_count;
- if (biosname == default_name)
+ if (default_name && !std::strcmp(rom->name, default_name))
{
name.append(_(" (default)"));
if (specbios == "default")
m_curbios = bios_count;
}
- m_bios.emplace_back(name, bios_flags - 1);
+ m_bios.emplace_back(std::move(name), bios_flags - 1);
bios_count++;
}
}
-
}
//-------------------------------------------------