src/emu/audit.c
| r12656 | r12657 | |
| 83 | 83 | int required = 0; |
| 84 | 84 | int sharedFound = 0; |
| 85 | 85 | int sharedRequired = 0; |
| 86 | | //for (const rom_source *source = rom_first_source(m_enumerator.config()); source != NULL; source = rom_next_source(*source)) |
| 86 | |
| 87 | 87 | const rom_source *source = rom_first_source(m_enumerator.config()); |
| 88 | 88 | { |
| 89 | 89 | // determine the search path for this source and iterate through the regions |
| r12656 | r12657 | |
| 164 | 164 | |
| 165 | 165 | // store validation for later |
| 166 | 166 | m_validation = validation; |
| 167 | | |
| 168 | | // iterate over ROM sources and regions |
| 169 | | int found = 0; |
| 170 | | int required = 0; |
| 171 | | // determine the search path for this source and iterate through the regions |
| 172 | 167 | m_searchpath = device->shortname(); |
| 173 | 168 | |
| 174 | 169 | // now iterate over regions and ROMs within |
| r12656 | r12657 | |
| 176 | 171 | { |
| 177 | 172 | for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom)) |
| 178 | 173 | { |
| 179 | | hash_collection hashes(ROM_GETHASHDATA(rom)); |
| 180 | | |
| 181 | | // count the number of files with hashes |
| 182 | | if (!hashes.flag(hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom)) |
| 183 | | { |
| 184 | | required++; |
| 185 | | } |
| 186 | | |
| 187 | 174 | // audit a file |
| 188 | 175 | audit_record *record = NULL; |
| 189 | 176 | if (ROMREGION_ISROMDATA(region)) |
| r12656 | r12657 | |
| 192 | 179 | // audit a disk |
| 193 | 180 | else if (ROMREGION_ISDISKDATA(region)) |
| 194 | 181 | record = audit_one_disk(rom); |
| 195 | | |
| 196 | | // count the number of files that are found. |
| 197 | | if (record != NULL && (record->status() == audit_record::STATUS_GOOD || (record->status() == audit_record::STATUS_FOUND_INVALID && also_used_by_parent(record->actual_hashes(), record->actual_length()) < 0))) |
| 198 | | { |
| 199 | | found++; |
| 200 | | } |
| 201 | 182 | } |
| 202 | 183 | } |
| 203 | 184 | |