CHD batch for newly supported systems

I just read that Beetle Saturn and PCE Fast now supports CHD compressed ISO or Bin files, does anyone know if there’s a batch somewhere that could compress them?

In linux, the mame-tools package can do it. I’d assume you can do something similar in Windows, too.

1 Like

the program is “chdman”. find a version that is higher than 0.146 as that causes issues. you can compile it using mame source code with TOOLS=1. i did this on linux and windows using

make SOURCES=/src/mame/drivers/pacman.cpp TOOLS=1 REGENIE=1

this should be a quick compile as it will only compile the pacman drivers as core then the tools package.

as for making it into batch, just create some script for it.

CHD support is available for mednafen-saturn, mednafen-pce fast, mednafen-supergrafx, mednafen-pcfx… others are still WIP

1 Like

Try the Dreamcast GDI2CHD Converter

I got it from here : Dreamcast GDI to CHD

There’s a batch file in there - if you edit it to the file extenstion you want to convert then save it, it works 100% - I’ve done all my Saturn and PCE-CD Bin/Cue files

Frank

1 Like

I tried that, but didn`t work, it returns a invalid parameter error, can you upload your edited batch so I can try that?

if you know how to handle batch files, this should work:

@echo off
@cls
set rompath=E:\EMULATORS\ConsoleISO\PCE-CD
set destpath=F:\TMP
for /R %rompath% %%G in (*.cue) do (
	echo.
	echo === Converting %%~nG to CHD ===
	chdman createcd -i "%%G" -o "%destpath%\%%~nG.chd" -f
	echo.
	echo.
)

edit “rompath” and “destpath” to your setup. save with .cmd extension to where your chdman is and then run in a dos prompt.

Thanks for the fast reply, unfortunately it didn’t work too, the window opens and closes right away. My current folder structure for the isos are, X:\Hyperspin\Roms\Sega Saturn\Game Folder (Region)\Game.bin, Game.cue.

Lots of games have multiple bin tracks.

The batch worked fine converting GDI Dreamcast isos to CHD, but no dice on the Saturn ones.

you need to understand how batch files works, and edit as to match your setup. this config works for my system with every cue sheet in a folder even when theyre on sub-subfolders.

I edited the fields and it ended up like this:

@echo off @cls set rompath=K:\HyperSpin\Roms\Sega Saturn set destpath=K:\TMP for /R %rompath% %%G in (*.cue) do ( echo. echo === Converting %%~nG to CHD === chdman createcd -i “%%G” -o “%destpath%%%~nG.chd” -f echo. echo. )

Saved as cmd, when I double click it, the window closes real fast, I’m not sure if I have the latest chdman, nor if this is the problem here. Would you share your batch script?

Thanks again @wertz

you had “space” in your filenames/directory. here’s a modified one:

@echo off 
@cls 
set rompath=K:\HyperSpin\Roms\Sega Saturn 
set destpath=K:\TMP 
for /R "%rompath%" %%G in (*.cue) do ( 
echo. 
echo === Converting %%~nG to CHD === chdman createcd -i "%%G" -o "%destpath%\%%~nG.chd" -f 
echo. 
echo. 
)
1 Like

It lost format when I pasted back in the reply, but in the batch (cmd) file, it’s just like your last post.

All I’d need is this cmd file with your lines and chdman in the same folder, right? If so, it’s not working here.

here is whatsnew in the edited one i posted

"%rompath%"

1 Like

It now opened the window and started processing, which is a good sign, it’s like this:

=== Converting Mega Man 8 - Anniversary Collector’s Edition (USA) to CHD === chdman createcd -i “K:\HyperSpin\Roms\Sega Saturn\Mega Man 8 - Anniversary Collector’s Edition (USA)\Mega Man 8 - Anniversary Collector’s Edition (USA).cue” -o “K:\TMP \Mega Man 8 - Anniversary Collector’s Edition (USA).chd” -f

=== Converting Megaman X3 (Europe) to CHD === chdman createcd -i “K:\HyperSpin\Roms\Sega Saturn\Megaman X3 (Europe)\Megaman X3 (Europe).cue” -o “K:\TMP \Megaman X3 (Europe).chd” -f

=== Converting Metal Black (Japan) to CHD === chdman createcd -i “K:\HyperSpin\Roms\Sega Saturn\Metal Black (Japan)\Metal Black (Japan).cue” -o “K:\TMP \Metal Black (Japan).chd” -f

I assume it should create the CHD files under K:\TMP, but it didn’t create the files, the window actually process all folders, seem to read the cue files only and the compressed files aren’t created.

move chdman a line down like so:

@echo off 
@cls 
set rompath=K:\HyperSpin\Roms\Sega Saturn 
set destpath=K:\TMP 
for /R "%rompath%" %%G in (*.cue) do ( 
echo. 
echo === Converting %%~nG to CHD ===
chdman createcd -i "%%G" -o "%destpath%\%%~nG.chd" -f 
echo. 
echo. 
)
1 Like

Some major progress, I also downloaded the latest chdman

=== Converting Brain Dead 13 (USA) to CHD === chdman - MAME Compressed Hunks of Data (CHD) manager 0.188 (mame0188) Output CHD: K:\TMP \Brain Dead 13 (USA).chd Input file: K:\HyperSpin\Roms\Sega Saturn\Brain Dead 13 (USA)\Brain Dead 13 (USA).cue Input tracks: 2 Input length: 58:52:30 Compression: cdlz (CD LZMA), cdzl (CD Deflate), cdfl (CD FLAC) Logical size: 648,553,536 Error creating CHD file (K:\TMP \Brain Dead 13 (USA).chd): file not found Fatal error occurred: 1

How come it says “file not found”?

“K:\TMP \Brain Dead 13 (USA).chd”

you had a “space” after the K:\TMP \ instead of it to be K:\TMP
goto destpath line and delete that space. hopefully you are editing using notepad++ here.

1 Like

Yes, I’m using notepad++, and it’s seems to be working now, besides the space in TMP, I added the backslash also in …\Sega Saturn, which hadn’t it, it’s compressing now:

=== Converting Shining Force III - Premium Disc (Japan) to CHD === chdman - MAME Compressed Hunks of Data (CHD) manager 0.188 (mame0188) Output CHD: H:\TMP\Shining Force III - Premium Disc (Japan).chd Input file: K:\HyperSpin\Roms\Sega Saturn!new\Shining Force III - Premium Disc (Japan)\Shining Force III - Premium Disc (Japan).CUE Input tracks: 2 Input length: 52:42:04 Compression: cdlz (CD LZMA), cdzl (CD Deflate), cdfl (CD FLAC) Logical size: 580,557,888 Compressing, 17.9% complete… (ratio=62.0%)

I also put the H: folder as the temp folder since it will work faster from one HDD to another.

Can’t thank you enough for your help and patience.

1 Like

ok good to know. we should ask @markwkidd if he has the time to convert this into an executable tool with gui so it should be easier to use :smiley:

3 Likes

Would be really nice to have a GUI for users like me, I believe it would benefit millions of people out there!

Something to note, don’t use the chdman from that old GDI to CHD batch package. My old Dreamcast CHDs I converted with that don’t work with Redream. I had to reconvert my GDIs with the latest version. I think the other cores use the same library for reading CHDs, so ISOs converted with that old chdman might not work in those either. Best to use the one that comes with the latest MAME; it probably gives you better compression anyways.

1 Like