PlayStation and .zip files
-
@mediamogul said in PlayStation and .zip files:
I've got a way in mind that might work, but outside of being an interesting excercise, you'd really be better off just using eboot
.pbp
files. From what I hear, they offer reasonably good compression. They also have the advantage of offering multi-disc capabilities from a single file.Depending on the games the compression rate is usually between 5% to 35% on average and also i prefer it with multi disc based games cause for most that is 3-4 CD's is usually 20% compressed and if i remember i got Tekken 3 compressed down by 80%.
-
@mediamogul said in PlayStation and .zip files:
I've got a way in mind that might work, but outside of being an interesting excercise, you'd really be better off just using eboot
.pbp
files. From what I hear, they offer reasonably good compression. They also have the advantage of offering multi-disc capabilities from a single file.Hi, I’m interested in your idea. I like exercises. I tried the PBP way but it became tedious and the purist in me likes keeping the bin/cue files, albeit zipped.
-
@thedatacereal There is no other advantage than space saving.
-
@TheDataCereal
The main benefit is compression, but a lot of people seem to like the single file solution for multi-disc games that it offers as well. Myself, I just use bin/cue files and switch them out through the UI. This is mostly to maintain compatibility with all my different emulation setups, as bin/cue is best supported all around.
Hi, I’m interested in your idea. I like exercises.
Keen beans then. First, you'd want to zip your
.bin
files, but not the.cue
files. You should now have two files for every game, such asgamename.cue
andgamename.zip
for example. Now, create a script file namedlr-pcsx-rearmed-unzip.sh
at/opt/retropie/configs/psx/
, make it executable and then add the following to it:#!/bin/bash ##set path to .cue file CUEPATH="$(sed '3q;d' /dev/shm/runcommand.info)" ##set path to .zip file based on .cue path ZIP=$(echo "$CUEPATH" | cut -f 1 -d '.' | sed 's/$/.zip/') ##set path to .zip directory based on .zip path ZDIR=$(dirname "$ZIP") ##unzip .bin file unzip "$ZIP" "$ZDIR" ##wait for unzip to execute, then wait for it to finish until [ -n "$UZPID" ]; do UZPID="$(pgrep -f unzip)" sleep 1 done while [ -n "$UZPID" ]; do UZPID="$(pgrep -f unzip)" sleep 1 done ##launch emulator with .cue file, which should now be able to access the unzipped .bin /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-pcsx-rearmed/libretro.so --config /opt/retropie/configs/psx/retroarch.cfg "$CUEPATH"
Next, add the following to
/opt/retropie/configs/all/runcommand-onend.sh
:##if unzip was used, set path to .zip file based on .cue path and delete .bin file if [ "$2" = "lr-pcsx-rearmed-unzip" ]; then BIN=$(echo "$3" | cut -f 1 -d '.' | sed 's/$/.bin/') rm >> /dev/shm/runcommand.log 2>&1 "$BIN" fi
Finally, add the following line to
/opt/retropie/configs/psx/emulators.cfg
lr-pcsx-rearmed-unzip = "bash /opt/retropie/configs/psx/lr-pcsx-rearmed-unzip.sh %ROM%"
While you're there, go ahead and set
default="lr-pcsx-rearmed-unzip"
Now, in theory, everytime a
.cue
file is launched, the corresponding.bin
file will be unzipped and Retroarch will be launched afterwards, where it will use the.cue
to find and run the freshly unzipped.bin
. Once exited, the.bin
file will be deleted. Again, it should be said that this should work in theory, as I haven't actually tested it. If nothing else, it should give some insight as to how all these pieces can potentially fit together. -
@mediamogul Brilliant, I can see how it would work. Launching an script instead of the emulator. I think with that solution you could go full hog and keep the bin and cue in a zip, allow zip as an extension for the emulator then the script could unzip both and launch the cue. I’ve thought of a slight snag which involves multi-disc games as the remaining discs would still be zipped. But I think some cunning regular expressions could unzip those too. I’ll get cracking later. 😊
-
-
@iyonuk Just be aware that every time you'll launch the game, the game will be unzipped. You'll have to wait for the
unzip
command to finish its job before the game will actually be launched.
If you're doing this on a Raspberry PI, you can wait quite a few minutes and maybe more. -
@mitu Hmm, I hadn’t really thought of the unzipping performance. I’ll have to try a few unzips out.
-
@mitu said in PlayStation and .zip files:
If you're doing this on a Raspberry PI, you can wait quite a few minutes and maybe more.
No problem. Just script another game to launch while you're waiting. ;)
-
@mediamogul said in PlayStation and .zip files:
Just script another game to launch while you're waiting. ;)
Just quickly launch a game while you're waiting for the game to start :)
-
Well... no need for any of this. Added zip to the supported list in es_systems.cfg and tried a game for the sake of it and it works. RetroArch unpacks it to /tmp/retroarch. It takes a while to start, blank screen whilst it unpacks but that solves my storage issue. 😃
-
Probably spoke too soon. Need to try some with multiple bin files.
-
Bit of a mixed bag at the moment. Passing a zip file in does indeed extract the zip to /tmp/retroarch but only the first bin file. I’ve adapted your script to work with a zip file and extract everything to /tmp/psx (cue and all bins). This works fine and the game loads, however RetroArch is now ignoring the display settings I had setup for PCSX ReArmed and is launching in 1080p with only the top-left quarter of the screen displaying the full image (I had display for PCSX ReArmed set to CEA1 with custom offsets/width/height to fill my screen). I noticed that an —appendconfig is used when launching PCSX ReArmed normally but this is only to set the refresh rate to 60hz. The other issue is minor in that running from /tmp/psx also saves the srm file there. So I might have to switch back your script to extract to the rom location. Any ideas why my display settings might be borked?
-
@iyonuk said in PlayStation and .zip files:
Any ideas why my display settings might be borked?
If these are RetroArch settings, then they should have carried over. If the display settings you're referencing were set in the Runcommand menu and if you've changed the launch command in
/opt/retropie/configs/psx/emulators.cfg
, then your previous settings are tied to the 'lr-pcsx-rearmed' named launch command from that file. You would need to either configure those same settings for 'lr-pcsx-rearmed-zip', or manually change 'lr-pcsx-rearmed' to 'lr-pcsx-rearmed-zip' in/opt/retropie/configs/all/videomodes.cfg
. -
I’ve set the runcommand resolution for the new unzip emulator/script to CEA-1 to match which works fine but RetroArch still doesn’t play ball. I had set the aspect ratio to “Custom” and manually entered figures for the X and Y offsets, width and height but those have gone. I have set them back but every time I launch those setting have reset. I checked the config at /opt/retropie/configs/psx/retroarch.cfg and my settings are there (same location as where RetroArch says its saved the settings and the same config passed on emulator launch) so I’m a little lost right now. Will do some more digging later. On a positive note the unzipping etc. works fine, will probably tart it up a bit.
-
@iyonuk unzipping ~400MB files to an SD card every game launch sounds like an efficient way of destroying an SD card ;)
i guess you could unzip to a ram drive, but multi-disk psx games would consume more system ram than an rpi has.
i would definitely recommend the .pbp approach.
-
Nothing pure about preferring one disc format over another. Pbp saves space, and your "purist" butt won't know the difference.
-
@dankcushions said in PlayStation and .zip files:
@iyonuk unzipping ~400MB files to an SD card every game launch sounds like an efficient way of destroying an SD card ;)
I’m currently unzipping to /tmp/psx so on the SD card but I’ll most likely move it to the rom location which is mounted on an external HDD. Although it’d be cheaper to replace the SD card. 😉
I could also consider leaving the unzipped files in place until a certain limit is reached and then delete the oldest files, like a cache.
-
@darksavior said in PlayStation and .zip files:
Nothing pure about preferring one disc format over another. Pbp saves space, and your "purist" butt won't know the difference.
Probably more to do with effort than purism. Also the PSX2PBP thing failed a few times for me.
-
@darksavior Loving the Super Famicom BTW. 👍🏻
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.