JK1974 Posted March 13, 2009 Share Posted March 13, 2009 New version of the script:@echo onset directory=%1set directory=%directory:~1,-1%set file=%2set file=%file:~1,-1%mkdir %temp%\Gameex_tempcopy "%directory%\*.cue" %temp%\Gameex_tempcopy ..\packiso\*.* %temp%\Gameex_tempcd %temp%\Gameex_tempecho Set objArgs = WScript.Arguments >> messagebox.vbsecho Set objShell = CreateObject("Wscript.Shell") >> messagebox.vbsecho intReturn = objShell.Popup(objArgs(0), 3, "Recreating Playstation image") >> messagebox.vbsmessagebox.vbs "Extracting 7z archive with binary data. Please wait..."7za e "%directory%\*.7z"messagebox.vbs "Adding ECM..."unecm.exe *.ecmdel "*.ecm"messagebox.vbs "Uncompressing APE audio tracks..."for %%i in ("%directory%\*.ape") do mac "%%i" "%%~ni.wav" -d && sox.exe "%%~ni.wav" -t raw -s -c 2 -w -r 44100 "%%~ni.bin" && del "*.wav"del "*.exe"messagebox.vbs "Mounting image and starting emulation...""%programfiles%\Daemon Tools Lite\daemon.exe" -mount 0,"%temp%\Gameex_temp\%file%"cd %programfiles%\GameEx\Emulators\epsxestart/wait %programfiles%\GameEx\Emulators\epsxe\epsxe.exe -nogui -analog1ping -n 3 localhost > nul"%programfiles%\Daemon Tools Lite\daemon.exe" -unmount 0rmdir /s /q %temp%\Gameex_tempThe original code had one big disadvantage: The temp directory got too big because the there was the copy, the non-ECM file and finally the ECMed bin track - and additionally the ape, the wav and the wav-bin files. Furthermore, copying the 7z archive as well as the ape tracks took unnecessary time - this new script does the un-7z-ing and APE-2-wav conversion "on-the-fly" without using the temp folder.Furthermore, I added self-closing message boxes to get at least some status messages. I am not satisfied with them but maybe they are better than nothing.Last-but-not-least: You don´t need the packiso package anymore, you can use 7za, unecm, mac and sox from their project websites. However, packiso contains all those tools, so it is still worth downloading.Nevertheless: The epsxe parameter -analog1 still seems not to work as expected... Many thanks to Google who helped my find more information about DOS and VBS syntax. Link to comment Share on other sites More sharing options...
Recommended Posts