This is a copy of a request at the rust port of this library. I know this is 'overreach' of the purpose of the library of trying to reimplement the format, not chdman, but i fully believe this feature would make chd more popular because the vast vast vast majority of existing hacks are in xdelta, not to mention that i doubt that hacks would ever be distributed as chd child 'roms' in spite of being equivalent in not being the actual game, just for appearances sake, because .chd is a actual rom format as far as the internet is concerned. And if it's implemented downstream maybe MAME will actually get moving on this.
Xdelta (with some outliers in certain platforms of ppf) is the standard way to apply romhacks to cds currently in romhacking.net. It would simplify the life of users a lot, and in the case this library is ever used to create a command line application, if chd had the ability to take a .xdelta patch and apply it to a chd, producing not changes to the chd but a 'child' chd.
If you'd like to go beyond, ppf would be nice too. I believe both ppf and xdelta have checksum verification of the result and maybe the source too.
There is a very unfortunate binary format being used for saturn and dreamcast hacking called sega saturn patcher which is a zip file with several kind of hacks, options and transformations¹ wrapped around a executable which doesn't actually work outside of windows or in wine, which could also be a target, except i fucking hate it (see: doesn't work in linux or wine) and think it would be a mistake to support, since it does many transformations of the original dumps to adapt the source to the result (ie: 'tries not to rely on specific rips').
Anyway and since i don't mind a bit of hypocrisy in a good cause, the usecase is, obviously, not having to decompress and reformat back to cue/bin or toc/bin a file before applying a patch. I'm actually unsure if this is actually possible in all cases since afaik, xdelta patches usually apply to a single track, the binary track. Would be kind of a bummer if they couldn't apply because most patches target the redump format with separate tracks and chd outputs the format with 1 single track. Ideally the target track could be autodetected or as fallback, specified.
Regardless because of that doubt and because of the need to uncompress, you can see why this would make users life easier no? 1 command is easier to explain than 3, and it's not the average user that will feel comfortable extracting a chd, then separating a .bin into tracks, then applying the xdelta, then creating a cue file for them before creating the child chd and deleting all the intermediate files.
¹ A occasional needed conversion in romhacks source discs is turning a 'MODE 1 / 2352' binary track into a iso without checksum data 'MODE 1 / 2048' iirc. This sometimes happens in hacks for sega consoles, for 'some' reason (probably the completely terrible dump situation on those consoles and them using cdi in the older ages, so the hackers first turned the cd image to iso before starting to replace files). This is probably the main 'problem' sega saturn patcher attempts to solve - the alternative to adapt the patch to other dumps is to create the patched rom the usual way, extract the files and attempt to glue them to redump/MAME dumps manually, a complicated process that may require rebuilding the cd image in subtle ways. I wouldn't complain about a switch that did this before applying a patch.
I didn't realize this project doesn't have write of chd yet. I guess you can close this until it does, if ever, but i'll leave the decision of closing it to you.
This is a copy of a request at the rust port of this library. I know this is 'overreach' of the purpose of the library of trying to reimplement the format, not chdman, but i fully believe this feature would make chd more popular because the vast vast vast majority of existing hacks are in xdelta, not to mention that i doubt that hacks would ever be distributed as chd child 'roms' in spite of being equivalent in not being the actual game, just for appearances sake, because .chd is a actual rom format as far as the internet is concerned. And if it's implemented downstream maybe MAME will actually get moving on this.
Xdelta (with some outliers in certain platforms of ppf) is the standard way to apply romhacks to cds currently in romhacking.net. It would simplify the life of users a lot, and in the case this library is ever used to create a command line application, if chd had the ability to take a .xdelta patch and apply it to a chd, producing not changes to the chd but a 'child' chd.
If you'd like to go beyond, ppf would be nice too. I believe both ppf and xdelta have checksum verification of the result and maybe the source too.
There is a very unfortunate binary format being used for saturn and dreamcast hacking called sega saturn patcher which is a zip file with several kind of hacks, options and transformations¹ wrapped around a executable which doesn't actually work outside of windows or in wine, which could also be a target, except i fucking hate it (see: doesn't work in linux or wine) and think it would be a mistake to support, since it does many transformations of the original dumps to adapt the source to the result (ie: 'tries not to rely on specific rips').
Anyway and since i don't mind a bit of hypocrisy in a good cause, the usecase is, obviously, not having to decompress and reformat back to cue/bin or toc/bin a file before applying a patch. I'm actually unsure if this is actually possible in all cases since afaik, xdelta patches usually apply to a single track, the binary track. Would be kind of a bummer if they couldn't apply because most patches target the redump format with separate tracks and chd outputs the format with 1 single track. Ideally the target track could be autodetected or as fallback, specified.
Regardless because of that doubt and because of the need to uncompress, you can see why this would make users life easier no? 1 command is easier to explain than 3, and it's not the average user that will feel comfortable extracting a chd, then separating a .bin into tracks, then applying the xdelta, then creating a cue file for them before creating the child chd and deleting all the intermediate files.
¹ A occasional needed conversion in romhacks source discs is turning a 'MODE 1 / 2352' binary track into a iso without checksum data 'MODE 1 / 2048' iirc. This sometimes happens in hacks for sega consoles, for 'some' reason (probably the completely terrible dump situation on those consoles and them using cdi in the older ages, so the hackers first turned the cd image to iso before starting to replace files). This is probably the main 'problem' sega saturn patcher attempts to solve - the alternative to adapt the patch to other dumps is to create the patched rom the usual way, extract the files and attempt to glue them to redump/MAME dumps manually, a complicated process that may require rebuilding the cd image in subtle ways. I wouldn't complain about a switch that did this before applying a patch.