Auditing ROM collections has been made much simpler over the years thanks to concerted efforts of many cartridge purchasers, dumpers, cataloguers, and coders. Using a combination of RomCenter (or ClrMamePro) and a No-Intro .Dat file, one can quickly fix an entire collection in one go: repairing names, verifying regions, checking for problem ROMs, producing have-lists, etc etc.
NES roms throw a particular curveball because they carry a 16-byte header with a little info about the board within the cart. Emulators need this info, but it isn’t verified by No-Intro since it’s not part of any real dump. As a result iNES headers remain missing, incorrect, or filled with crap data. A new repair tool is needed.
ines-fix.py is a Python script which can repair defunct iNES headers using an external cart database. It does this by extracting the data portion from the file, calculating a crc32, looking for the crc the xml file, and then rebuilding a header based on that info. If the old and new headers differ, the file is overwritten with a fixed version.
Be careful with this tool: it’s sort of a blunt object, and may trash your rom collection if not used carefully. Make backups. In particular it writes only iNES v1 headers, expecting emulators to cope with the shortcomings of this format.
Output samples:
-> No change to existing header
CRC check: 4318A2F8
Found CRC match: Barker Bill's Trick Shooting
*** Header unchanged: not writing replacement file.
----------------------------------------------------
-> Adding a battery
CRC check: 1F6EA423
Found CRC match: Baseball Simulator 1.000
*** HEADER UPDATED ***
oldHeader: 4e45531a081010000000000000000000
newHeader: 4e45531a081012000000000000000000
All done. Wrote new file roms/Baseball Simulator 1.000 (USA).nes
-> Correcting a mapper, vertical mirroring, and removing “DiskDude!”
CRC check: 9BDE3267
Found CRC match: Adventures of Dino Riki
*** HEADER UPDATED ***
oldHeader: 4e45531a0204004469736b4475646521
newHeader: 4e45531a020431000000000000000000
All done. Wrote new file roms/Adventures of Dino Riki (USA).nes
----------------------------------------------------
-> Standardizing on “horizontal mirroring”
CRC check: 3ECA3DDA
Found CRC match: Bases Loaded 3, Ryne Sandberg Plays
*** HEADER UPDATED ***
oldHeader: 4e45531a101041000000000000000000
newHeader: 4e45531a101040000000000000000000
All done. Wrote new file roms/Bases Loaded 3 (USA).nes
----------------------------------------------------
-> Adding a missing header
CRC check: 50CCC8ED
Found CRC match: Battleship
*** HEADER UPDATED ***
oldHeader:
newHeader: 4e45531a020430000000000000000000
All done. Wrote new file roms/Battleship (USA).nes
----------------------------------------------------
Here’s the script:
Continue reading →