CHD is for sure something to implement. The main problem is how to include it in the gui.
This should be the situation to get after a romcenter fix.
- A chd is not zipped
- It must be in a folder named with the game name
- It must be stored in the same folder as the corresponding rom
Now, what rc must deal with:
- The chd is zipped (unlikely, but possible)
- The chd is not in the rom folder
- The chd is not in a folder
- The chd is missing
The gui:
Databse node:
I think the best solution is to include it with the other roms, maybe with a special icon (red / yellow / green hd icon to design)
Folder node:
green folder : folder name ok, chd ok
Yellow folder : bad folder name and/or bad chd name
red folder : folder missing and zip available.
(RomCenter does not know yet how to handle missing folders.)
The datafile:
I must find a way to tell romcenter that the chd is not a simple rom. I'm not happy with the datafile structure because it is not easy to add informations, but I made it like that for efficiency when loading it. It is less an issue now that everybody have powerfull computer
So, a xml datafile will be my choice, but I still have to find a fast xml parser. Anyway, this is for future. For now, I think I will detect chd from the extension, so, no need to modify the datafile structure.
The sha1:
The chd sha1 can be stored in the datafile. The arcade plugin must be modified to add a sha1 calculator engine. This is trivial. But how to tell the plugin which signature it must calculate? crc or sha1? The best solution is to modify plugin interface and add a 'signature type' parameters to tell which signature I want. Then, we can get one datafile with multiple checksum. Right, this is what we need for chd: crc for common roms, and sha1 for chd.
I keep crc for common rom because crc is extracted from the zip archive, which is extremly fast. The use of md5 or sha1 for all roms means unzipping and running the routine for every rom. Anyway, if md5 and sha1 is implemented in the plugin, this is still possible to build a full sha1 or md5 datafile.
I still need to tell in the datafile which checksum to use with a rom. Once again, the best thing is to modify the datafile and add a signature type column to tell whether the signature is a crc, a sha1, a md5, or whatever you want as long as it match the signature type available in the plugin.
In a first time, I will leave the datafile like it is, and attach sha1 to chd extension (or sha1 to signature longer than 8 char ?)
The datafile modification will be trivial if needed.
So, lot of work, but especially lot of thought before doing it.
I don't know cd-chd. Can I handle them the same way as chd? Some games already use that ?
