Jump to content
LaunchBox Community Forums

PCSX2 doesn't like .cue files (inside .zip), can launchbox send the .bin instead?


Z3R0B4NG

Recommended Posts

tl;dr
I need a way to tell LaunchBox to send the .bin instead of the .cue inside a .zip to the emulator.

 

I am fooling around with PCSX2 and REDUMP .dat compliant images.  
All through Launchbox of course... everything is in zip format to save space, Launchbox is set to decompress before handing over to the emulator.  

Some images are .iso format (they work fine) and some are .cue+.bin format, those always give me an error message "CDVD Plugin failed to open ...blah blah blah".  

I started digging into the problem a bit and apparently PCSX2 doesn't like it when you try to open the .cue file instead of the .bin!!!  *facepalm*  
I deleted the .cue in one file and it started fine with just the .bin inside the .zip.  

Now the images are compliant with the REDUMP .dat files and it would be a huge PITA to manually go through all files and delete the .cue files (then clrmamepro would bitch about the missing .cue files when scanning or updating the collection), extracting them all so i can point LaunchBox to *.bin and *.iso while importing roms would work but then the compression is gone, not to mention it would take quite some hours (days!) to extract >3TB of stuff... and there is no way to be sure what is .iso and what is .bin format in there, that all sucks...

Edited by Z3R0B4NG
Link to comment
Share on other sites

No, then the hashes inside the .dat file won't match the new iso files at all.  
The easiest would be of course if the emulator would just accept .cue files that point to the .bin ...like it should be.  

...oh welp, i guess i'm extracting it all (in manageable chunks), and repack it as .rar without any .cue files.  
adding the .cue files back in is easy enough with clrmamepro if that should ever be needed.  

It will just take forever but at least i don't have to go through 2000+ files manually ...and .rar has better compression anyway.

Edited by Z3R0B4NG
Link to comment
Share on other sites

I figured there has to be an easier way... found this,

Copied from: https://www.sevenforums.com/general-discussion/337273-bulk-delete-certain-types-files-rar-zip-archive.html

Quote

 

Hi,

The below script should do the trick, you are best putting all your .rar files into a single folder and replace the bit i have marked <file_path_here> with the path to the folder with all the .rar's

From Command Line

Code:

for %I in (<file_path_here>\*.rar) do "C:\Program Files\WinRAR\WinRAR.exe" d -ibck "%I" *.txt

From Batch File

Code:

for %%I in (<file_path_here>\*.rar) do "C:\Program Files\WinRAR\WinRAR.exe" d -ibck "%%I" *.txt

*** Important ***
Create yourself a test folder with a copy of a couple of the .rars and do a small test against them first


At the end of the script you will notice .txt, specify the file extension you want to remove there
You can list multiple file extensions at once...

Code:

for %%I in (<file_path_here>\*.rar) do "C:\Program Files\WinRAR\WinRAR.exe" d -ibck "%%I" *.txt

 

Sounds like winrar will also do .zip files (vs just PKZip).  Just replace .rar with .zip in the script/batch file.  Also, (reading on) sounds best to do your files in manageable chunks.
Link to comment
Share on other sites

Unless Im reading this wrong but if you imported .cue files into PS2, then go back to the data\/xml file for ps2 platform and mass replace ann .cue to .bin and vola your games will load correctly now, no need to do any extra work or converting.

Link to comment
Share on other sites

  • 5 months later...

Ugh... that's a lot of work kuz I have around 7000 ps2 games bin/cue format. I'll probably try the batch file method to scan every zip file and delete the cue files unless another easier method can be found. Would be so much easier if we could just tell launchbox what file types to look for for each system in order of presence 

Link to comment
Share on other sites

i did not actually test it yet (this kinda fell off my radar) but for WinRar the batch file should look like this:

!_clean_up.bat

for %%I in (*.rar) do "C:\Program Files\WinRAR\WinRAR.exe" d -Y -ibck "%%I" *.cue

replace *.rar with *.zip if that is your format. make sure the path to winrar is correct.  
you can delete multiple files with different names by just writing more names at the end,  

like 

 *.cue *thumbs.db *ComicInfo.xml

just place the .bat file in the same folder with the image files, start it and let it do it's thing, when its done it will just close the command prompt again.  
with 7000 images that will take a LONG time though, so maybe do it in smaller chunks.  

and of course test the batch file first with a few test files and make sure it works as intended.  

