From 3af92ed71a323b3a1bfaeeacfc918ee9e0a60058 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Tue, 6 Feb 2024 10:18:58 -0500 Subject: [PATCH 1/5] Add z64, ngc and pce compression targets --- .../defaults/retrodeck/reference_lists/compression_targets.cfg | 1 + .../retrodeck/reference_lists/zip_compressable_extensions.cfg | 3 +++ 2 files changed, 4 insertions(+) diff --git a/emu-configs/defaults/retrodeck/reference_lists/compression_targets.cfg b/emu-configs/defaults/retrodeck/reference_lists/compression_targets.cfg index d1d7d923..4ae00365 100644 --- a/emu-configs/defaults/retrodeck/reference_lists/compression_targets.cfg +++ b/emu-configs/defaults/retrodeck/reference_lists/compression_targets.cfg @@ -40,3 +40,4 @@ sega32xjp sega32xna snes snesna +tg16 diff --git a/emu-configs/defaults/retrodeck/reference_lists/zip_compressable_extensions.cfg b/emu-configs/defaults/retrodeck/reference_lists/zip_compressable_extensions.cfg index 585e7584..72966ab7 100644 --- a/emu-configs/defaults/retrodeck/reference_lists/zip_compressable_extensions.cfg +++ b/emu-configs/defaults/retrodeck/reference_lists/zip_compressable_extensions.cfg @@ -40,7 +40,9 @@ .msa .nds .nes +.ngc .o +.pce .prg .rom .sfc @@ -58,3 +60,4 @@ .unif .xex .xfd +.z64 From eca23ae2ce45151cbf7e9bc00f1daf2f46f713d1 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 21 Feb 2024 10:04:00 -0500 Subject: [PATCH 2/5] Streamline global.sh finit process --- functions/global.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/functions/global.sh b/functions/global.sh index b71b1b3e..20ee8f4b 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -109,8 +109,7 @@ vita3kconf="/var/data/Vita3K/config.yml" vita3kusrconfdir="$bios_folder/Vita3K/Vita3K" # We moved the lockfile in /var/config/retrodeck in order to solve issue #53 - Remove in a few versions -if [ -f "$HOME/retrodeck/.lock" ] -then +if [[ -f "$HOME/retrodeck/.lock" ]]; then mv "$HOME/retrodeck/.lock" $lockfile fi @@ -121,10 +120,12 @@ if [[ ! -f "$rd_conf" ]]; then echo "Initializing" # if we are here means that the we are in a new installation, so the version is valorized with the hardcoded one # Initializing the variables - if [ -z $version]; then - if [[ $(cat $lockfile) == *"0.4."* ]] || [[ $(cat $lockfile) == *"0.3."* ]] || [[ $(cat $lockfile) == *"0.2."* ]] || [[ $(cat $lockfile) == *"0.1."* ]]; then # If the previous version is very out of date, pre-rd_conf - echo "Running version workaround" - version=$(cat $lockfile) + if [[ -z "$version" ]]; then + if [[ -f "$lockfile" ]]; then + if [[ $(cat $lockfile) == *"0.4."* ]] || [[ $(cat $lockfile) == *"0.3."* ]] || [[ $(cat $lockfile) == *"0.2."* ]] || [[ $(cat $lockfile) == *"0.1."* ]]; then # If the previous version is very out of date, pre-rd_conf + echo "Running version workaround" + version=$(cat $lockfile) + fi else version="$hard_version" fi @@ -132,10 +133,10 @@ if [[ ! -f "$rd_conf" ]]; then # Check if SD card path has changed from SteamOS update if [[ ! -d "$default_sd" && "$(ls -A /run/media/deck/)" ]]; then - if [[ $(find media/deck/* -maxdepth 0 -type d -print | wc -l) -eq 1 ]]; then # If there is only one SD card found in the new Steam OS 3.5 location, assign it as the default + if [[ $(find media/deck/* -maxdepth 0 -type d -print | wc -l) -eq 1 ]]; then # If there is only one SD card found in the new SteamOS 3.5 location, assign it as the default default_sd="$(find media/deck/* -maxdepth 0 -type d -print)" else # If the default legacy path cannot be found, and there are multiple entries in the new Steam OS 3.5 SD card path, let the user pick which one to use - configurator_generic_dialog "RetroDECK Setup" "The SD card was not found in the expected location.\nThis may happen when SteamOS is updated.\n\nPlease browse to the current location of the SD card.\n\nIf you are not using an SD card, please click \"Cancel\"." + configurator_generic_dialog "RetroDECK Setup" "The SD card was not found in the default location, and multiple drives were detected.\nPlease browse to the location of the desired SD card.\n\nIf you are not using an SD card, please click \"Cancel\"." default_sd="$(directory_browse "SD Card Location")" fi fi @@ -171,8 +172,8 @@ else conf_read # Verify rdhome is where it is supposed to be. - if [[ ! -d $rdhome ]]; then - prev_home_path=$rdhome + if [[ ! -d "$rdhome" ]]; then + prev_home_path="$rdhome" configurator_generic_dialog "RetroDECK Setup" "The RetroDECK data folder was not found in the expected location.\nThis may happen when SteamOS is updated.\n\nPlease browse to the current location of the \"retrodeck\" folder." new_home_path=$(directory_browse "RetroDECK folder location") set_setting_value $rd_conf "rdhome" "$new_home_path" retrodeck "paths" From bac12909b527c8f34d04c5a2e5b1db9ed8fbf5b5 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 21 Feb 2024 11:04:36 -0500 Subject: [PATCH 3/5] Fix CLI reset process --- retrodeck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retrodeck.sh b/retrodeck.sh index d96a2493..1758eee8 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -58,7 +58,7 @@ https://retrodeck.net echo "You are about to reset one or more RetroDECK components or emulators." echo "Available options are: es-de, retroarch, cemu, citra, dolphin, duckstation, melonds, pcsx3, pico8, ppsspp, primehack, rpcs3, xemu, yuzu, vita3k, mame, gzdoom, boilr, all" read -p "Please enter the component you would like to reset: " component - if [[ "$emulator" =~ ^(es-de|retroarch|cemu|citra|dolphin|duckstation|mame|melonds|pcsx2|ppsspp|primehack|rpcs3|xemu|yuzu|all-emulators)$ ]]; then + if [[ "$component" =~ ^(es-de|retroarch|cemu|citra|dolphin|duckstation|mame|melonds|pcsx2|ppsspp|primehack|rpcs3|xemu|yuzu|all)$ ]]; then read -p "You are about to reset $component to default settings. Enter 'y' to continue, 'n' to stop: " response if [[ $response == [yY] ]]; then prepare_component "reset" "$component" "cli" From 34bb0d82d43160204a31e97b8d2a8b2a281199f8 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 21 Feb 2024 11:05:01 -0500 Subject: [PATCH 4/5] Clean up finit and dir_prep functions --- functions/functions.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/functions/functions.sh b/functions/functions.sh index 074c3cf5..ab9e14aa 100644 --- a/functions/functions.sh +++ b/functions/functions.sh @@ -275,7 +275,7 @@ dir_prep() { if [ -d "$symlink.old" ]; then echo "Moving the data from $symlink.old to $real" #DEBUG - mv -f "$symlink.old"/{.[!.],}* $real + mv -f "$symlink.old"/{.[!.],}* "$real" echo "Removing $symlink.old" #DEBUG rm -rf "$symlink.old" fi @@ -368,9 +368,6 @@ finit() { echo "Executing finit" - # Placing the default retrodeck.cfg - cp -vf $rd_defaults $rd_conf - # Internal or SD Card? local finit_dest_choice=$(configurator_destination_choice_dialog "RetroDECK data" "Welcome to the first configuration of RetroDECK.\nThe setup will be quick but please READ CAREFULLY each message in order to avoid misconfigurations.\n\nWhere do you want your RetroDECK data folder to be located?\n\nThis folder will contain all ROMs, BIOSs and scraped data." ) echo "Choice is $finit_dest_choice" From 8717ec6928a435b2fc3d197a8622b927ae69648b Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 21 Feb 2024 11:05:33 -0500 Subject: [PATCH 5/5] Fix presets processing (needs eval, not declare) --- functions/presets.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/presets.sh b/functions/presets.sh index a086928c..d214461a 100644 --- a/functions/presets.sh +++ b/functions/presets.sh @@ -112,11 +112,11 @@ build_preset_config() { "change" ) if [[ "$read_preset" == "$current_preset" ]]; then if [[ "$target_file" = \$* ]]; then # Read current target file and resolve if it is a variable - declare -g "target_file=$target_file" + eval target_file=$target_file fi local read_target_file="$target_file" if [[ "$defaults_file" = \$* ]]; then #Read current defaults file and resolve if it is a variable - declare -g "defaults_file=$defaults_file" + eval defaults_file=$defaults_file fi local read_defaults_file="$defaults_file" if [[ "$read_system_enabled" == "true" ]]; then