Skip to content

Commit

Permalink
Report mia in dumpgame.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed Jun 7, 2024
1 parent 70b63af commit 3c35f6d
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 19 deletions.
2 changes: 1 addition & 1 deletion regress/dumpgame-checksum-crc.zip.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ file mame.db mame.db
program dumpgame
stdout
In game 1-8a:
file 08.rom size 8 crc 12345678 sha1 111bb8b7549e3386a996845405b02164f17c7b37 status in game
file 08.rom size 8 crc 12345678 sha1 111bb8b7549e3386a996845405b02164f17c7b37 status ok in game
end-of-inline-data
2 changes: 1 addition & 1 deletion regress/dumpgame-checksum-md5-disk.zip.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ arguments -D ../mamedb-disk.db --checksum bf5c9c39eb49bcf5a55a06dbb4deccb3
program dumpgame
stdout
In game disk:
disk 108-5 md5 bf5c9c39eb49bcf5a55a06dbb4deccb3 sha1 7570a907e20a51cbf6193ec6779b82d1967bb609 status in game
disk 108-5 md5 bf5c9c39eb49bcf5a55a06dbb4deccb3 sha1 7570a907e20a51cbf6193ec6779b82d1967bb609 status ok in game
end-of-inline-data
2 changes: 1 addition & 1 deletion regress/dumpgame-checksum-md5-file.zip.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ file mame.db mame.db
program dumpgame
stdout
In game zero:
file zero size 0 crc 00000000 md5 d41d8cd98f00b204e9800998ecf8427e sha1 da39a3ee5e6b4b0d3255bfef95601890afd80709 status in game
file zero size 0 crc 00000000 md5 d41d8cd98f00b204e9800998ecf8427e sha1 da39a3ee5e6b4b0d3255bfef95601890afd80709 status ok in game
end-of-inline-data
2 changes: 1 addition & 1 deletion regress/dumpgame-checksum-sha1-disk.zip.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ arguments -D ../mamedb-disk.db --checksum 7570a907e20a51cbf6193ec6779b82d1967bb6
program dumpgame
stdout
In game disk:
disk 108-5 md5 bf5c9c39eb49bcf5a55a06dbb4deccb3 sha1 7570a907e20a51cbf6193ec6779b82d1967bb609 status in game
disk 108-5 md5 bf5c9c39eb49bcf5a55a06dbb4deccb3 sha1 7570a907e20a51cbf6193ec6779b82d1967bb609 status ok in game
end-of-inline-data
10 changes: 5 additions & 5 deletions regress/dumpgame-checksum-sha1-file.zip.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ file mame.db mame.db
program dumpgame
stdout
In game 1-8:
file 08.rom size 8 crc 3656897d sha1 111bb8b7549e3386a996845405b02164f17c7b37 status in game
file 08.rom size 8 crc 3656897d sha1 111bb8b7549e3386a996845405b02164f17c7b37 status ok in game
In game 1-8a:
file 08.rom size 8 crc 12345678 sha1 111bb8b7549e3386a996845405b02164f17c7b37 status in game
file 08.rom size 8 crc 12345678 sha1 111bb8b7549e3386a996845405b02164f17c7b37 status ok in game
In game 2-48:
file 08.rom size 8 crc 3656897d sha1 111bb8b7549e3386a996845405b02164f17c7b37 status in game
file 08.rom size 8 crc 3656897d sha1 111bb8b7549e3386a996845405b02164f17c7b37 status ok in game
In game clone-8:
file 08.rom size 8 crc 3656897d sha1 111bb8b7549e3386a996845405b02164f17c7b37 status in game
file 08.rom size 8 crc 3656897d sha1 111bb8b7549e3386a996845405b02164f17c7b37 status ok in game
In game nogood-2:
file 08.rom size 8 crc 3656897d sha1 111bb8b7549e3386a996845405b02164f17c7b37 status in game
file 08.rom size 8 crc 3656897d sha1 111bb8b7549e3386a996845405b02164f17c7b37 status ok in game
end-of-inline-data
2 changes: 1 addition & 1 deletion regress/dumpgame-game.zip.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Name: parent-4
Description: one four byte file, has clone
Clones: clone-8
ROMs:
file 04.rom size 4 crc d87f7e0c sha1 a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 status in game
file 04.rom size 4 crc d87f7e0c sha1 a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 status ok in game
end-of-inline-data
11 changes: 11 additions & 0 deletions regress/dumpgame-mia.zip.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description dumpgame: test single game
return 0
arguments 1-mia
file mame.db mamedb-mia.db
program dumpgame
stdout
Name: 1-mia
Description: single file, MIA
ROMs:
file 04.rom size 4 crc d87f7e0c md5 098f6bcd4621d373cade4e832627b4f6 sha1 a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 status ok mia in game
end-of-inline-data
4 changes: 2 additions & 2 deletions regress/dumpgame-rom-db.zip.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ stdout
Name: disk
Description: 1-8 with disk
ROMs:
file 08.rom size 8 crc 3656897d status in game
file 08.rom size 8 crc 3656897d status ok in game
Disks:
disk 108-5 md5 bf5c9c39eb49bcf5a55a06dbb4deccb3 sha1 7570a907e20a51cbf6193ec6779b82d1967bb609 status in game
disk 108-5 md5 bf5c9c39eb49bcf5a55a06dbb4deccb3 sha1 7570a907e20a51cbf6193ec6779b82d1967bb609 status ok in game
end-of-inline-data
4 changes: 2 additions & 2 deletions src/Configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,11 @@ void Configuration::merge_config_table(const toml::table *table_pointer) {
set_string(table, "old-db", old_db);
set_bool(table, "report-changes", report_changes);
set_bool(table, "report-correct", report_correct);
set_bool(table, "report-correct", report_correct_mia);
set_bool(table, "report-correct-mia", report_correct_mia);
set_bool(table, "report-detailed", report_detailed);
set_bool(table, "report-fixable", report_fixable);
set_bool(table, "report-missing", report_missing);
set_bool(table, "report-missing", report_missing_mia);
set_bool(table, "report-missing-mia", report_missing_mia);
set_bool(table, "report-summary", report_summary);
set_bool(table, "report-no-good-dump", report_no_good_dump);
set_string(table, "rom-directory", rom_directory);
Expand Down
2 changes: 1 addition & 1 deletion src/Rom.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Rom : public FileData {
std::string filename(filetype_t filetype) const;
bool is_mergable(const Rom &other) const;

std::string status_name(bool verbose = false) const { return status_name(status); }
std::string status_name(bool verbose = false) const { return status_name(status, verbose); }
static std::string status_name(Status status, bool verbose = false);
};

Expand Down
12 changes: 8 additions & 4 deletions src/dumpgame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ std::string Dumpgame::format_checksums(const Hashes *hashes) {


void Dumpgame::print_diskline(Rom *disk) {
auto message = "\t\tdisk " + pad_string(disk->name, 12) + format_checksums(&disk->hashes) + " status " + disk->status_name(true) + " in " + where_name[disk->where];
auto message = "\t\tdisk " + disk->name + " " + format_checksums(&disk->hashes) + " status " + disk->status_name(true) + " in " + where_name[disk->where];
if (!disk->merge.empty() && disk->name != disk->merge) {
message += " (" + disk->merge + ")";
}
Expand All @@ -85,15 +85,19 @@ void Dumpgame::print_diskline(Rom *disk) {


void Dumpgame::print_romline(Rom *rom) {
auto message = "\t\tfile " + pad_string(rom->name, 12) + " size ";
auto message = "\t\tfile " + rom->name + " size ";
if (rom->is_size_known()) {
message += pad_string_left(std::to_string(rom->hashes.size), 7);
message += std::to_string(rom->hashes.size);
}
else {
message += "unknown";
}
message += format_checksums(&rom->hashes);
message += " status " + rom->status_name(true) + " in " + where_name[rom->where];
message += " status " + rom->status_name(true);
if (rom->mia) {
message += " mia";
}
message += std::string(" in ") + where_name[rom->where];
if (!rom->merge.empty() && rom->name != rom->merge) {
message += " (" + rom->merge + ")";
}
Expand Down

0 comments on commit 3c35f6d

Please sign in to comment.