if one day you want to add the .cue files back into it you just need to download the cue files pack from redump and throw that into the add folder with clrmamepro, point being this is reversible if you ever want to update your dumped files with the latest redump.dat and it can still be scanned to make sure no CRC errors crept in.  
Or whenever a solution in either the pcsx2 emulator or launchbox shows up for this which is actually compliant with regular redump images, which would be the user friendly thing to do.

  • Like 1
Link to comment
Share on other sites

For a quick interim fix... You can try an AHK script.  Add a new emulator that points to the script file.  Associate the PS2 games to the new 'emulator'.

Extract, Run PS2 bin file, Delete  ERPS2binD.ahk  (quick and dirty, but works)

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

PCSX2 = F:\Emulators\pcsx2\pcsx2.exe	;change path to your pcsx2 location

FullFile = %1%
SplitPath, FullFile,,dir,,NameNoExt
outdir = %dir%\%NameNoExt%_tmp

if (A_Is64bitOS = 1) {
    RunWait, "C:\Program Files\7-Zip\7z.exe" x -y -o"%outdir%" "%1%",,Hide
} else {
    RunWait, "C:\Program Files (x86)\7-Zip\7z.exe" x -y -o"%outdir%" "%1%",,Hide
}

RunWait, %PCSX2% --fullscreen --nogui "%outdir%\%NameNoExt%.bin"
FileRemoveDir, %outdir%, 1
ExitApp

(Be sure sure change the path in line #5)

 

1.thumb.PNG.c7d5c2bc0f5a7c0b370ea348998690ae.PNGNote NO checked boxes.

 

2.PNG.47223eceb531050ae7a7fcb2f268308c.PNGAdd this to the AutoHotKey Script tab 

$Esc::
	{
	Process, Close, pcsx2.exe
	}

Note: The original  "Process, Close, {{{StartupEXE}}}"   won't work with the script.  But the above does.

What the script does is:
Extracts the files in your .zip OR .7z file to a temp directory using 7z.exe.
Runs pcsx2 with the extracted .bin file that's now in the temp directory.
When pcsx2 closes/exits, the temp directory is deleted.

Caveats:
You need to edit line #5 in the script.
7z.exe must be installed.
The .bin file name needs to be exactly the same as the zipped file name.
This doesn't take in to account custom configs. 

So with that last one, this is almost useless. But a something none-the-less.  Maybe if someone knows how to pass an argument to a script, a per-game config can be added in.

 

 

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Got a wild hair and revamped the script to look for (and load) game-specific custom configs.

You still need to have 7-zip installed and you'll need to edit the location for pcsx2.exe and the directory were the config folders are stored.  Otherwise that's pretty much it other than creating the new 'emulator'.

;********** Extract - Run PS2 bin file - Delete temp folder  **********
;
; PCSX2 script file for LaunchBox/BigBox to run a games bin file that is inside a compressed file.
; Will work with any zip format that 7z.exe handles (zip, 7z, rar...)
;
; This will also look to see if you have a custom configuration for the game
; and if so, will load that with the game.
;
; The zip file must be the same name as the bin file
; The config folder must be the same name as the zip file
; i.e.
; Ghostbusters-The Video Game (USA).zip
;   Ghostbusters-The Video Game (USA).bin
;   Ghostbusters-The Video Game (USA).cue
; ..\pcsx2\MyConfigs\Ghostbusters-The Video Game (USA)
;
;****************
; Edit "PCSX2 =" to point to your pcsx2.exe file
; Edit "PS2Config =" to point to where your configuration folders are located
;****************
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

PCSX2 = F:\Emulators\pcsx2\pcsx2.exe
PS2Config = F:\Emulators\pcsx2\MyConfigs

FullFile = %1%
SplitPath, FullFile,,dir,,NameNoExt
outdir = %dir%\%NameNoExt%_tmp

if (A_Is64bitOS = 1) {
    RunWait, "C:\Program Files\7-Zip\7z.exe" x -y -o"%outdir%" "%1%",,Hide
} else {
    RunWait, "C:\Program Files (x86)\7-Zip\7z.exe" x -y -o"%outdir%" "%1%",,Hide
}

IfExist %PS2Config%\%NameNoExt% 
    {
    RunWait, %PCSX2% --fullscreen --nogui "%outdir%\%NameNoExt%.bin" --cfgpath="%PS2Config%\%NameNoExt%"
    } 
else 
    {
    RunWait, %PCSX2% --fullscreen --nogui "%outdir%\%NameNoExt%.bin"
    }

FileRemoveDir, %outdir%, 1
ExitApp


 

 

  • Like 2
Link to comment
Share on other sites

  • 3 years later...
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...