Thread: CHD format
View Single Post
Old 22 July 2020, 01:46   #8
Ian
Global Moderator

Ian's Avatar
 
Join Date: May 2001
Location: Derby, UK
Age: 44
Posts: 2,258
This is what I've knocked up and it creates matching files without any issues from CHD to iso&wav, I am bang average at batch files though, so this could probably be improved, at the moment is just a bunch of for loops.

Code:
SET PATH=C:\Program Files\7-Zip

for %%g in (*.chd) do (
	.\1-files\chdman extractcd -i "%%g" -o "%%~ng.cue" -ob "%%~ng.bin"
)

for %%h in (*.cue) do (
	.\1-files\binmerge\binmerge.exe -s "%%h" "%%~nh.new"
	.\1-files\bin2wav.exe "%%~nh.new.cue"
	.\1-files\piso convert "%%~nh.new (Track 01).bin" -o "%%~nh.new (Track 01).iso"
	del /F /Q "%%h"
)

for %%i in (*.bin) do (
	del /F /Q "%%i"
)

for %%j in (*.chd) do (
	7z a -tzip "%%~nj.zip" "*.new (Track*.*"
	del /F /Q "*.new*.*"
)
So loop 1 converts the CHDs to cue and bin.

Loop 2, splits the bin, converts the bins to wave, also the data track back to iso and deletes the cue sheet created from the CHD.

Loop 3 deletes all the unneeded bin files

loop 4 zips up the iso and wavs, as cuesheets are provided from tosec not much point going through the ball ache of renaming all the files, and generating a matching cuesheet as this will all be fixed when run through clrmame.

I guess I could nest the 2, 3 and 4th within the first one so it works on 1 chd, does all the tasks then starts the next one kinda like this:

Code:
SET PATH=C:\Program Files\7-Zip

for %%g in (*.chd) do (
	.\1-files\chdman extractcd -i "%%g" -o "%%~ng.cue" -ob "%%~ng.bin"

	for %%h in (*.cue) do (
		.\1-files\binmerge\binmerge.exe -s "%%h" "%%~nh.new"
		.\1-files\bin2wav.exe "%%~nh.new.cue"
		.\1-files\piso convert "%%~nh.new (Track 01).bin" -o "%%~nh.new (Track 01).iso"
		del /F /Q "%%h"
	)

	for %%i in (*.bin) do (
		del /F /Q "%%i"
	)

	for %%j in (*.chd) do (
		7z a -tzip "%%~nj.zip" "*.new (Track*.*"
		del /F /Q "*.new*.*"
	)
)
probs ugly as fuq for someone that knows what they are doing

All suggestions welcomed
Ian is offline  
 
Page generated in 0.06398 seconds with 11 queries