diff --git a/emu-configs/defaults/retrodeck/reference_lists/finit_options_list.cfg b/emu-configs/defaults/retrodeck/reference_lists/finit_options_list.cfg index 0c1eb4f1..97689751 100644 --- a/emu-configs/defaults/retrodeck/reference_lists/finit_options_list.cfg +++ b/emu-configs/defaults/retrodeck/reference_lists/finit_options_list.cfg @@ -1,2 +1,3 @@ false^RPCS3 Firmware Install^Install firmware needed for PS3 emulation^rpcs3_firmware +false^Vita3K Firmware Install^Install firmware needed for Vita3K emulation^vita3k_firmware false^RetroDECK Controller Profile^Install custom RetroDECK controller profile^rd_controller_profile diff --git a/emu-configs/gzdoom/gzdoom.pk3 b/emu-configs/gzdoom/gzdoom.pk3 new file mode 100644 index 00000000..c96467ab Binary files /dev/null and b/emu-configs/gzdoom/gzdoom.pk3 differ diff --git a/functions/compression.sh b/functions/compression.sh index 72876292..3d5a819f 100644 --- a/functions/compression.sh +++ b/functions/compression.sh @@ -2,7 +2,7 @@ compress_game() { # Function for compressing one or more files to .chd format - # USAGE: compress_game $format $full_path_to_input_file + # USAGE: compress_game $format $full_path_to_input_file $system(optional) local file="$2" local filename_no_path=$(basename "$file") local filename_no_extension="${filename_no_path%.*}" @@ -10,7 +10,11 @@ compress_game() { local dest_file=$(dirname "$(realpath "$file")")"/""$filename_no_extension" if [[ "$1" == "chd" ]]; then - /app/bin/chdman createcd -i "$source_file" -o "$dest_file".chd + if [[ "$3" == "psp" ]]; then + echo "Put createdvd or maxcso here" # TODO + else + /app/bin/chdman createcd -i "$source_file" -o "$dest_file".chd + fi elif [[ "$1" == "zip" ]]; then zip -jq9 "$dest_file".zip "$source_file" elif [[ "$1" == "rvz" ]]; then @@ -93,11 +97,11 @@ cli_compress_single_game() { read -p "RetroDECK will now attempt to compress your selected game. Press Enter key to continue..." if [[ ! -z "$file" ]]; then if [[ -f "$file" ]]; then - check_system=$(echo "$file" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$") + local system=$(echo "$file" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$") local compatible_compression_format=$(find_compatible_compression_format "$file") if [[ ! $compatible_compression_format == "none" ]]; then echo "$(basename "$file") can be compressed to $compatible_compression_format" - compress_game "$compatible_compression_format" "$file" + compress_game "$compatible_compression_format" "$file" "$system" if [[ $post_compression_cleanup == [yY] ]]; then # Remove file(s) if requested if [[ $(basename "$file") == *".cue" ]]; then local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") @@ -155,7 +159,7 @@ cli_compress_all_games() { local compatible_compression_format=$(find_compatible_compression_format "$file") if [[ ! "$compatible_compression_format" == "none" ]]; then echo "$(basename "$file") can be compressed to $compatible_compression_format" - compress_game "$compatible_compression_format" "$file" + compress_game "$compatible_compression_format" "$file" "$system" if [[ $post_compression_cleanup == [yY] ]]; then # Remove file(s) if requested if [[ "$file" == *".cue" ]]; then local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") diff --git a/functions/functions.sh b/functions/functions.sh index 2567037b..9da76b1e 100644 --- a/functions/functions.sh +++ b/functions/functions.sh @@ -107,34 +107,14 @@ download_file() { # file_dest is the destination the file should be in the filesystem, needs filename included! # file_name is a user-readable file name or description to be put in the Zenity dialog - # Run wget in the background and redirect the progress to a temporary file ( - wget "$1" -O "$2" -q --show-progress --progress=dot 2>&1 | sed -n -e 's/^.* \([0-9]*\)%.*$/\1/p' > "/var/cache/tmp/download_progress" & - wget_pid=$! - - progress="0" - echo "$progress" # Initial progress value. sent to Zenity - while true; do - progress=$(tail -n 2 "/var/cache/tmp/download_progress" | head -1) # Read the second-to-last value written to the pipe, to avoid reading data that is half written - echo "$progress" # Send value to Zenity - if [[ "$(tail -n 1 "/var/cache/tmp/download_progress")" == "100" ]]; then # Read last line every time to check for download completion - echo "100" - break - fi - sleep 0.5 - done - - # Wait for wget process to finish - wait "$wget_pid" + wget "$1" -O "$2" -q ) | zenity --progress \ --title="Downloading File" \ --text="Downloading $3..." \ - --percentage=0 \ + --pulsate \ --auto-close - - # Cleanup temp file - rm -f "/var/cache/tmp/download_progress" } update_rd_conf() { @@ -314,6 +294,13 @@ update_rpcs3_firmware() { rm -rf "$roms_folder/ps3/tmp" } +update_vita3k_firmware() { + download_file "http://dus01.psv.update.playstation.net/update/psv/image/2022_0209/rel_f2c7b12fe85496ec88a0391b514d6e3b/PSVUPDAT.PUP" "/tmp/PSVUPDAT.PUP" "Vita3K Firmware file 1" + download_file "http://dus01.psp2.update.playstation.net/update/psp2/image/2019_0924/sd_8b5f60b56c3da8365b973dba570c53a5/PSP2UPDAT.PUP?dest=us" "/tmp/PSP2UPDAT.PUP" "Vita3K Firmware file 2" + Vita3K --firmware /tmp/PSVUPDAT.PUP + Vita3K --firmware /tmp/PSP2UPDAT.PUP +} + backup_retrodeck_userdata() { mkdir -p "$backups_folder" zip -rq9 "$backups_folder/$(date +"%0m%0d")_retrodeck_userdata.zip" "$saves_folder" "$states_folder" "$bios_folder" "$media_folder" "$themes_folder" "$logs_folder" "$screenshots_folder" "$mods_folder" "$texture_packs_folder" "$borders_folder" > $logs_folder/$(date +"%0m%0d")_backup_log.log @@ -469,6 +456,10 @@ finit() { configurator_generic_dialog "RPCS3 Firmware Install" "You have chosen to install the RPCS3 firmware during the RetroDECK first setup.\n\nThis process will take several minutes and requires network access.\n\nRPCS3 will be launched automatically at the end of the RetroDECK setup process.\nOnce the firmware is installed, please close the emulator to finish the process." fi + if [[ "$finit_options_choices" =~ (vita3k_firmware|Enable All) ]]; then # Additional information on the firmware install process, as the emulator needs to be manually closed + configurator_generic_dialog "Vita3K Firmware Install" "You have chosen to install the Vita3K firmware during the RetroDECK first setup.\n\nThis process will take several minutes and requires network access.\n\nVita3K will be launched automatically at the end of the RetroDECK setup process.\nOnce the firmware is installed, please close the emulator to finish the process." + fi + zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" \ --text="RetroDECK will now install the needed files, which can take up to one minute.\nRetroDECK will start once the process is completed.\n\nPress OK to continue." @@ -484,6 +475,11 @@ finit() { update_rpcs3_firmware fi fi + if [[ "$finit_options_choices" =~ (vita3k_firmware|Enable All) ]]; then + if [[ $(check_network_connectivity) == "true" ]]; then + update_vita3k_firmware + fi + fi if [[ "$finit_options_choices" =~ (rd_controller_profile|Enable All) ]]; then install_retrodeck_controller_profile fi diff --git a/functions/global.sh b/functions/global.sh index be52f198..8b8eb4f8 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -137,8 +137,8 @@ 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 SteamOS 3.5 location, assign it as the default - default_sd="$(find media/deck/* -maxdepth 0 -type d -print)" + if [[ $(find /run/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 /run/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 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")" diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index e0059e43..0c5f56f8 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -686,13 +686,6 @@ prepare_component() { fi # Shared actions dir_prep "$saves_folder/psvita/vita3k" "$bios_folder/Vita3K/Vita3K/ux0/user/00/savedata" # Multi-user safe? - - # Installing firmware - # TODO: at the moment this is here instead of a tool because it seems like it cannot run without Firmware - curl "http://dus01.psv.update.playstation.net/update/psv/image/2022_0209/rel_f2c7b12fe85496ec88a0391b514d6e3b/PSVUPDAT.PUP" -po /tmp/PSVUPDAT.PUP - curl "http://dus01.psp2.update.playstation.net/update/psp2/image/2019_0924/sd_8b5f60b56c3da8365b973dba570c53a5/PSP2UPDAT.PUP?dest=us" -po /tmp/PSP2UPDAT.PUP - Vita3K --firmware /tmp/PSVUPDAT.PUP - Vita3K --firmware /tmp/PSP2UPDAT.PUP fi if [[ "$action" == "postmove" ]]; then # Run only post-move commands dir_prep "$saves_folder/psvita/vita3k" "$bios_folder/Vita3K/Vita3K/ux0/user/00/savedata" # Multi-user safe? diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index ae428e37..b6c65b97 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -1321,7 +1321,7 @@ modules: # Tools - mkdir -p /app/tools - cp -r tools/** /app/tools - - find /app/tools -name '*.py|*.sh' -exec chmod +x {} \; + - find /app/tools -type f \( -name "*.sh" -o -name "*.py" \) -exec chmod +x {} \; # Function libraries - mkdir -p /app/libexec @@ -1357,4 +1357,4 @@ modules: sources: - type: git url: https://github.com/XargonWan/RetroDECK.git - branch: THISBRANCH \ No newline at end of file + branch: THISBRANCH diff --git a/retrodeck.sh b/retrodeck.sh index 1758eee8..f80c0ea5 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -79,8 +79,8 @@ https://retrodeck.net if [[ $response == [yY] ]]; then rm -f "$lockfile" rm -f "$rd_conf" - read -p "The process has been completed, press Enter key to start the initial RetroDECK setup process." - shift # Continue launch after previous command is finished + read -p "The process has been completed, press Enter key to exit. Please run RetroDECK again to start the initial setup process." + exit 1 else read -p "The process has been cancelled, press Enter key to exit." exit diff --git a/tools/configurator.sh b/tools/configurator.sh index 070b272c..0b002044 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -60,6 +60,7 @@ source /app/libexec/global.sh # - Compress All Games # - Install: RetroDECK SD Controller Profile # - Install: PS3 firmware +# - Install: PS Vita firmware # - RetroDECK: Change Update Setting # - Troubleshooting # - Backup: RetroDECK Userdata @@ -531,6 +532,7 @@ configurator_retrodeck_tools_dialog() { "Tool: Compress Games" "Compress games for systems that support it" \ "Install: RetroDECK SD Controller Profile" "Install the custom RetroDECK controller layout for the Steam Deck" \ "Install: PS3 Firmware" "Download and install PS3 firmware for use with the RPCS3 emulator" \ + "Install: PS Vita Firmware" "Download and install PS Vita firmware for use with the Vita3K emulator" \ "RetroDECK: Change Update Setting" "Enable or disable online checks for new versions of RetroDECK" ) case $choice in @@ -571,6 +573,24 @@ configurator_retrodeck_tools_dialog() { fi ;; + "Install: PS Vita Firmware" ) + if [[ $(check_network_connectivity) == "true" ]]; then + configurator_generic_dialog "RetroDECK Configurator - Install: PS Vita firmware" "This tool will download firmware required by Vita3K to emulate PS Vita games.\n\nThe process will take several minutes, and the emulator will launch to finish the installation.\nPlease close Vita3K manually once the installation is complete." + ( + update_vita3k_firmware + ) | + zenity --progress --pulsate \ + --icon-name=net.retrodeck.retrodeck \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --title="Downloading PS Vita Firmware" \ + --no-cancel \ + --auto-close + else + configurator_generic_dialog "RetroDECK Configurator - Install: PS Vita Firmware" "You do not appear to currently have Internet access, which is required by this tool. Please try again when network access has been restored." + configurator_retrodeck_tools_dialog + fi + ;; + "RetroDECK: Change Update Setting" ) configurator_online_update_setting_dialog ;; @@ -691,33 +711,24 @@ configurator_compression_tool_dialog() { configurator_compress_single_game_dialog() { local file=$(file_browse "Game to compress") if [[ ! -z "$file" ]]; then + local system=$(echo "$file" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$") local compatible_compression_format=$(find_compatible_compression_format "$file") if [[ ! $compatible_compression_format == "none" ]]; then local post_compression_cleanup=$(configurator_compression_cleanup_dialog) ( - if [[ $compatible_compression_format == "chd" ]]; then - if [[ $(validate_for_chd "$file") == "true" ]]; then - echo "# Compressing $(basename "$file") to $compatible_compression_format format" - compress_game "chd" "$file" - if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested - if [[ "$file" == *".cue" ]]; then - local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") - local file_path=$(dirname "$(realpath "$file")") - while IFS= read -r line - do - rm -f "$file_path/$line" - done < <(printf '%s\n' "$cue_bin_files") - rm -f "$file" - else - rm -f "$file" - fi - fi - fi - else - echo "# Compressing $(basename "$file") to $compatible_compression_format format" - compress_game "$compatible_compression_format" "$file" - if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested - rm -f "$file" + echo "# Compressing $(basename "$file") to $compatible_compression_format format" + compress_game "$compatible_compression_format" "$file" "$system" + if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested + if [[ "$file" == *".cue" ]]; then + local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") + local file_path=$(dirname "$(realpath "$file")") + while IFS= read -r line + do + rm -f "$file_path/$line" + done < <(printf '%s\n' "$cue_bin_files") + rm -f $(realpath "$file") + else + rm -f "$(realpath "$file")" fi fi ) | @@ -817,12 +828,13 @@ configurator_compress_multiple_games_dialog() { local post_compression_cleanup=$(configurator_compression_cleanup_dialog) ( for file in "${games_to_compress[@]}"; do + local system=$(echo "$file" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$") local compression_format=$(find_compatible_compression_format "$file") echo "# Compressing $(basename "$file") into $compression_format format" # Update Zenity dialog text progress=$(( 100 - (( 100 / "$total_games_to_compress" ) * "$games_left_to_compress" ))) echo $progress games_left_to_compress=$((games_left_to_compress-1)) - compress_game "$compression_format" "$file" + compress_game "$compression_format" "$file" "$system" if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested if [[ "$file" == *".cue" ]]; then local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file")