From 82bc54fb61693c9a65b37fadc77f5708cd6fc629 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Wed, 13 May 2015 12:24:52 +0200 Subject: [PATCH] check device roms only once as well when using -romident. this does not help as much as the softlist change, but there was no reason to keep the old unoptimal behavior. nw. --- src/emu/clifront.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/emu/clifront.c b/src/emu/clifront.c index 1c8658d4d19..a7863ceafe6 100644 --- a/src/emu/clifront.c +++ b/src/emu/clifront.c @@ -1882,6 +1882,7 @@ int media_identifier::find_by_hash(const hash_collection &hashes, int length) { int found = 0; slname_map listnames; + slname_map shortnames; // iterate over drivers m_drivlist.reset(); @@ -1890,21 +1891,26 @@ int media_identifier::find_by_hash(const hash_collection &hashes, int length) // iterate over devices, regions and files within the region */ device_iterator deviter(m_drivlist.config().root_device()); for (device_t *device = deviter.first(); device != NULL; device = deviter.next()) - for (const rom_entry *region = rom_first_region(*device); region != NULL; region = rom_next_region(region)) - for (const rom_entry *rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom)) - { - hash_collection romhashes(ROM_GETHASHDATA(rom)); - if (!romhashes.flag(hash_collection::FLAG_NO_DUMP) && hashes == romhashes) - { - bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP); - - // output information about the match - if (found) - osd_printf_info(" "); - osd_printf_info("= %s%-20s %-10s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), m_drivlist.driver().name, m_drivlist.driver().description); - found++; - } - } + { + if (shortnames.add(device->shortname(), 0, FALSE) != TMERR_DUPLICATE) + { + for (const rom_entry *region = rom_first_region(*device); region != NULL; region = rom_next_region(region)) + for (const rom_entry *rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom)) + { + hash_collection romhashes(ROM_GETHASHDATA(rom)); + if (!romhashes.flag(hash_collection::FLAG_NO_DUMP) && hashes == romhashes) + { + bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP); + + // output information about the match + if (found) + osd_printf_info(" "); + osd_printf_info("= %s%-20s %-10s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), m_drivlist.driver().name, m_drivlist.driver().description); + found++; + } + } + } + } // next iterate over softlists software_list_device_iterator iter(m_drivlist.config().root_device());