ckmame
verify MAME ROM sets

ckmame [-CcFhjoVv] [-D dbfile] [-e dir] [-O dbfile] [-R dir] [-T file] [--all-sets] [--complete-list file] [--complete-games-only] [--config file] [--copy-from-extra] [--create-fixdat] [--delete-unknown-pattern pattern] [--extra-directory dir] [--fix] [--fixdat-directory dir] [--game-list file] [--help] [--keep-old-duplicate] [--list-sets] [--missing-list file] [--move-from-extra] [--no-complete-games-only] [--no-create-fixdat] [--no-report-changes] [--no-report-correct] [--no-report-detailed] [--no-report-fixable] [--no-report-missing] [--no-report-no-good-dump] [--no-report-summary] [--old-db dbfile] [--only-if-database-updated] [--report-changes] [--report-correct] [--report-detailed] [--report-fixable] [--report-missing] [--report-no-good-dump] [--report-summary] [--rom-db dbfile] [--rom-directory dir] [--roms-unzipped] [--save-directory dir] [--set pattern] [--unknown-directory dir] [--update-database] [--use-torrentzip] [--verbose] [--version] [game ...]

ckmame is a program to check ROM sets for MAME, the Multiple Arcade Machine Emulator (see https://www.mamedev.org/), or other emulators that provide ROM set information in a compatible way. 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 or unpacked, collected in directories per game.

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:
--all-sets
Do the action for all configured sets.
, --complete-games-only
Only create complete games. ROMs for incomplete games are moved to the saved directory. When run for a set, the default is saved/$set instead, where “$set” is the name of the set.
, --report-correct
Report status of ROMs that are correct. By default they are not mentioned.
--config file
read configuration from file. See the CONFIG FILE section for more details.
--complete-list file
Write all complete games into file, one line per game, and sorted alphabetically.
--copy-from-extra
Keep used files in extra directories (default).
--create-fixdat
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.
, --rom-db dbfile
Use dbfile instead of the default mame.db as the database.
--delete-unknown-pattern pattern
When moving files to the unknown directory, skip files matching pattern and just delete them instead.
, --extra-directory dir
Search for missing files in directory dir (multiple directories can be specified by repeating this option).
, --fix
Fix the ROM set. By default, only the status is reported.
--fixdat-directory dir
Create the fixdat (see --create-fixdat) in dir instead of the current directory.
, --help
Display a short usage.
, --move-from-extra
Remove used files from extra directories. Opposite of - -copy-from-extra.
--keep-old-duplicate
Keep files in ROM set that are also in old ROM database.
--list-sets
List all configured sets.
--missing-list file
Write all complete games into file, one line per game, and sorted alphabetically.
--no-complete-games-only
Keep partial games in ROM set (default).
--no-create-fixdat
Do not create a fixdat for the missing ROM sets (default).
--no-report-changes
Don't report a summary of changes while fixing a ROM set (default).
--no-report-correct
Don't report status of ROMs that are correct (default).
--no-report-detailed
Don't report status of every ROM (default).
--no-report-fixable
Don't report status of ROMs that can be fixed.
--no-report-missing
Don't report status of ROMs that are missing.
--no-report-no-good-dump
Don't report status of ROMs for which no good dump exists (default).
--no-report-summary
Don't print summary of ROM set status (default).
, --old-db dbfile
Assume that the files in the database dbfile exist in some other location (e.g., on an offline disk or backup medium).
, --only-if-database-updated
Only run ckmame if the database was updated (implies --update-database).
, --rom-directory dir
Look for the ROM set in the directory dir instead of the default roms.
--report-changes
Report a summary of changes while fixing a ROM set.
--report-detailed
Report status of every ROM that is checked.
--report-fixable
Report status of ROMs that can be fixed (default).
--report-missing
Report status of ROMs that are missing (default).
--report-no-good-dump
Don't suppress reporting status of ROMs for which no good dump exists. Status of such ROMs is reported according to --report-correct or --report-missing.
--report-summary
Print summary of ROM set status at the end of the output.
--save-directory dir
When a ROM file is encountered that does not belong to the set that is currently checked, but is needed by a different set, move it this directory. It will be found there automatically later (efault: “saved ).
--set pattern
Check all ROM sets matching pattern. This uses the configuration from the corresponding section in the Config files. See CONFIG FILES for details
, --game-list file
Read the list of games to check from file. file should contain one line per game.
--roms-unzipped
Instead of looking for ROMs in the zip archive roms/games.zip, look for them in the directory roms/games/ in the file system.
--unknown-directory dir
When a file is encountered that does not belong to the set that is currently checked and is not known by the database, move it this directory (efault: “unknown ).
--update-database
Update the database before checking the ROMs.
--use-torrentzip
When the ROM set is zipped, write the zip archives in torrentzip format.
, --version
Display version number.
, --verbose
Print fixes made.

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

By default, the configuration is read from ~/.config/ckmame/ckmamerc and .ckmamerc if they exist, in this order.

The database file to read from defaults to mame.db and the roms are expected in the roms directory.

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 saved directory.

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 subdirectory of the current dir:
ckmame

Fix all ROMs:

ckmame -Fd

Fix all ROMs 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 <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>.