Merge branch 'cooker-0.5.3b'

This commit is contained in:
XargonWan 2022-10-26 15:08:16 +02:00
commit b0e8778097
10 changed files with 191 additions and 165 deletions

View file

@ -44,6 +44,7 @@ jobs:
- name: Build flatpak - name: Build flatpak
run: | run: |
git config --global protocol.allow always
flatpak-builder --user --force-clean --install-deps-from=flathub --install-deps-from=flathub-beta --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml flatpak-builder --user --force-clean --install-deps-from=flathub --install-deps-from=flathub-beta --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml
- name: Create Artifact for flathub - name: Create Artifact for flathub

View file

@ -44,6 +44,7 @@ jobs:
- name: Build flatpak - name: Build flatpak
run: | run: |
git config --global protocol.allow always
flatpak-builder --user --force-clean --install-deps-from=flathub --install-deps-from=flathub-beta --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-main net.retrodeck.retrodeck.yml flatpak-builder --user --force-clean --install-deps-from=flathub --install-deps-from=flathub-beta --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-main net.retrodeck.retrodeck.yml
- name: Create Artifact for flathub - name: Create Artifact for flathub

View file

@ -0,0 +1 @@
sort_savefiles_by_content_enable = "false"

View file

@ -3147,7 +3147,7 @@ video_scale = "3.000000"
video_scale_integer = "false" video_scale_integer = "false"
video_scale_integer_overscale = "false" video_scale_integer_overscale = "false"
video_shader_delay = "0" video_shader_delay = "0"
video_shader_dir = "/app/retrodeck/overlays/shaders" video_shader_dir = "/var/config/retroarch/shaders"
video_shader_enable = "true" video_shader_enable = "true"
video_shader_preset_save_reference_enable = "true" video_shader_preset_save_reference_enable = "true"
video_shader_remember_last_dir = "false" video_shader_remember_last_dir = "false"

View file

@ -824,9 +824,9 @@
<fullname>Nintendo 3DS</fullname> <fullname>Nintendo 3DS</fullname>
<path>%ROMPATH%/n3ds</path> <path>%ROMPATH%/n3ds</path>
<extension>.3ds .3DS .3dsx .3DSX .app .APP .axf .AXF .cci .CCI .cxi .CXI .elf .ELF .7z .7Z .zip .ZIP</extension> <extension>.3ds .3DS .3dsx .3DSX .app .APP .axf .AXF .cci .CCI .cxi .CXI .elf .ELF .7z .7Z .zip .ZIP</extension>
<command label="Citra (Standalone)">%EMULATOR_CITRA% %ROM%</command>
<command label="Citra">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra_libretro.so %ROM%</command> <command label="Citra">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra_libretro.so %ROM%</command>
<command label="Citra 2018">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra2018_libretro.so %ROM%</command> <command label="Citra 2018">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra2018_libretro.so %ROM%</command>
<command label="Citra (Standalone)">%EMULATOR_CITRA% %ROM%</command>
<platform>n3ds</platform> <platform>n3ds</platform>
<theme>n3ds</theme> <theme>n3ds</theme>
</system> </system>
@ -1083,8 +1083,8 @@
<fullname>Sony PlayStation 3</fullname> <fullname>Sony PlayStation 3</fullname>
<path>%ROMPATH%/ps3</path> <path>%ROMPATH%/ps3</path>
<extension>.desktop .ps3 .PS3 .ps3dir .PS3DIR</extension> <extension>.desktop .ps3 .PS3 .ps3dir .PS3DIR</extension>
<command label="RPCS3 Shortcut (Standalone)">%ENABLESHORTCUTS% %EMULATOR_OS-SHELL% %ROM%</command>
<command label="RPCS3 Directory (Standalone)">%EMULATOR_RPCS3% --no-gui %ROM%</command> <command label="RPCS3 Directory (Standalone)">%EMULATOR_RPCS3% --no-gui %ROM%</command>
<command label="RPCS3 Shortcut (Standalone)">%ENABLESHORTCUTS% %EMULATOR_OS-SHELL% %ROM%</command>
<platform>ps3</platform> <platform>ps3</platform>
<theme>ps3</theme> <theme>ps3</theme>
</system> </system>

View file

