Do You Upload Zip Files to Retropie
This topic has been deleted. Only users with topic management privileges can see information technology.
-
Hi
I have got a script working to my liking. I'm posting it here in instance anyone else wants to use/butcher/edit information technology.
It creates a .cache directory in /habitation/pi/RetroPie/roms/psx into which it unzips the games. It keeps the files at that place until it hits the enshroud limit (which is set at 5Gb) and then starts deleting older files to recover the infinite.
There are probably bugs/improvements to be found/made.
Equally mentioned by @mediamogul I put the post-obit script in /opt/retropie/configs/psx named equally lr-pcsx-rearmed-unzip.sh
#!/bin/bash role centre_string() { local LPAD=$(( ( $(tput cols) - ${#1} ) / two)) local RPAD=$(( ( $(tput cols) - ${#i} ) - $LPAD )) local STRING=$(printf ' %.0s' $(seq 1 $LPAD))${one}$(printf ' %.0s' $(seq 1 $RPAD)) echo "$String" } role ticker() { STR="" B=$(( $P - ane )) while [[ $B -gt 0 ]]; do STR="${STR}." B=$(( $B - 1 )) done STR="${STR}:" B=$(( $Due west - $P )) while [[ $B -gt 0 ]]; do STR="${STR}." B=$(( $B - 1 )) done tput cup $SL3Y 0 echo -east "${TC_YELLOW}$( centre_string "$STR" )" Z=$(( $Z + 1 )) P=$(( $P + $D )) if [[ $P -gt $W ]]; so P=$(( $Westward - one )) D=-1 fi if [[ $P -lt 1 ]]; then P=two D=1 fi } # Clear display and hide cursor tput clear tput civis # Declare final colours TC_CYAN="\e[0;36;49m" TC_DEFAULT="\e[0;39;49m" TC_YELLOW="\e[0;33;49m" # Declare cache variables CACHE_DIRECTORY="/abode/pi/RetroPie/roms/psx/.enshroud" CACHE_IDEAL_SIZE=5242880 # 5242880 = 5Gb # Declare path variables ZIP_FILE="$(sed '3q;d' /dev/shm/runcommand.info)" ZIP_FILE_DIRECTORY=$(dirname "$ZIP_FILE") CUE_FILE="${ZIP_FILE##*/}" CUE_FILE="${CACHE_DIRECTORY}/${CUE_FILE%.*}.cue" # Declare condition line variables SL1Y=$(( ($(tput lines) / 2) - one )) SL2Y=$(( $SL1Y + ane )) SL3Y=$(( $SL2Y + 1 )) # Create cache directory (if non exists) mkdir -p "${CACHE_DIRECTORY}" # Status update tput loving cup $SL2Y 0 STR="Checking cache ..." echo -e "${TC_CYAN}$( centre_string "$STR" )" sleep 0.two # Get current cache size CACHE_SIZE=$(find "$CACHE_DIRECTORY" -type f \( -iname \*.bin -o -iname \*.cue \) -print0 | du --files0-from=- -c | tail -n1 | cut -f1) # Does the cache demand clearing? if [[ $CACHE_SIZE -gt $CACHE_IDEAL_SIZE ]]; and so # Status update tput loving cup $SL1Y 0 STR="Shrinking enshroud ..." echo -due east "${TC_CYAN}$( centre_string "$STR" )" # Keep removing files, oldest first, until cache is below maxiumum size while [[ $CACHE_SIZE -gt $CACHE_IDEAL_SIZE ]]; do # Get oldest file FILE_TO_DELETE=$(ls -A1rt "$CACHE_DIRECTORY"/*.bin "$CACHE_DIRECTORY"/*.cue 2>/dev/cipher | head -n1) # Status update tput loving cup $SL2Y 0 STR=$(basename "$FILE_TO_DELETE") repeat -e "${TC_DEFAULT}$( centre_string "$STR" )" # Delete file rm -rf "$FILE_TO_DELETE" # Become current cache size CACHE_SIZE=$(find "$CACHE_DIRECTORY" -type f \( -iname \*.bin -o -iname \*.cue \) -print0 | du --files0-from=- -c | tail -n1 | cut -f1) done # Clear tput loving cup $SL1Y 0 echo -e "$( centre_string "" )" fi # Spinner variables P=one;D=i;W=7 # Declare offset regular expression - Redump based REGEX1="^(.*\(Disc )[0-9]+(\).*)$" # Single disc or multiple discs? if [[ ! $ZIP_FILE =~ $REGEX1 ]]; then # Output file details tput cup $SL1Y 0 STR="Unzipping disc ..." repeat -e "${TC_CYAN}$( centre_string "$STR" )" # Output file name tput cup $SL2Y 0 STR=$(basename "$ZIP_FILE") echo -e "${TC_DEFAULT}$( centre_string "$STR" )" # Unzip unzip -DDnq "$ZIP_FILE" -d "$CACHE_DIRECTORY" & UNZIP_PID=$! # Ticker while kill -0 $UNZIP_PID 2> /dev/null; do ticker sleep 0.05 washed else # Status update tput cup $SL2Y 0 STR="Checking for other discs ..." echo -e "${TC_CYAN}$( centre_string "$STR" )" # Build second regular expression REGEX2=${BASH_REMATCH[1]}[0-9]+${BASH_REMATCH[two]} REGEX2=$(echo "$REGEX2" | sed -e 's/(/\\(/g' -e 's/)/\\)/g' -east 'due south/\./\\./g') # Unzip discs CURRENT_FILE=1 find "$ZIP_FILE_DIRECTORY" -maxdepth i -regextype posix-extended -regex "$REGEX2" | sort -t '\0' -northward | while read LINE; do # Output file details tput cup $SL1Y 0 STR="Unzipping disc ${CURRENT_FILE} ..." echo -e "${TC_CYAN}$( centre_string "$STR" )" # Output file proper noun tput cup $SL2Y 0 STR=$(basename "$LINE") echo -e "${TC_DEFAULT}$( centre_string "$STR" )" # Unzip unzip -DDnq "$LINE" -d "$CACHE_DIRECTORY" & UNZIP_PID=$! # Ticker while impale -0 $UNZIP_PID ii> /dev/zippo; do ticker slumber 0.05 done # Next file CURRENT_FILE=$(( $CURRENT_FILE + 1 )) done fi # Clear brandish and restore cursor tput sgr0 tput clear tput cnorm # Launch lr-pcsx-rearmed /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-pcsx-rearmed/libretro.so --config /opt/retropie/configs/psx/retroarch.cfg "$CUE_FILE" --appendconfig /dev/shm/retroarch.cfg &> /dev/shm/runcommand.log # Go out exit
I added the post-obit to /opt/retropie/configs/psx/emulators.cfg and set it to the default emulator
lr-pcsx-rearmed-unzip = "bash /opt/retropie/configs/psx/lr-pcsx-rearmed-unzip.sh %ROM% &>/dev/tty"
NB. The enshroud directory is on an external HDD then I'm not worried almost SD bill of fare failure.
Edit: Updated script to non use regex for single disc games.
-
Simply a comment to @IyonUK'southward script: If your machine has enough ram, you might alter the CACHE_DIRECTORY to something in the ramdisk
/dev/shm
(shared grandemory), e.chiliad./dev/shm/psx-enshroud
. Most of today's Linux distributions installshm
by default. (Does Retropie fifty-fifty piece of work without it, since information technology uses it for Runcommand?)Be sure to alter CACHE_IDEAL_SIZE accordingly. You tin check the size and gratuitous amount of
shm
with the commanddf -h
. But leave some of information technology for other applications and the organization.As information technology is with ramdisks, everything stored there is lost on a system shutdown or reboot. And then, contrary to on-disk caching, the zippo extraction will take to happen every first fourth dimension a game is started subsequently a system shutdown or restart. Writing to ram is much faster than to disk, though.
-
@mediamogul Was that the only way to exercise information technology terminal year? It seems a pretty crazy workaround.
As well pbp files were mentioned but you lot shouldn't use pbp files they cause headaches.
@IyonUK You lot tin utilize chd files with the principal psx emulator which is far better and easier.
You tin get this on the device itself running. chd files also will embed multiple files into the single file which is bang-up for multiple games.apt install mame-tools
now the programme 'chdman' is installed it is very unproblematic to run it:
chdman createcd -i FILENAME.cue -o FILENAME.chdchdman createcd -i Castlevania\ Symphony\ of\ the\ dark.cue -o Castlevania\ Symphony\ of\ the\ night.chd
The output looks like this:
This volition put all your files in a single file, like any archive does. Twisted metal 2 for instance goes from 12 files and 800mb to 460mb.
-
@el-chupacabra No, pbp files are not a crazy workaround it the standard format for Playstation portable games. Merely I like your modest tutorial - you should add information technology to the PSX section.
The best format (imho) is ecm, no (logical) data loss - it removes the error correction from the concrete information device. Are there whatsoever emulators supporting this format?
-
@cyperghost said in PlayStation and .zilch files:
@el-chupacabra No, pbp files are not a crazy workaround it the standard format for Playstation portable games. Simply I like your minor tutorial - you should add it to the PSX section.
The all-time format (imho) is ecm, no (logical) data loss - it removes the mistake correction from the physical data device. Are there any emulators supporting this format?
I didn't say pbp was a crazy work effectually.
https://retropie.org.uk/docs/Playstation-1/ Looks similar chd is already mentioned briefly here -
@el-chupacabra Oh my bad! But and then use the cite-function to avert me from confusion.
But this does not matter at all - I think chd is the amend way to store data (lossless with LZMA for information and FLAC for audio) and can be handeled similar original iso/bin with m3u/cue.
Again practise y'all know an emulator working with ecm format?
-
@cyperghost
By stating "pbp files were mentioned" I am clearly referring to all of the posts talking nearly information technology. I accept merely seen many bug with it over the years causing game issues. Simply pbp is nicer for multi-deejay games because you don't demand a m3u file. That is pbp's merely benefit.
https://www.reddit.com/r/emulation/comments/714n7g/pbp_vs_chd_for_mednafenbeetle_psx_opinions/
At the fourth dimension of their posting this was very new and non fifty-fifty bachelor on retropie as far as I know, though.No I don't know whatever that use ecm or plan to, probably because ecm is less efficient than chd and offers no other benefits (unlike pbp offers for multi disc games). Therefore I don't recall anyone is going to bother to support it. Perchance on the "to do but not important" list. Information technology uses RAR pinch by default 15-twenty% compression vs chd's 35-45%
Also chd does not use a .cue filehttps://en.wikipedia.org/wiki/MAME
https://www.mankier.com/i/chdmanMAME is such a massive project, whatever it creates pretty much becomes standard.
-
@el-chupacabra Thanks for this input! Did not know that ecm is so inefficient. It is used to spread images effectually simply maybe this is outdated.
-
@el-chupacabra said in PlayStation and .zip files:
Was that the only way to practice it last twelvemonth? It seems a pretty crazy workaround.
It was and still is completely crazy. Like I said above, it was just an interesting practise. At the time,
.pbp
was the only existent style to go, only since then the option to utilize.chd
has come about. -
@mediamogul So is CHD considered the recommended choice now?
-
@OldSchool
IMO it depends on personal utilize habits.
.chd
will likely be the easiest and about widely supported compressed format over fourth dimension, but if you lot were someone who as well owns a hacked PSP, information technology'd probably brand the near sense to archive.pbp
to prevent backing up ii copies of each title. Myself, I just use bin/cue, as I have many different emulation setups and that format is the nigh widely supported across the various platforms and emulation options. In the long run it saves me fourth dimension and space non to compress at all. -
@mediamogul I would probably prefer .bin .cue too because information technology'southward less work, and I employ a big SSD anyways, but I don't like how each disk shows upwards on the emulationstation game list. I suppose the best option is to just go on the original disk images on backup media to always take them, and get alee with the .chd conversion for space and cleanliness, at least for me. If I could become a multi-deejay game to but show up one time on the menu then I would certainly become with that though.
-
@OldSchool ES (and RetroPie) has long disabled the
.bin
files showing in the gamelist - https://retropie.org.great britain/docs/Playstation-1/#roms. Y'all either have a custom setup or a very old installation. -
@mitu
Of course, I only hateful that if you take a multi-disk game than y'all would see something like "final fantasy VII deejay 1" "last fantasy 7 disk 2" so on, which I find annoying. Information technology's non the worst thing but information technology does look nice when you take a single entry in the game list for a game. -
PBP or CHD are both compressed disc format then should save maximum space. I recall CHD is slightly better compression merely not past much, with ZIP you will have to uncompress get-go earlier being able to run the game
PBP has the added reward of being able to join multi-disc games into ane file. CHD is literally Compressed Hard Disc so each disc is compressed
Have a expect at these links for a bit more advice and the concluding i explains exactly how to create a unmarried PBP from multiple discs
https://retropie.org.uk/forum/topic/8016/psx-multi-deejay-combining-bin-files-into-pbp-but-what-about-cue/12
https://www.reddit.com/r/emulation/comments/714n7g/pbp_vs_chd_for_mednafenbeetle_psx_opinions/I've just checked the download link for PSXtoPSP and its however active. It doesn't matter what emulator or OS you use as long as they can load PBP it should withal piece of work
https://www.reddit.com/r/miniSNESmods/comments/7nx6z3/guide_how_to_convert_psx_multiple_discs_game_in
I've found another guide that'southward a clearer but still using PSXtoPSP and with enough of pictures to show exactly what you need to practise on each step and how a single PBP from multiple discs. The link for PSXtoPSP is still active in this guide every bit well
https://gbatemp.net/threads/guide-to-converting-ps1-games-for-psp.206195/
-
@OldSchool Y'all can just use a m3u file to display a game Once no matter how many disks you lot accept. I just use chd for the pinch and m3u for multiple disks
tutorial is on the wiki, it's very easy. You lot just name your file:
last fantasy (disk1).chd
final fantasy (disk2).chd
Change TO:
last fantasy.CD1
final fantasy.CD2
and put that into the:
final fantasy.m3u
file.. that will only bear witness ONCE. again it is on the psx wiki in the docs (of retropie)
I like chd since I can use the retropie install and chdman to make them on the sdcard simply fine. I don't demand another motorcar to do information technology. -
Going back on this, I know it'south old...
I like to keep my PSX ROMs aligned to the Redump DATs which ways .BIN and .CUE files. Also, I've plant that converting them to .PBP has thrown errors in the by. Not looked into .CHD files but with both these methods of converting ROMs it can be a hurting if yous accept a large collection.
Since this was posted I still use an unzip script but I use .M3U files for multi-disc games (which seem to utilize a unmarried .BIN and .CUE in Redump terms) and .CUE for single disc games (which Redump seems to either utilize unmarried .BIN or multiple .BINs).
This method has both storage benefits and salvage game benefits every bit the save files are aligned with the .M3U for multi-disc games.
PS. Last time I checked the unabridged PSX Redump collection was 3.7TB so there are benefits to unzipping into a cache if storage is tight and you're not doing so to an SD carte du jour.
Contributions to the project are always appreciated, and then if yous would similar to support us with a donation you can exercise and then here.
Hosting provided past Mythic-Beasts. See the Hosting Data folio for more information.
Source: https://retropie.org.uk/forum/post/199107
0 Response to "Do You Upload Zip Files to Retropie"
Post a Comment