I performed many tests with my Dreamcast dumps and the Batocera 5.27.2 and I found to make a valid CHD for your Dreamcast emulator, you need to build it from the .gdi index file instead of the .cue file.
You can find in my Google Drive : __5vdUIafedAKU
. Gdi2CHD.zip : it contains the gdi2chd.bat and the chdman.exe to convert your .GDI dumps into compressed .CHD.
. CHD2SplitGdi.zip : it can rollback your .CHD into its first .GDI uncompressed state.
Convert your modded games into .CHD, and try to play them with your Dreamcast emulator. Then rollback your .CHD to .GDI and compare the restored .GDI dump with your original .GDI dump, using a tool like Beyond Compare. Each .BIN file must have the same binary checksum.
I think in the next MAME 0.230 release, the chdman.exe tool will be ready to convert any .GDI and .CUE dumps into .CHD. However, if you convert a .GDI into .CHD, you cannot rollback the .CHD into .CUE. Because .GDI should be used with Tosec dumps and .CUE should be used with Redump dumps.
So for now, I used .GDI to compress my Dreamcast GDI dumps into .CHD. And .7Z with LZMA to compress my Dreamcast MIL-CD dumps. Then I wrote a quick fix to get .7Z support in my Batocera. My updated code is here : -dreamcast-emulators-and-the-chd-compressed-file-format-support/5
from the looks of it, the functionality was not implemented in version .237 either, this is really too bad, was really looking forward to it, hopefully on the next version i guess. anyhow thanks for your reply
Because we have now a 100% working tool to encode and rollback our Dreamcast .bin/.cue dumps. I processed the last available fullset from ReDump (2021-10-06) and every GD-Rom dumps were encoded into CHD, then restored into .bin/.cue without any error.
For my convenience I wrote 2 DOS scripts too :
. cue2chd_DCue.bat : to convert all .bin/.cue from a specified folder into compressed .chd files
. chd2splitbin_DCue.bat to rollback all .chd from a specified folder into its original .bin/cue format