1

Hello,

I use chdman.exe to store my optical disc dump. Data is compressed at its most and it's a convenient format to use with most emulators. I can use chdman.exe ton rebuild a BIN/CUE set and burn my dump to an optical disc.

Sample of my CUE file index:

FILE "BC Racers (USA).bin" BINARY
  TRACK 01 MODE1/2352
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    PREGAP 00:02:00
    INDEX 01 08:31:32
  TRACK 03 AUDIO
    INDEX 00 10:43:40
    INDEX 01 10:45:40
  TRACK 04 AUDIO
    INDEX 00 11:29:01
    INDEX 01 11:31:01

I see Redump's .dat files use the BIN/CUE format too. But it doesn't looks like as usual. In the XML .dat file, games definitions are looking for different .bin files.

<game name="BC Racers (USA)">
        <category>Games</category>
        <description>BC Racers (USA)</description>
        <rom name="BC Racers (USA).cue" size="1356" crc="53959ce3" md5="851c8e55c19580505e6c50196d20399d" sha1="fb8392dd223721905cb6210e5e11f4b5d156fcf8"/>
        <rom name="BC Racers (USA) (Track 01).bin" size="90215664" crc="58713826" md5="7c621bc9c9e26089fb415b1a157e3ad7" sha1="127c3dc4d0bcb69d1528ce760604d8ec9820028c"/>
        <rom name="BC Racers (USA) (Track 02).bin" size="24009216" crc="08ad95f3" md5="10280244ee99ab4102a961313d7d3fd6" sha1="83ec5edf6bb33a68d6a3c88ec0a552500fd1a117"/>
        <rom name="BC Racers (USA) (Track 03).bin" size="8022672" crc="aa3ed156" md5="262588d3b43ca78731b423eb711b3591" sha1="87840132e34eb943d9b644b46ed1b56ac4ffc9db"/>
        <rom name="BC Racers (USA) (Track 04).bin" size="42423024" crc="9e7326c0" md5="0d99446de2813b8e3984fb4242be8815" sha1="b2fbd88344949e653faeddaaebc76b59d3ee010d"/>
    </game>

In my sample,  I understand my .bin file contains 4 tracks but to be compliant I need 4 .bin files.

How can I split my merged bin file (rebuilt with chdman.exe) into separated bin files for each tracks ? I would like to check/compare my dumps with ClrMamePro and Redump's .dat files.

2

I was lucky this night^^

I found the binmerge.exe tool here : https://github.com/putnam/binmerge
Its --split (or -s) option can split a .bin file like it's required with Redump's .dat files.

Here is my batch script to convert a directory with many .chd files :

@ECHO OFF
CLS  

SET sourcepath="D:\chdman\chd"
SET workpath=%TEMP%
SET destpath="D:\chdman\split"

COPY chdman.exe %sourcepath% /Y

FOR /R "%sourcepath%" %%R IN (*.chd) DO ( 

ECHO. 
ECHO ### Converting chd to %%~nR.bin ###
MKDIR "%destpath%\%%~nR"
%sourcepath%\chdman.exe extractcd -i "%sourcepath%\%%~nR.chd" -o "%destpath%\%%~nR\tmp.cue" -ob "%destpath%\%%~nR\tmp.bin" -f
binmerge.exe --split "%destpath%\%%~nR\tmp.cue" "%%~nR"

DEL "%destpath%\%%~nR\tmp.bin" /F
DEL "%destpath%\%%~nR\tmp.cue" /F
)

DEL %sourcepath%\chdman.exe /F

PAUSE
EXIT

3

The batch script doesn't seem to work with the latest release of chdman.

4

Andearoid wrote:

I was lucky this night^^

I found the binmerge.exe tool here : https://github.com/putnam/binmerge
Its --split (or -s) option can split a .bin file like it's required with Redump's .dat files.

Here is my batch script to convert a directory with many .chd files :

@ECHO OFF
CLS  

SET sourcepath="D:\chdman\chd"
SET workpath=%TEMP%
SET destpath="D:\chdman\split"

COPY chdman.exe %sourcepath% /Y

FOR /R "%sourcepath%" %%R IN (*.chd) DO ( 

ECHO. 
ECHO ### Converting chd to %%~nR.bin ###
MKDIR "%destpath%\%%~nR"
%sourcepath%\chdman.exe extractcd -i "%sourcepath%\%%~nR.chd" -o "%destpath%\%%~nR\tmp.cue" -ob "%destpath%\%%~nR\tmp.bin" -f
binmerge.exe --split "%destpath%\%%~nR\tmp.cue" "%%~nR"

DEL "%destpath%\%%~nR\tmp.bin" /F
DEL "%destpath%\%%~nR\tmp.cue" /F
)

DEL %sourcepath%\chdman.exe /F

PAUSE
EXIT

Can you modify this bat so that the paths for the chd files and bin files don't have to be specified as long as chdman, binmerge and the chds are all in the same folder it will find the chds convert then split them? As long as everything is in the same root directory. IDK how to do that.