Skip to content

DAT file generator - #398

Merged
trzy merged 9 commits into
masterfrom
bart/dat-generator
Nov 28, 2026
Merged

trzy merged 9 commits into
masterfrom
bart/dat-generator

Conversation

@trzy

@trzy trzy commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Added a DAT file generator. Use the --output-dat option to produce an DAT XML file suitable for use with ROM auditing tools like clrmamepro.

trzy added 9 commits November 28, 2026 12:38
EPROMs 18 and 20 of this set were corrupted, and a patch kept attract mode
rendering. magtruck, the redump from September 2022, replaces it. The two sets
also use the same names for different files, so they cannot be in one merged
ROM set.
The Virtua Racing Extended builds give their files the names of vr's files,
but the contents are different. File names must be unique in a parent/clone
family, because a merged ROM set keeps the parent and its clones in one zip
file. Supermodel finds files by CRC, thus zip files with the names from the
build continue to load.
ROM auditing tools need the size of each file in a DAT file. The sizes come
from MAME 0.289's -listxml output, found by CRC32. Files that MAME does not
have:

- vrextsat, vrextps2: the sizes of vr's files with the same names, because
  the builds keep vr's layout.
- vs298 epr-20917.17: 0x100000. MAME 0.289 has the old bad dump; the redump
  (MAME commit c35bfdf) has the same size.
- pro1000: the sizes from the pro1000.zip set.

The sizes agree with all 722 matching files in a local ROM collection.
ROM auditing tools need each file's size, and a merged ROM set needs file
names that are unique in a parent/clone family. Now the loader checks both,
thus a new Games.xml entry that breaks a DAT file shows errors at startup:

- The size attribute of <file> is required.
- A file in a zip file must have the size that Games.xml gives.
- Two different files in a parent/clone family must not have the same name.
LoadZipArchive() set ZippedFile::zipfilename to the name of the file in the
zip archive, thus errors gave the ROM file name two times, for example
"File 'epr-14870a.7' in 'epr-14870a.7' is not sized in 2-byte chunks."
A DAT file writer needs each ROM set's files, but the regions of the game
definitions are private. GetROMSetFiles() gives the ROM sets in the order of
the XML file. Each has its files with name, size, and CRC32, one time each. A
clone's list includes the files that it uses from its parent, as the loader
merges them. HasXMLErrors() tells if the XML file has errors, because the
constructor did not keep the result.
-output-dat=<file> writes all ROM sets as a Logiqx XML DAT file and quits.
ROM auditing tools such as ClrMamePro and RomVault use it to check ROM sets
and to rebuild them as merged, split, or non-merged sets. A clone has cloneof
and romof attributes, and each file that it shares with its parent has a merge
attribute with the parent's file name. If Games.xml has errors, no file is
written and the exit code is 1.
The Virtua Racing Extended ROM sets are too esoteric to be included in the
mainstream game list. Also, I was not able to obtain the PS2 ISO needed to
build the PS2 version of vrext.
@trzy
trzy merged commit 7941f42 into master Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant