From 5a7b4aa13a3cbf3110ddb03d2244b574b54edcf9 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 21 Feb 2024 13:29:15 -0500 Subject: [PATCH 1/4] Add MAME options to patching system NOTE: Currently only works for MAME .ini files, not the XML-based .cfg files --- functions/patching.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/functions/patching.sh b/functions/patching.sh index c732163c..4af54660 100644 --- a/functions/patching.sh +++ b/functions/patching.sh @@ -52,6 +52,11 @@ set_setting_value() { xml ed -L -u "//$current_section_name/$setting_name_to_change" -v "$setting_value_to_change" "$1" fi ;; + + "mame" ) # This only works for mame .ini files, not the .cfg XML files + local mame_current_value=$(get_setting_value $1 "$setting_name_to_change" $4) + sed -i '\^\^'"$setting_name_to_change"'\s^s^'"$mame_current_value"'^'"$setting_value_to_change"'^' "$1" + ;; "es_settings" ) sed -i 's^'"$setting_name_to_change"'" value=".*"^'"$setting_name_to_change"'" value="'"$setting_value_to_change"'"^' "$1" @@ -76,6 +81,10 @@ get_setting_name() { echo "$current_setting_line" | grep -o -P "^\s*?.*?(?=\s?:\s?)" | sed -e 's/^[ \t]*//;s^\\ ^ ^g' ;; + "mame" ) # This only works for mame .ini files, not the .cfg XML files + echo "$current_setting_line" | awk '{print $1}' + ;; + * ) echo "$current_setting_line" | grep -o -P "^\s*?.*?(?=\s?=\s?)" | sed -e 's/^[ \t]*//;s^\\ ^ ^g;s^\\$^^' ;; @@ -132,6 +141,10 @@ get_setting_value() { fi ;; + "mame" ) # This only works for mame .ini files, not the .cfg XML files + echo $(sed -n '\^\^'"$current_setting_name"'\s^p' "$1" | awk '{print $2}') + ;; + "es_settings" ) echo $(grep -o -P "(?<=$current_setting_name\" value=\").*(?=\")" "$1") ;; From eb0b5353376ab7fd04ac3d8683f3bf709ef86ebd Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 21 Feb 2024 13:29:34 -0500 Subject: [PATCH 2/4] Remove Vita3K-binary related commands --- functions/prepare_component.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index 5a095536..1ad5e035 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -678,10 +678,7 @@ prepare_component() { else # Single-user actions # NOTE: the component is writing in "." so it must be placed in the rw filesystem. A symlink of the binary is already placed in /app/bin/Vita3K rm -rf "/var/data/Vita3K" - mkdir -p "/var/data/Vita3K" - unzip "/app/retrodeck/vita3k.zip" -d "/var/data/Vita3K" - chmod +x "/var/data/Vita3K/Vita3K" - rm -f "/var/data/Vita3K/update-vita3k.sh" + mkdir -p "/var/data/Vita3K/Vita3K" cp -fvr "$emuconfigs/vita3k/config.yml" "/var/data/Vita3K" # component config cp -fvr "$emuconfigs/vita3k/ux0" "$bios_folder/Vita3K/Vita3K" # User config set_setting_value "$vita3kconf" "pref-path" "$rdhome/bios/Vita3K/Vita3K/" "vita3k" From 7105285b3341b5ca1dfe96a3fd5fe64facc80df7 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 21 Feb 2024 14:00:18 -0500 Subject: [PATCH 3/4] Break out BIOS check function Add Godot data transfer temp file for BIOS check --- functions/functions.sh | 23 +++++++++++++++++++++++ functions/global.sh | 4 ++++ tools/configurator.sh | 15 +-------------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/functions/functions.sh b/functions/functions.sh index ab9e14aa..ccbdcb91 100644 --- a/functions/functions.sh +++ b/functions/functions.sh @@ -283,6 +283,29 @@ dir_prep() { echo -e "$symlink is now $real\n" } +check_bios_files() { + # This function validates all the BIOS files listed in the $bios_checklist and adds the results to an array called bios_checked_list which can be used elsewhere + + rm -f "$godot_bios_files_checked" # Godot data transfer temp files + touch "$godot_bios_files_checked" + + while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc + do + bios_file_found="No" + bios_hash_matched="No" + if [[ -f "$bios_folder/$bios_subdir$bios_file" ]]; then + bios_file_found="Yes" + if [[ $bios_hash == "Unknown" ]]; then + bios_hash_matched="Unknown" + elif [[ $(md5sum "$bios_folder/$bios_subdir$bios_file" | awk '{ print $1 }') == "$bios_hash" ]]; then + bios_hash_matched="Yes" + fi + fi + bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc") + echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc" >> "$godot_bios_files_checked" # Godot data transfer temp file + done < $bios_checklist +} + update_rpcs3_firmware() { mkdir -p "$roms_folder/ps3/tmp" chmod 777 "$roms_folder/ps3/tmp" diff --git a/functions/global.sh b/functions/global.sh index 20ee8f4b..6f1fd0be 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -47,6 +47,10 @@ presets_dir="$emuconfigs/defaults/retrodeck/presets" incompatible_presets_reference_list="$emuconfigs/defaults/retrodeck/reference_lists/incompatible_presets.cfg" # A config file listing all incompatible presets for reference (eg. cannot have borders and widescreen enabled simultaniously) pretty_system_names_reference_list="$emuconfigs/defaults/retrodeck/reference_lists/pretty_system_names.cfg" # An internal translation list for turning internal names (eg. gbc) to "pretty" names (Nintendo GameBoy Color) +# Godot data transfer temp files + +godot_bios_files_checked="var/config/retrodeck/godot_bios_files_checked.tmp" + # Config files for emulators with single config files citraconf="/var/config/citra-emu/qt-config.ini" diff --git a/tools/configurator.sh b/tools/configurator.sh index d474a279..edd9cf67 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -940,20 +940,7 @@ configurator_check_bios_files() { configurator_generic_dialog "RetroDECK Configurator - Check & Verify: BIOS Files" "This check will look for BIOS files that RetroDECK has identified as working.\n\nNot all BIOS files are required for games to work, please check the BIOS description for more information on its purpose.\n\nThere may be additional BIOS files that will function with the emulators that are not checked.\n\nSome more advanced emulators such as Yuzu will have additional methods for verifiying the BIOS files are in working order." bios_checked_list=() - while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc - do - bios_file_found="No" - bios_hash_matched="No" - if [[ -f "$bios_folder/$bios_subdir$bios_file" ]]; then - bios_file_found="Yes" - if [[ $bios_hash == "Unknown" ]]; then - bios_hash_matched="Unknown" - elif [[ $(md5sum "$bios_folder/$bios_subdir$bios_file" | awk '{ print $1 }') == "$bios_hash" ]]; then - bios_hash_matched="Yes" - fi - fi - bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc") - done < $bios_checklist + check_bios_files zenity --list --title="RetroDECK Configurator Utility - Check & Verify: BIOS Files" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ From 837b4a4048d3b0dcd7baf3430d23d523b12760a5 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 21 Feb 2024 14:03:54 -0500 Subject: [PATCH 4/4] Move Godot data transfer temp files location Now at /var/config/retrodeck/godot/ --- functions/global.sh | 2 +- functions/prepare_component.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/global.sh b/functions/global.sh index 6f1fd0be..cabfb66f 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -49,7 +49,7 @@ pretty_system_names_reference_list="$emuconfigs/defaults/retrodeck/reference_lis # Godot data transfer temp files -godot_bios_files_checked="var/config/retrodeck/godot_bios_files_checked.tmp" +godot_bios_files_checked="var/config/retrodeck/godot/godot_bios_files_checked.tmp" # Config files for emulators with single config files diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index 1ad5e035..b367217b 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -23,6 +23,7 @@ prepare_component() { mkdir -p "$rdhome/$(basename $current_setting_value)" fi done < <(grep -v '^\s*$' $rd_conf | awk '/^\[paths\]/{f=1;next} /^\[/{f=0} f') + mkdir -p "/var/config/retrodeck/godot" fi if [[ "$action" == "postmove" ]]; then # Update the paths of any folders that came with the retrodeck folder during a move while read -r config_line; do