diff options
| author | 2017-09-22 21:36:37 +1000 | |
|---|---|---|
| committer | 2017-09-22 21:36:37 +1000 | |
| commit | 165da5efa4d52b550ff224b1f207a8baa0fa1ab6 (patch) | |
| tree | 9790d420195893fafe6406582ce804ac81d8f698 /src/emu/validity.cpp | |
| parent | ff82930d50611586228dd0bdb093ae5a51348e4a (diff) | |
Start adding stuff for iterating ROM entries in a more C++ way without needing to allocate everywhere, improve performance of -listxml by another 10% or so
Diffstat (limited to 'src/emu/validity.cpp')
| -rw-r--r-- | src/emu/validity.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index f5f139c38b7..618214970c2 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -1475,7 +1475,7 @@ void validity_checker::validate_roms(device_t &root) std::unordered_map<std::string, int> bios_names; std::unordered_map<std::string, std::string> bios_descs; char const *defbios = nullptr; - for (const rom_entry *romp = rom_first_region(device); romp && !ROMENTRY_ISEND(romp); romp++) + for (tiny_rom_entry const *romp = device.rom_region(); romp && !ROMENTRY_ISEND(romp); ++romp) { if (ROMENTRY_ISREGION(romp)) // if this is a region, make sure it's valid, and record the length { @@ -1484,12 +1484,12 @@ void validity_checker::validate_roms(device_t &root) osd_printf_warning("Empty ROM region '%s' (warning)\n", last_region_name); // reset our region tracking states - const char *basetag = ROMREGION_GETTAG(romp); + char const *const basetag = romp->name; items_since_region = (ROMREGION_ISERASE(romp) || ROMREGION_ISDISKDATA(romp)) ? 1 : 0; last_region_name = basetag; // check for a valid tag - if (basetag == nullptr) + if (!basetag) { osd_printf_error("ROM_REGION tag with nullptr name\n"); continue; @@ -1499,7 +1499,7 @@ void validity_checker::validate_roms(device_t &root) validate_tag(basetag); // generate the full tag - std::string fulltag = rom_region_name(device, romp); + std::string const fulltag = device.subtag(romp->name); // attempt to add it to the map, reporting duplicates as errors current_length = ROMREGION_GETLENGTH(romp); @@ -1509,7 +1509,7 @@ void validity_checker::validate_roms(device_t &root) else if (ROMENTRY_ISSYSTEM_BIOS(romp)) // If this is a system bios, make sure it is using the next available bios number { int const bios_flags = ROM_GETBIOSFLAGS(romp); - char const *const biosname = ROM_GETNAME(romp); + char const *const biosname = romp->name; if (bios_flags != last_bios + 1) osd_printf_error("Non-sequential BIOS %s (specified as %d, expected to be %d)\n", biosname, bios_flags, last_bios + 1); last_bios = bios_flags; @@ -1530,24 +1530,24 @@ void validity_checker::validate_roms(device_t &root) auto const nameins = bios_names.emplace(biosname, bios_flags); if (!nameins.second) osd_printf_error("Duplicate BIOS name %s specified (%d and %d)\n", biosname, nameins.first->second, bios_flags); - auto const descins = bios_descs.emplace(ROM_GETHASHDATA(romp), biosname); + auto const descins = bios_descs.emplace(romp->hashdata, biosname); if (!descins.second) - osd_printf_error("BIOS %s has duplicate description '%s' (was %s)\n", biosname, ROM_GETHASHDATA(romp), descins.first->second.c_str()); + osd_printf_error("BIOS %s has duplicate description '%s' (was %s)\n", biosname, romp->hashdata, descins.first->second.c_str()); } else if (ROMENTRY_ISDEFAULT_BIOS(romp)) // if this is a default BIOS setting, remember it so it to check at the end { - defbios = ROM_GETNAME(romp); + defbios = romp->name; } else if (ROMENTRY_ISFILE(romp)) // if this is a file, make sure it is properly formatted { // track the last filename we found - last_name = ROM_GETNAME(romp); + last_name = romp->name; total_files++; // make sure the hash is valid util::hash_collection hashes; - if (!hashes.from_internal_string(ROM_GETHASHDATA(romp))) - osd_printf_error("ROM '%s' has an invalid hash string '%s'\n", last_name, ROM_GETHASHDATA(romp)); + if (!hashes.from_internal_string(romp->hashdata)) + osd_printf_error("ROM '%s' has an invalid hash string '%s'\n", last_name, romp->hashdata); } // for any non-region ending entries, make sure they don't extend past the end |
