summaryrefslogtreecommitdiffstats
path: root/docs/release/src/frontend/mame/audit.cpp
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2020-11-25 12:01:15 +1100
committer Robbbert <Robbbert@users.noreply.github.com>2020-11-25 12:01:15 +1100
commit3488d338118154f2ad55de0447ac469e1f678c38 (patch)
tree7615283d4b5d496945b8c54660aaa2af5353884b /docs/release/src/frontend/mame/audit.cpp
parent1364b7a51281ba7ce394b45f36a4a1384962e34e (diff)
0.226.A Release filestag226a
Diffstat (limited to 'docs/release/src/frontend/mame/audit.cpp')
-rw-r--r--docs/release/src/frontend/mame/audit.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/release/src/frontend/mame/audit.cpp b/docs/release/src/frontend/mame/audit.cpp
index e81e2576e85..82c1bb56b22 100644
--- a/docs/release/src/frontend/mame/audit.cpp
+++ b/docs/release/src/frontend/mame/audit.cpp
@@ -45,6 +45,35 @@ class parent_rom_vector : public std::vector<parent_rom>
public:
using std::vector<parent_rom>::vector;
+ void remove_redundant_parents()
+ {
+ while (!empty())
+ {
+ // find where the next parent starts
+ auto const last(
+ std::find_if(
+ std::next(cbegin()),
+ cend(),
+ [this] (parent_rom const &r) { return &front().type.get() != &r.type.get(); }));
+
+ // examine dumped ROMs in this generation
+ for (auto i = cbegin(); last != i; ++i)
+ {
+ if (!i->hashes.flag(util::hash_collection::FLAG_NO_DUMP))
+ {
+ auto const match(
+ std::find_if(
+ last,
+ cend(),
+ [&i] (parent_rom const &r) { return (i->length == r.length) && (i->hashes == r.hashes); }));
+ if (cend() == match)
+ return;
+ }
+ }
+ erase(cbegin(), last);
+ }
+ }
+
std::add_pointer_t<device_type> find_shared_device(device_t &current, char const *name, util::hash_collection const &hashes, uint64_t length) const
{
// if we're examining a child device, it will always have a perfect match
@@ -172,6 +201,7 @@ media_auditor::summary media_auditor::audit_media(const char *validation)
}
}
}
+ parentroms.remove_redundant_parents();
// count ROMs required/found
std::size_t found(0);