mirror of
https://github.com/holub/mame
synced 2025-05-10 16:21:42 +03:00
if a clone shares all it's roms with a parent then it assumes the clone is there if the parent is.
This commit is contained in:
parent
5879fdf496
commit
0ed53639ba
@ -79,8 +79,10 @@ media_auditor::summary media_auditor::audit_media(const char *validation)
|
|||||||
const char *driverpath = m_enumerator.config().m_devicelist.find("root")->searchpath();
|
const char *driverpath = m_enumerator.config().m_devicelist.find("root")->searchpath();
|
||||||
|
|
||||||
// iterate over ROM sources and regions
|
// iterate over ROM sources and regions
|
||||||
bool anyfound = false;
|
int found = 0;
|
||||||
bool anyrequired = false;
|
int required = 0;
|
||||||
|
int sharedFound = 0;
|
||||||
|
int sharedRequired = 0;
|
||||||
for (const rom_source *source = rom_first_source(m_enumerator.config()); source != NULL; source = rom_next_source(*source))
|
for (const rom_source *source = rom_first_source(m_enumerator.config()); source != NULL; source = rom_next_source(*source))
|
||||||
{
|
{
|
||||||
// determine the search path for this source and iterate through the regions
|
// determine the search path for this source and iterate through the regions
|
||||||
@ -98,10 +100,17 @@ m_searchpath = combinedpath;
|
|||||||
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
|
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
|
||||||
{
|
{
|
||||||
hash_collection hashes(ROM_GETHASHDATA(rom));
|
hash_collection hashes(ROM_GETHASHDATA(rom));
|
||||||
|
bool shared = also_used_by_parent(hashes) >= 0;
|
||||||
|
|
||||||
// if a dump exists, then at least one entry is required
|
// if a dump exists, then at least one entry is required
|
||||||
if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
|
if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
|
||||||
anyrequired = true;
|
{
|
||||||
|
required++;
|
||||||
|
if (shared)
|
||||||
|
{
|
||||||
|
sharedRequired++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// audit a file
|
// audit a file
|
||||||
audit_record *record = NULL;
|
audit_record *record = NULL;
|
||||||
@ -117,13 +126,19 @@ m_searchpath = combinedpath;
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// if we got a record back,
|
// if we got a record back,
|
||||||
if (record->status() != audit_record::STATUS_NOT_FOUND && source_is_gamedrv && also_used_by_parent(hashes) == -1)
|
if (record->status() != audit_record::STATUS_NOT_FOUND && source_is_gamedrv)
|
||||||
anyfound = true;
|
{
|
||||||
|
found++;
|
||||||
|
if (shared)
|
||||||
|
{
|
||||||
|
sharedFound++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we found nothing, we don't have the set at all
|
// if we found nothing unique to this set & the set needs roms that aren't in the parent or the parent isn't found either, then we don't have the set at all
|
||||||
if (!anyfound && anyrequired)
|
if (found == sharedFound && required > 0 && (required != sharedRequired || sharedFound == 0))
|
||||||
m_record_list.reset();
|
m_record_list.reset();
|
||||||
|
|
||||||
// return a summary
|
// return a summary
|
||||||
|
Loading…
Reference in New Issue
Block a user