ckmameverify MAME ROM sets

ckmame [-bCcdFfhjKkLlSsuVvwX] [-D dbfile] [-e dir] [-O dbfile] [-R dir] [-T file] [--autofixdat] [--cleanup-extra] [--correct] [--db dbfile] [--delete-duplicate] [--delete-found] [--delete-long] [--delete-unknown] [--fix] [--fixdat file] [--games-from file] [--help] [--ignore-extra] [--ignore-unknown] [--keep-duplicate] [--keep-found] [--move-long] [--move-unknown] [--nobroken] [--nofixable] [--nonogooddumps] [--nosuperfluous] [--nowarnings] [--old-db dbfile] [--rom-dir dir] [--roms-unzipped] [--search dir] [--stats] [--superfluous] [--verbose] [--version] [game ...]

ckmame is a program to check ROM sets for MAME, the Multiple Arcade Machine Emulator (see, or other emulators that provide ROM set information in a compatible way (e.g., Raine, Impact, or other emulators). This is the same format as clrmamepro dat files. ckmame tells you which ROM files are missing or have a wrong checksum, can delete unknown and unused files from the ROM sets, and rename or move files.

MAME is an emulator for numerous arcade machines (video games, ranging from the 1970s to today). Since MAME is emulating the games, it uses the original images from the arcade machines' original ROM chips. MAME's internal database contains extensive information on the ROMs, including the sizes and checksums of the used ROMs. Since some arcade games are variants of others and share some of the same ROMs, there are also internal dependencies between these so called clones. To save space, ROMs can be archived in zip files and dynamically unzipped by MAME when you play a game. ckmame does only support ROM sets stored as zip files.

ckmame tries to create a “split ROM set” from your current collection. This means that all files needed by the parent are kept in the parent's zip file, and only the files needed by the clone (or child) that are different from the parent's are kept in the child's zip file. For identifying the ROMs ckmame uses the sizes and checksums; names are only used for verification, since the MAME team often renames ROMs.

While ckmame uses MAME's ROM database, it must be converted into a more efficient format before use. See mkmamedb(1) for details.

By default, ckmame will check the games named on the command line, or all games if none are given. Shell wildcards are allowed. You can use command line options to select which type of errors to report.

Supported options:

Like --fixdat, but automatically generates the output file name from the datfile's name and version number: “fix_$SYSTEM ($VERSION).dat”.
Don't report unfixable errors. See also -f and -w.
Remove files already in ROM set from extra directories.
, --complete-only
Only create complete sets. ROMs for incomplete sets are moved to the needed directory.
, --correct
Report correct sets. Normally they are not mentioned.
dbfile, --db dbfile
Use dbfile as database file.
, --nonogooddumps
Don't report ROMs with no known good dumps.
Delete files present in old ROM database (default). See also --keep-duplicate.
dir, --search dir
Look for missing files in directory dir and its subdirectories. Recommended for use with update sets. See also -j.
, --fix
Fix ROM sets; do as much as possible, such as renaming and moving files.
, --nofixable
Don't report fixable errors. See also -b and -w.
Create a clrmamepro-style “fixdat” file, i.e. an XML file containing only the files missing in the ROM set compared to the database used.
, --help
Display a short help message.
Ignore unknown files when fixing. They will still be reported.
, --delete-found
When using -e, delete files that are copied to the ROM set. See also --keep-found.
Keep files present in old ROM database. See also --delete-duplicate.
When using -e, do not remove files that are copied to the ROM set (default). See also -j.
, --move-unknown
Move unknown files when fixing (default). They are moved into a zip file with the same name under roms/garbage. See also -k.
, --delete-unknown
Delete unknown files when fixing. See also -K.
, --move-long
Move too long files when fixing (default). See also -K and -l.
, --delete-long
Delete long files when fixing. See also -L.
dbfile, --old-db dbfile
Assume that files listed in dbfile exist elsewhere.
dir, --rom-dir dir
Look for roms in dir. Default is “roms”.
Display completeness statistics of ROM set at end of run.
Only check for superfluous files in ROM sets.
, --nosuperfluous
Don't report superfluous (unneeded) files.
file, --games-from file
Read list of games to check from file.
, --roms-unzipped
ROMs are files on the disk. Each game is represented by a directory instead of a ZIP archive.
, --version
Display program name and version number.
, --verbose
Print fixes made. Only useful with -F.
, --nowarnings
Print only unfixable error, like missing or completely incorrect ROMs. See also -b and -f.
, --ignore-extra
Do not mention extra files that are in the ROM dirs. Most of the time these are ROM sets whose names have changed. Additionally, ckmame creates a roms/garbage directory (see also -K), which you will also be warned about.

Location for the database file. Can be overridden with the -D option. Defaults to “mame.db”.
Location for the database file of files that exist elsewhere. Can be overridden with the -O option. Defaults to “old.db”.

Unknown files are moved to the sub-directory unknown. Files that will be needed by other games in the ROM set are moved to the needed directory.

In unzipped mode (-u), ckmame creates .ckmame.db files in the rom directory as well as the directories given with -e. These files are databases containing file names, sizes, and their hashes. The database information used when the file hasn't changed since the last run (i.e. same size and modification time).

Print a report about the current state of your ROM sets in the roms subdir of the current dir:


Fix all sets and only report unfixable errors, omitting those ROMs where no good dump exists:

ckmame -Fwd

Fix all sets using the files found in updatedir, removing files from there that are copied to the ROM set:

ckmame -Fj -e updatedir

Most messages should be straightforward. Two need special explanations:

If a file is marked as “broken”, it means that the computed checksum is not the same as the checksum stored in the zip archive, usually because there has been a decompression error.

If a ROM or disk is marked with “checksum mismatch”, the primary checksum matches, but one of the other checksums does not. The primary checksum for ROMs is CRC32, for disks MD5.

dumpgame(1), mkmamedb(1)

ckmame was written by Dieter Baron ⟨⟩ and Thomas Klausner ⟨⟩.