@ -76,7 +76,7 @@ modules:
- | - |
git checkout ${GITHUB_REF_NAME} git checkout ${GITHUB_REF_NAME}
mkdir -p ${FLATPAK_DEST}/retrodeck/ mkdir -p ${FLATPAK_DEST}/retrodeck/
VERSION="0.5.2b" VERSION="0.5.3b"
if [[ $VERSION == *"cooker"* ]]; if [[ $VERSION == *"cooker"* ]];
then then
VERSION="cooker-"$(git rev-parse --short HEAD) VERSION="cooker-"$(git rev-parse --short HEAD)
@ -86,7 +86,7 @@ modules:
sources: sources:
- type: git - type: git
url: https://github.com/XargonWan/RetroDECK.git url: https://github.com/XargonWan/RetroDECK.git
branch: main branch: cooker-0.5.3b
- name: xmlstarlet - name: xmlstarlet
config-opts: config-opts:
@ -959,8 +959,8 @@ modules:
- ln -s "${FLATPAK_DEST}/pcsx2-qt/usr/bin/pcsx2-qt" "${FLATPAK_DEST}/bin/pcsx2-qt" - ln -s "${FLATPAK_DEST}/pcsx2-qt/usr/bin/pcsx2-qt" "${FLATPAK_DEST}/bin/pcsx2-qt"
sources: sources:
- type: file - type: file
url: https://github.com/PCSX2/pcsx2/releases/download/v1.7.3366/pcsx2-v1.7.3366-linux-AppImage-64bit-AVX2-Qt.AppImage url: https://github.com/PCSX2/pcsx2/releases/download/v1.7.3478/pcsx2-v1.7.3478-linux-AppImage-64bit-AVX2-Qt.AppImage
sha256: 00790594de30929a11056b95d89650cbf523cc2bb1dc27df3a99e215722ec90c sha256: c36e22cb49656d1997255bfe9491217349c05f5179ca3b47475f7d2280588014
# PCSX2 - END # PCSX2 - END
@ -1433,4 +1433,4 @@ modules:
sources: sources:
- type: git - type: git
url: https://github.com/XargonWan/RetroDECK.git url: https://github.com/XargonWan/RetroDECK.git
branch: main branch: cooker-0.5.3b

@ -1 +1 @@
Subproject commit bcd152baf434eea464b9e58e48078ff674c13886 Subproject commit 176c8715bdd09a1282a3861839dd2bd976380403

View file

