src/mess/climess.c
| r6978 | r6979 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "climess.h" |
| 11 | 11 | #include "output.h" |
| 12 | #include "hash.h" |
| 12 | 13 | |
| 13 | 14 | |
| 14 | 15 | /*------------------------------------------------- |
| r6978 | r6979 | |
| 175 | 176 | |
| 176 | 177 | return (count > 0) ? MAMERR_NONE : MAMERR_NO_SUCH_GAME; |
| 177 | 178 | } |
| 179 | |
| 180 | |
| 181 | /*------------------------------------------------- |
| 182 | match_roms - scan for a matching software ROM by hash |
| 183 | -------------------------------------------------*/ |
| 184 | void mess_match_roms(const char *hash, int length, int *found) |
| 185 | { |
| 186 | int listnum; |
| 187 | |
| 188 | for ( listnum = 0; software_lists[listnum] != NULL; listnum++ ) |
| 189 | { |
| 190 | const software_list *swlist = software_lists[listnum]; |
| 191 | int j; |
| 192 | |
| 193 | for ( j = 0; swlist->entries[j].name != NULL; j++ ) |
| 194 | { |
| 195 | const software_entry *sw = &swlist->entries[j]; |
| 196 | const rom_entry *region, *rom; |
| 197 | |
| 198 | for (region = &sw->rom_info[0]; region; region = rom_next_region(region)) |
| 199 | { |
| 200 | for (rom = rom_first_file(region); rom; rom = rom_next_file(rom)) |
| 201 | { |
| 202 | if (hash_data_is_equal(hash, ROM_GETHASHDATA(rom), 0)) |
| 203 | { |
| 204 | int baddump = hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP); |
| 205 | |
| 206 | /* output information about the match */ |
| 207 | if (*found != 0) |
| 208 | mame_printf_info(" "); |
| 209 | mame_printf_info("= %s%-20s %-10s %s [%s]\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), sw->name, sw->fullname, swlist->name); |
| 210 | (*found)++; |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | |