Scanning and Rebuilding CHDs

From Retro Arcade Guides

Two "MAME CHDs (Merged)" dat-files are provided. A table with their differences follows:

Comparison Dir2Dat dat-file Regular dat-file (aka XML dat-file)
Objective Join a torrent at the best completion possible Organize the files in a way the emulator can find them
Dat-file created by clrmamepro's Dir2Dat Emulator (or by the MAME_DFC tool for example)
Has Parent-Clone relationships? No Yes
Merging Modes Can't be selected on clrmamepro (1) Can be selected on clrmamepro
CHD Hashes 'external' (according to all the contents of the CHD file, as a whole) 'internal' (calculated only on the data part of the CHD file, excluding the metadata)
XML tag of CHDs 'rom' 'disk'
Has size information? Yes No (2)
clrmamepro's scanner The 'CHDs' option can't be selected (3) The 'CHDs' option must be selected
clrmamepro's rebuilder Works as expected for CHDs Doesn't work as expected for CHDs (use the Dir2Dat dat-file instead)


(1) Because there isn't information about parent-clone relationships, the Merging Mode can't be selected on clrmamepro's scanner.

(2) The MAME emulator checks only the 'internal' hash (size isn't checked) of CHDs before starting emulation, because there can be two or more CHD files with the same 'internal' hash but with different 'external' hashes and sizes. Read DIF File for more information.

(3) CHDs in 'rom' XML tags makes clrmamepro 'think' those are regular (non-CHD) files, and because of that the 'CHDs' option can't be selected on clrmamepro's scanner.


Below are the hashes of the Area 51 CHD as reported by different sources:

  • According to CHDMAN ('internal' hash):
Input file:   area51.chd
File Version: 5
Logical size: 1,281,982,464 bytes
Hunk Size:    4,096 bytes
Total Hunks:  312,984
Unit Size:    512 bytes
Total Units:  2,503,872
Compression:  lzma (LZMA), zlib (Deflate), huff (Huffman), flac (FLAC)
CHD size:     497,632,790 bytes
Ratio:        38.8%
SHA1:         3b303bc37e206a6d7339352c869f050d04186f11
Data SHA1:    9ea749404c9a5d44f407cdb8803293ec0d61410d
Metadata:     Tag='GDDD'  Index=0  Length=35 bytes

  • According to the regular (XML) dat-file ('internal' hash):
<game name="area51">
	<description>Area 51 (R3000)</description>
	<manufacturer>Atari Games</manufacturer>
	<disk name="area51" sha1="3b303bc37e206a6d7339352c869f050d04186f11"/>

  • According to the Dir2Dat dat-file ('external' hash):
<machine name="area51">
	<rom name="area51.chd" size="497632790" crc="fe0e16af" sha1="86b126ee2d613d7e3ba5b12886962ccfbc8817e2"/>
	<rom name="area51t.chd" size="500902311" crc="9b7b51e1" sha1="20e5052ca2b276fd4832a61dcad8ce3bd91b0e64"/>

Name:	area51.chd
Size:	497632790
CRC32:	fe0e16af
MD5:	19ffdd41d0a05e882a6b08638f4c17ac
SHA1:	86b126ee2d613d7e3ba5b12886962ccfbc8817e2

See also