@ -89,6 +89,9 @@ standalones_init() {
dir_prep "$rdhome/bios/switch/keys" "/var/data/yuzu/keys" dir_prep "$rdhome/bios/switch/keys" "/var/data/yuzu/keys"
# initializing the firmware folder # initializing the firmware folder
dir_prep "$rdhome/bios/switch/registered" "/var/data/yuzu/nand/system/Contents/registered" dir_prep "$rdhome/bios/switch/registered" "/var/data/yuzu/nand/system/Contents/registered"
# initializing the save folders
dir_prep "$rdhome/saves/switch/yuzu/nand" "/var/data/yuzu/nand"
dir_prep "$rdhome/saves/switch/yuzy/sdmc" "/var/data/yuzu/sdmc"
# configuring Yuzu # configuring Yuzu
dir_prep "$rdhome/.logs/yuzu" "/var/data/yuzu/log" dir_prep "$rdhome/.logs/yuzu" "/var/data/yuzu/log"
mkdir -pv /var/config/yuzu/ mkdir -pv /var/config/yuzu/
@ -144,6 +147,7 @@ standalones_init() {
mkdir -pv /var/config/citra-emu/ mkdir -pv /var/config/citra-emu/
mkdir -pv "$rdhome/saves/n3ds/citra/nand/" mkdir -pv "$rdhome/saves/n3ds/citra/nand/"
mkdir -pv "$rdhome/saves/n3ds/citra/sdmc/" mkdir -pv "$rdhome/saves/n3ds/citra/sdmc/"
dir_prep "$rdhome/bios/citra/sysdata" "/var/data/citra-emu/sysdata"
dir_prep "$rdhome/.logs/citra" "/var/data/citra-emu/log" dir_prep "$rdhome/.logs/citra" "/var/data/citra-emu/log"
cp -fv $emuconfigs/citra-qt-config.ini /var/config/citra-emu/qt-config.ini cp -fv $emuconfigs/citra-qt-config.ini /var/config/citra-emu/qt-config.ini
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/citra-emu/qt-config.ini sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/citra-emu/qt-config.ini
@ -170,7 +174,7 @@ standalones_init() {
if [ ! -f $rdhome/bios/xbox_hdd.qcow2 ] if [ ! -f $rdhome/bios/xbox_hdd.qcow2 ]
then then
wget "https://github.com/mborgerson/xemu-hdd-image/releases/latest/download/xbox_hdd.qcow2.zip" -P $rdhome/bios/ wget "https://github.com/mborgerson/xemu-hdd-image/releases/latest/download/xbox_hdd.qcow2.zip" -P $rdhome/bios/
unzip $rdhome/bios/xbox_hdd.qcow2.zip $rdhome/bios/ unzip -q $rdhome/bios/xbox_hdd.qcow2.zip $rdhome/bios/
rm -rfv $rdhome/bios/xbox_hdd.qcow2.zip rm -rfv $rdhome/bios/xbox_hdd.qcow2.zip
fi fi
@ -199,10 +203,14 @@ standalones_init() {
ra_init() { ra_init() {
dir_prep "$rdhome/bios" "/var/config/retroarch/system" dir_prep "$rdhome/bios" "/var/config/retroarch/system"
dir_prep "$rdhome/.logs/retroarch" "/var/config/retroarch/logs" dir_prep "$rdhome/.logs/retroarch" "/var/config/retroarch/logs"
mkdir -pv /var/config/retroarch/shaders/
cp -rfv /app/share/libretro/shaders /var/config/retroarch/
dir_prep "$rdhome/shaders/retroarch" "/var/config/retroarch/shaders"
mkdir -pv /var/config/retroarch/cores/ mkdir -pv /var/config/retroarch/cores/
cp /app/share/libretro/cores/* /var/config/retroarch/cores/ cp /app/share/libretro/cores/* /var/config/retroarch/cores/
cp -fv $emuconfigs/retroarch.cfg /var/config/retroarch/ cp -fv $emuconfigs/retroarch.cfg /var/config/retroarch/
cp -fv $emuconfigs/retroarch-core-options.cfg /var/config/retroarch/ cp -fv $emuconfigs/retroarch-core-options.cfg /var/config/retroarch/
cp -rfv $emuconfigs/retroarch-core-overrides/* /var/config/retroarch/config
#rm -rf $rdhome/bios/bios # in some situations a double bios symlink is created #rm -rf $rdhome/bios/bios # in some situations a double bios symlink is created
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/retroarch/retroarch.cfg sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/retroarch/retroarch.cfg
@ -218,7 +226,7 @@ ra_init() {
#if [ ! -f "$rdhome/bios/PPSSPP/ppge_atlas.zim" ] #if [ ! -f "$rdhome/bios/PPSSPP/ppge_atlas.zim" ]
#then #then
wget "https://github.com/hrydgard/ppsspp/archive/refs/heads/master.zip" -P $rdhome/bios/PPSSPP wget "https://github.com/hrydgard/ppsspp/archive/refs/heads/master.zip" -P $rdhome/bios/PPSSPP
unzip "$rdhome/bios/PPSSPP/master.zip" -d $rdhome/bios/PPSSPP/ unzip -q "$rdhome/bios/PPSSPP/master.zip" -d $rdhome/bios/PPSSPP/
mv "$rdhome/bios/PPSSPP/ppsspp-master/assets/"* "$rdhome/bios/PPSSPP/" mv "$rdhome/bios/PPSSPP/ppsspp-master/assets/"* "$rdhome/bios/PPSSPP/"
rm -rfv "$rdhome/bios/PPSSPP/master.zip" rm -rfv "$rdhome/bios/PPSSPP/master.zip"
rm -rfv "$rdhome/bios/PPSSPP/ppsspp-master" rm -rfv "$rdhome/bios/PPSSPP/ppsspp-master"
@ -234,7 +242,7 @@ ra_init() {
echo "Initializing MSX / SVI / ColecoVision / SG-1000 LIBRETRO" echo "Initializing MSX / SVI / ColecoVision / SG-1000 LIBRETRO"
echo "-----------------------------------------------------------" echo "-----------------------------------------------------------"
wget "http://bluemsx.msxblue.com/rel_download/blueMSXv282full.zip" -P $rdhome/bios/MSX wget "http://bluemsx.msxblue.com/rel_download/blueMSXv282full.zip" -P $rdhome/bios/MSX
unzip "$rdhome/bios/MSX/blueMSXv282full.zip" $rdhome/bios/MSX unzip -q "$rdhome/bios/MSX/blueMSXv282full.zip" $rdhome/bios/MSX
mv -rfv $rdhome/bios/MSX/Databases $rdhome/bios/Databases mv -rfv $rdhome/bios/MSX/Databases $rdhome/bios/Databases
mv -rfv $rdhome/bios/MSX/Machines $rdhome/bios/Machines mv -rfv $rdhome/bios/MSX/Machines $rdhome/bios/Machines
rm -rfv $rdhome/bios/MSX rm -rfv $rdhome/bios/MSX
@ -249,182 +257,191 @@ create_lock() {
} }
post_update() { post_update() {
# post update script # post update script
echo "Executing post-update script" echo "Executing post-update script"
# Finding existing ROMs folder # Finding existing ROMs folder
if [ -d "$default_sd/retrodeck" ] if [ -d "$default_sd/retrodeck" ]
then then
# ROMs on SD card # ROMs on SD card
roms_folder="$default_sd/retrodeck/roms" roms_folder="$default_sd/retrodeck/roms"
else if [[ ! -L $rdhome && ! -L $rdhome/roms ]]; then # Add a roms folder symlink back to ~/retrodeck if missing, to fix things like PS2 autosaves until user migrates whole ~retrodeck directory
# ROMs on Internal ln -s $roms_folder $rdhome/roms
roms_folder="$HOME/retrodeck/roms"
fi fi
echo "ROMs folder found at $roms_folder" else
# ROMs on Internal
roms_folder="$HOME/retrodeck/roms"
fi
echo "ROMs folder found at $roms_folder"
# Unhiding downloaded media from the previous versions # Unhiding downloaded media from the previous versions
if [ -d "$rdhome/.downloaded_media" ] if [ -d "$rdhome/.downloaded_media" ]
then then
mv -fv "$rdhome/.downloaded_media" "$media_folder" mv -fv "$rdhome/.downloaded_media" "$media_folder"
fi fi
# Unhiding themes folder from the previous versions # Unhiding themes folder from the previous versions
if [ -d "$rdhome/.themes" ] if [ -d "$rdhome/.themes" ]
then then
mv -fv "$rdhome/.themes" "$themes_folder" mv -fv "$rdhome/.themes" "$themes_folder"
fi fi
# Doing the dir prep as we don't know from which version we came # Doing the dir prep as we don't know from which version we came
dir_prep "$media_folder" "/var/config/emulationstation/.emulationstation/downloaded_media" dir_prep "$media_folder" "/var/config/emulationstation/.emulationstation/downloaded_media"
dir_prep "$themes_folder" "/var/config/emulationstation/.emulationstation/themes" dir_prep "$themes_folder" "/var/config/emulationstation/.emulationstation/themes"
mkdir -pv $rdhome/.logs #this was added later, maybe safe to remove in a few versions mkdir -pv $rdhome/.logs #this was added later, maybe safe to remove in a few versions
# Resetting es_settings, now we need it but in the future I should think a better solution, maybe with sed # Resetting es_settings, now we need it but in the future I should think a better solution, maybe with sed
cp -fv /app/retrodeck/es_settings.xml /var/config/emulationstation/.emulationstation/es_settings.xml cp -fv /app/retrodeck/es_settings.xml /var/config/emulationstation/.emulationstation/es_settings.xml
# 0.4 -> 0.5 # 0.4 -> 0.5
# Perform save and state migration if needed # Perform save and state migration if needed
# Moving PCSX2 Saves # Moving PCSX2 Saves
mv -fv /var/config/PCSX2/sstates/* $rdhome/states/ps2/pcsx2 mv -fv /var/config/PCSX2/sstates/* $rdhome/states/ps2/pcsx2
mv -fv /var/config/PCSX2/memcards/* $rdhome/saves/ps2/memcards mv -fv /var/config/PCSX2/memcards/* $rdhome/saves/ps2/memcards
# Moving Citra saves from legacy location to 0.5.0b structure # Moving Citra saves from legacy location to 0.5.0b structure
mv -fv $rdhome/saves/Citra/* $rdhome/saves/n3ds/citra mv -fv $rdhome/saves/Citra/* $rdhome/saves/n3ds/citra
rmdir $rdhome/saves/Citra # Old folder cleanup rmdir $rdhome/saves/Citra # Old folder cleanup
versionwheresaveschanged="0.4.5b" # Hardcoded break point between unsorted and sorted saves versionwheresaveschanged="0.4.5b" # Hardcoded break point between unsorted and sorted saves
if [[ $(sed -e "s/\.//g" <<< $hard_version) > $(sed -e "s/\.//g" <<< $versionwheresaveschanged) ]] && [[ ! $(sed -e "s/\.//g" <<< $hard_version) == $(sed -e "s/\.//g" <<< $version) ]]; then # Check if user is upgrading from the version where save organization was changed. Try not to reuse this, it things 0.4.5b is newer than 0.4.5 if [[ $(sed -e "s/\.//g" <<< $hard_version) > $(sed -e "s/\.//g" <<< $versionwheresaveschanged) ]] && [[ ! $(sed -e "s/\.//g" <<< $version) > $(sed -e "s/\.//g" <<< $versionwheresaveschanged) ]]; then # Check if user is upgrading from the version where save organization was changed. Try not to reuse this, it things 0.4.5b is newer than 0.4.5
migration_logfile=$rdhome/.logs/savemove_"$(date +"%Y_%m_%d_%I_%M_%p").log" migration_logfile=$rdhome/.logs/savemove_"$(date +"%Y_%m_%d_%I_%M_%p").log"
save_backup_file=$rdhome/savebackup_"$(date +"%Y_%m_%d_%I_%M_%p").zip" save_backup_file=$rdhome/savebackup_"$(date +"%Y_%m_%d_%I_%M_%p").zip"
state_backup_file=$rdhome/statesbackup_"$(date +"%Y_%m_%d_%I_%M_%p").zip" state_backup_file=$rdhome/statesbackup_"$(date +"%Y_%m_%d_%I_%M_%p").zip"
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="You are updating to a version of RetroDECK where save file locations have changed!\n\nYour existing files will be backed up for safety and then sorted automatically.\n\nIf a file cannot be sorted automatically it will remain where it is for manual sorting.\n\nPLEASE BE PATIENT! This process can take several minutes if you have a large ROM library."
allgames=($(find "$roms_folder" -maxdepth 2 -mindepth 2 ! -name "systeminfo.txt" ! -name "systems.txt" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" ! -name "*^*" | sed -e "s/ /\^/g")) # Build an array of all games and multi-disc-game-containing folders, adding whitespace placeholder
allsaves=($(find "$saves_folder" -mindepth 1 -maxdepth 1 -name "*.*" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" | sed -e "s/ /\^/g")) # Build an array of all save files, ignoring standalone emulator sub-folders, adding whitespace placeholder
allstates=($(find "$states_folder" -mindepth 1 -maxdepth 1 -name "*.*" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" | sed -e "s/ /\^/g")) # Build an array of all state files, ignoring standalone emulator sub-folders, adding whitespace placeholder
totalsaves=${#allsaves[@]}
totalstates=${#allstates[@]}
filesleft=
current_dest_folder=
gamestoskip=
tar -C $rdhome -czf $save_backup_file saves # Backup save directory for safety
echo "Saves backed up to" $save_backup_file >> $migration_logfile
tar -C $rdhome -czf $state_backup_file states # Backup state directory for safety
echo "States backed up to" $state_backup_file >> $migration_logfile
(
movefile() { # Take matching save and rom files and sort save into appropriate system folder
echo "# $filesleft $currentlybeingmoved remaining..." # These lines update the Zenity progress bar
progress=$(( 100 - (( 100 / "$totalfiles" ) * "$filesleft" )))
echo $progress
filesleft=$((filesleft-1))
if [[ ! " ${gamestoskip[*]} " =~ " ${1} " ]]; then # If the current game name exists multiple times in array ie. /roms/snes/Mortal Kombat 3.zip and /roms/genesis/Mortal Kombat 3.zip, skip and alert user to sort manually
game=$(sed -e "s/\^/ /g" <<< "$1") # Remove whitespace placeholder
gamebasename=$(basename "$game" | sed -e 's/\..*//') # Extract pure file name ie. /roms/snes/game1.zip becomes game1
systemdir="$(basename "$(dirname "$1")")" # Extract parent directory identifying system ROM belongs to
matches=($(find "$roms_folder" -maxdepth 2 -mindepth 2 -name "$gamebasename"".*" | sed -e 's/ /^/g' | sed -e 's/\..*//')) # Search for multiple instances of pure game name, adding to skip list if found
if [[ ${#matches[@]} -gt 1 ]]; then
echo "ERROR: Multiple ROMS found with name:" $gamebasename "Please sort saves and states for these ROMS manually" >> $migration_logfile
gamestoskip+=("$1")
return
fi
echo "INFO: Examining ROM file:" "$game" >> $migration_logfile
echo "INFO: System detected as" $systemdir >> $migration_logfile
sosfile=$(sed -e "s/\^/ /g" <<< "$2") # Remove whitespace placeholder from s-ave o-r s-tate file
sospurebasename="$(basename "$sosfile")" # Extract pure file name ie. /saves/game1.sav becomes game1
echo "INFO: Current save or state being examined for match:" $sosfile >> $migration_logfile
echo "INFO: Matching save or state" $sosfile "and game" $game "found." >> $migration_logfile
echo "INFO: Moving save or state to" $current_dest_folder"/"$systemdir"/"$sosbasename >> $migration_logfile
if [[ ! -d $current_dest_folder"/"$systemdir ]]; then # If system directory doesn't exist for save yet, create it
echo "WARNING: Creating missing system directory" $current_dest_folder"/"$systemdir
mkdir $current_dest_folder/$systemdir
fi
mv "$sosfile" -t $current_dest_folder/$systemdir # Move save to appropriate system directory
return
else
echo "WARNING: Game with name" "$(basename "$1" | sed -e "s/\^/ /g")" "already found. Skipping to next game..." >> $migration_logfile # Inform user of game being skipped due to duplicate ROM names
fi
}
find "$roms_folder" -mindepth 2 -maxdepth 2 -name "*\^*" -exec echo "ERROR: Game named" {} "found, please move save manually" \; >> $migration_logfile # Warn user if any of their files have the whitespace replacement character used by the script
totalfiles=$totalsaves #set variables for save file migration
filesleft=$totalsaves
currentlybeingmoved="saves"
current_dest_folder=$saves_folder
for i in "${allsaves[@]}"; do # For each save file, compare to every ROM file name looking for a match
found=
currentsave=($(basename "$i" | sed -e 's/\..*//')) # Extract pure file name ie. /saves/game1.sav becomes game1
for j in "${allgames[@]}"; do
currentgame=($(basename "$j" | sed -e 's/\..*//')) # Extract pure file name ie. /roms/snes/game1.zip becomes game1
[[ $currentgame == $currentsave ]] && { found=1; break; } # If names match move to next stage, otherwise skip
done
[[ -n $found ]] && movefile $j $i || echo "ERROR: No ROM match found for save file" $i | sed -e 's/\^/ /g' >> $migration_logfile # If a match is found, run movefile() otherwise warn user of stranded save file
done
totalfiles=$totalstates #set variables for state file migration
filesleft=$totalstates
currentlybeingmoved="states"
current_dest_folder=$states_folder
for i in "${allstates[@]}"; do # For each state file, compare to every ROM file name looking for a match
found=
currentstate=($(basename "$i" | sed -e 's/\..*//')) # Extract pure file name ie. /states/game1.sav becomes game1
for j in "${allgames[@]}"; do
currentgame=($(basename "$j" | sed -e 's/\..*//')) # Extract pure file name ie. /roms/snes/game1.zip becomes game1
[[ $currentgame == $currentstate ]] && { found=1; break; } # If names match move to next stage, otherwise skip
done
[[ -n $found ]] && movefile $j $i || echo "ERROR: No ROM match found for state file" $i | sed -e 's/\^/ /g' >> $migration_logfile # If a match is found, run movefile() otherwise warn user of stranded state file
done
) |
zenity --progress \
--icon-name=net.retrodeck.retrodeck \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title="Processing Files" \ --title "RetroDECK" \
--text="# files remaining..." \ --text="You are updating to a version of RetroDECK where save file locations have changed!\n\nYour existing files will be backed up for safety and then sorted automatically.\n\nIf a file cannot be sorted automatically it will remain where it is for manual sorting.\n\nPLEASE BE PATIENT! This process can take several minutes if you have a large ROM library."
--percentage=0 \
--no-cancel \
--auto-close
if [[ $(cat $migration_logfile | grep "ERROR" | wc -l) -eq 0 ]]; then allgames=($(find "$roms_folder" -maxdepth 2 -mindepth 2 ! -name "systeminfo.txt" ! -name "systems.txt" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" ! -name "*^*" | sed -e "s/ /\^/g")) # Build an array of all games and multi-disc-game-containing folders, adding whitespace placeholder
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="The migration process has sorted all of your files automatically.\n\nEverything should be working normally, if you experience any issues please check the RetroDECK wiki or contact us directly on the Discord."
allsaves=($(find "$saves_folder" -mindepth 1 -maxdepth 1 -name "*.*" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" | sed -e "s/ /\^/g")) # Build an array of all save files, ignoring standalone emulator sub-folders, adding whitespace placeholder
allstates=($(find "$states_folder" -mindepth 1 -maxdepth 1 -name "*.*" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" | sed -e "s/ /\^/g")) # Build an array of all state files, ignoring standalone emulator sub-folders, adding whitespace placeholder
totalsaves=${#allsaves[@]}
totalstates=${#allstates[@]}
filesleft=
current_dest_folder=
gamestoskip=
tar -C $rdhome -czf $save_backup_file saves # Backup save directory for safety
echo "Saves backed up to" $save_backup_file >> $migration_logfile
tar -C $rdhome -czf $state_backup_file states # Backup state directory for safety
echo "States backed up to" $state_backup_file >> $migration_logfile
(
movefile() { # Take matching save and rom files and sort save into appropriate system folder
echo "# $filesleft $currentlybeingmoved remaining..." # These lines update the Zenity progress bar
progress=$(( 100 - (( 100 / "$totalfiles" ) * "$filesleft" )))
echo $progress
filesleft=$((filesleft-1))
if [[ ! " ${gamestoskip[*]} " =~ " ${1} " ]]; then # If the current game name exists multiple times in array ie. /roms/snes/Mortal Kombat 3.zip and /roms/genesis/Mortal Kombat 3.zip, skip and alert user to sort manually
game=$(sed -e "s/\^/ /g" <<< "$1") # Remove whitespace placeholder
gamebasename=$(basename "$game" | sed -e 's/\..*//') # Extract pure file name ie. /roms/snes/game1.zip becomes game1
systemdir="$(basename "$(dirname "$1")")" # Extract parent directory identifying system ROM belongs to
matches=($(find "$roms_folder" -maxdepth 2 -mindepth 2 -name "$gamebasename"".*" | sed -e 's/ /^/g' | sed -e 's/\..*//')) # Search for multiple instances of pure game name, adding to skip list if found
if [[ ${#matches[@]} -gt 1 ]]; then
echo "ERROR: Multiple ROMS found with name:" $gamebasename "Please sort saves and states for these ROMS manually" >> $migration_logfile
gamestoskip+=("$1")
return
fi
echo "INFO: Examining ROM file:" "$game" >> $migration_logfile
echo "INFO: System detected as" $systemdir >> $migration_logfile
sosfile=$(sed -e "s/\^/ /g" <<< "$2") # Remove whitespace placeholder from s-ave o-r s-tate file
sospurebasename="$(basename "$sosfile")" # Extract pure file name ie. /saves/game1.sav becomes game1
echo "INFO: Current save or state being examined for match:" $sosfile >> $migration_logfile
echo "INFO: Matching save or state" $sosfile "and game" $game "found." >> $migration_logfile
echo "INFO: Moving save or state to" $current_dest_folder"/"$systemdir"/"$sosbasename >> $migration_logfile
if [[ ! -d $current_dest_folder"/"$systemdir ]]; then # If system directory doesn't exist for save yet, create it
echo "WARNING: Creating missing system directory" $current_dest_folder"/"$systemdir
mkdir $current_dest_folder/$systemdir
fi
mv "$sosfile" -t $current_dest_folder/$systemdir # Move save to appropriate system directory
return
else else
cat $migration_logfile | grep "ERROR" > "$rdhome/manual_sort_needed.log" echo "WARNING: Game with name" "$(basename "$1" | sed -e "s/\^/ /g")" "already found. Skipping to next game..." >> $migration_logfile # Inform user of game being skipped due to duplicate ROM names
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="The migration process was unable to sort $(cat $migration_logfile | grep "ERROR" | wc -l) files automatically.\n\nThese files will need to be moved manually to their new locations, find more detail on the RetroDECK wiki.\n\nA log of the files that need manual sorting can be found at $rdhome/manual_sort_needed.log"
fi fi
}
find "$roms_folder" -mindepth 2 -maxdepth 2 -name "*\^*" -exec echo "ERROR: Game named" {} "found, please move save manually" \; >> $migration_logfile # Warn user if any of their files have the whitespace replacement character used by the script
totalfiles=$totalsaves #set variables for save file migration
filesleft=$totalsaves
currentlybeingmoved="saves"
current_dest_folder=$saves_folder
for i in "${allsaves[@]}"; do # For each save file, compare to every ROM file name looking for a match
found=
currentsave=($(basename "$i" | sed -e 's/\..*//')) # Extract pure file name ie. /saves/game1.sav becomes game1
for j in "${allgames[@]}"; do
currentgame=($(basename "$j" | sed -e 's/\..*//')) # Extract pure file name ie. /roms/snes/game1.zip becomes game1
[[ $currentgame == $currentsave ]] && { found=1; break; } # If names match move to next stage, otherwise skip
done
[[ -n $found ]] && movefile $j $i || echo "ERROR: No ROM match found for save file" $i | sed -e 's/\^/ /g' >> $migration_logfile # If a match is found, run movefile() otherwise warn user of stranded save file
done
totalfiles=$totalstates #set variables for state file migration
filesleft=$totalstates
currentlybeingmoved="states"
current_dest_folder=$states_folder
for i in "${allstates[@]}"; do # For each state file, compare to every ROM file name looking for a match
found=
currentstate=($(basename "$i" | sed -e 's/\..*//')) # Extract pure file name ie. /states/game1.sav becomes game1
for j in "${allgames[@]}"; do
currentgame=($(basename "$j" | sed -e 's/\..*//')) # Extract pure file name ie. /roms/snes/game1.zip becomes game1
[[ $currentgame == $currentstate ]] && { found=1; break; } # If names match move to next stage, otherwise skip
done
[[ -n $found ]] && movefile $j $i || echo "ERROR: No ROM match found for state file" $i | sed -e 's/\^/ /g' >> $migration_logfile # If a match is found, run movefile() otherwise warn user of stranded state file
done
) |
zenity --progress \
--icon-name=net.retrodeck.retrodeck \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title="Processing Files" \
--text="# files remaining..." \
--percentage=0 \
--no-cancel \
--auto-close
if [[ $(cat $migration_logfile | grep "ERROR" | wc -l) -eq 0 ]]; then
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="The migration process has sorted all of your files automatically.\n\nEverything should be working normally, if you experience any issues please check the RetroDECK wiki or contact us directly on the Discord."
else else
echo "Version" $version "is after the save and state organization was changed, no need to sort again" cat $migration_logfile | grep "ERROR" > "$rdhome/manual_sort_needed.log"
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="The migration process was unable to sort $(cat $migration_logfile | grep "ERROR" | wc -l) files automatically.\n\nThese files will need to be moved manually to their new locations, find more detail on the RetroDECK wiki.\n\nA log of the files that need manual sorting can be found at $rdhome/manual_sort_needed.log"
fi fi
ra_init else
standalones_init echo "Version" $version "is after the save and state organization was changed, no need to sort again"
tools_init fi
create_lock (
ra_init
standalones_init
tools_init
) |
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Finishing Upgrade" \
--text="RetroDECK is finishing the upgrade process, please wait."
create_lock
} }
start_retrodeck() { start_retrodeck() {
@ -582,9 +599,15 @@ finit() {
# PICO-8 # PICO-8
dir_prep "$roms_folder/pico8" "$rdhome/bios/pico8/bbs/carts" #this is the folder where pico-8 is saving the carts dir_prep "$roms_folder/pico8" "$rdhome/bios/pico8/bbs/carts" #this is the folder where pico-8 is saving the carts
(
ra_init ra_init
standalones_init standalones_init
tools_init tools_init
) |
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Finishing Upgrade" \
--text="RetroDECK is finishing the upgrade process, please wait."
create_lock create_lock
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \

@ -1 +1 @@
Subproject commit 81b7b525dbd79258a7e9fb3df57461977806fe69 Subproject commit a9112b9c62e2b84db4c2f6c55c9531fd7e8d03c1