The CHD format has been updated from time to time to support additional functionality. Originally, it only supported hard disk images, but it now supports optical media (CD-ROM, GD-ROM), and it can act as an A/V container for LaserDisc or video tape content. Eventually, the format may need to be extended to support things like raw scrambled DVD sector dumps and packet-based data tape formats like Ultrium LTO. Additional compression algorithms have been added at various times. The current version of chdman (as of MAME 0.224) creates version 5 CHD files, but it supports older version 3 and version 4 CHD files. Likewise, MAME 0.224 can use CHD files in versions 3, 4 and 5 of the CHD format.
CHD files contain both the data from the media, and metadata describing the media. Newer read-only CHD files contain an SHA1 digest of the combined data and metadata, and an additional SHA1 digest of the data only. Older CHD versions only contained an SHA1 of the data. You can view CHD file details using the chdman tool, for example the disk image MAME expects for Killer Instinct:
Code: Select all
$ chdman info -i roms/kinst/kinst.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.224 (mame0224)
Input file: roms/kinst/kinst.chd
File Version: 4
Logical size: 131,076,608 bytes
Hunk Size: 4,096 bytes
Total Hunks: 32,002
Unit Size: 512 bytes
Total Units: 256,009
Compression: zlib (Deflate)
CHD size: 95,627,918 bytes
Ratio: 73.0%
SHA1: 81d833236e994528d1482979261401b198d1ca53
Data SHA1: a37a2c5e52ea936a715210d237874dd573bb002f
Metadata: Tag='GDDD' Index=0 Length=34 bytes
CYLS:419,HEADS:13,SECS:47,BPS:512.
The data SHA1 digest will be the same for any CHD file containing the same data. The overall SHA1 digest of the data and metadata will change if any of the metadata changes (e.g. the cylinder/head/sector geometry for the disk in this case), or if the file is recreated with a newer version of chdman that supports additional metadata. Neither of the SHA1 digests shown here are affected by the compression algorithm used – they’re calculated on the uncompressed data stored in the container.
In situations where a newer version of chdman supports more metadata, MAME will expect a CHD file created with the correct version of chdman. For example, CHD version 5 supports important GD-ROM metadata that was not supported in older versions, so we’ve recreated most or all of the GD-ROM CHD images as version 5 to accurately preserve GD-ROMs.
In other cases, we haven’t recreated all the images in the software lists in the latest CHD format. For example, a lot of CD-ROM images in the software lists are still version 4 CHD files. Version 5 actually
does support additional CD-ROM metadata, so if you recreate these CD-ROM CHDs from the best available dumps using the latest version of chdman, you’ll get a different overall SHA1 digest of the data and metadata, and it won’t match the software list.
The short answer to your question is that there’s no reason to recreate your CHD images if the ones you have work. If you’re using software lists, it’s best to get your CHDs from the usual sources to ensure they match what MAME expects.