diff --git a/emu-configs/defaults/retrodeck/reference_lists/finit_options_list.cfg b/emu-configs/defaults/retrodeck/reference_lists/finit_options_list.cfg new file mode 100644 index 00000000..f14433ae --- /dev/null +++ b/emu-configs/defaults/retrodeck/reference_lists/finit_options_list.cfg @@ -0,0 +1,3 @@ +false^RPCS3 Firmware Install^Install firmware needed for PS3 emulation^rpcs3_firmware +false^RetroDECK Controller Profile^Install custom RetroDECK controller profile^rd_controller_profile +false^RetroDECK Prepackaged Games^Install freely availble games that are packaged with RetroDECK^rd_prepacks diff --git a/es-configs/es_settings.xml b/es-configs/es_settings.xml index 0b8ab539..8f2b0465 100644 --- a/es-configs/es_settings.xml +++ b/es-configs/es_settings.xml @@ -63,7 +63,7 @@ - + diff --git a/functions.sh b/functions.sh index df0f3639..b9a51dd5 100644 --- a/functions.sh +++ b/functions.sh @@ -1223,12 +1223,6 @@ prepare_emulator() { dir_prep "$themes_folder" "/var/config/emulationstation/.emulationstation/themes" dir_prep "$rdhome/gamelists" "/var/config/emulationstation/.emulationstation/gamelists" cp -f /app/retrodeck/es_settings.xml /var/config/emulationstation/.emulationstation/es_settings.xml - - # RetroDECK prepack metadata - mkdir -p "/var/config/emulationstation/.emulationstation/gamelists/doom" - cp "/app/retrodeck/rd_prepacks/doom/gamelist.xml" "/var/config/emulationstation/.emulationstation/gamelists/doom/gamelist.xml" - mkdir -p "$media_folder/doom" - unzip -oq "/app/retrodeck/rd_prepacks/doom/doom.zip" -d "$media_folder/doom/" fi if [[ "$action" == "postmove" ]]; then dir_prep "$roms_folder" "/var/config/emulationstation/ROMs" @@ -1443,13 +1437,14 @@ prepare_emulator() { set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards" fi dir_prep "$saves_folder/psx/duckstation/memcards" "/var/data/duckstation/memcards" # TODO: This shouldn't be needed anymore, verify - dir_prep "$states_folder/psx/duckstation" "/var/data/duckstation/savestates" + dir_prep "$states_folder/psx/duckstation" "/var/data/duckstation/savestates" # This is hard-coded in Duckstation, always needed fi if [[ "$action" == "postmove" ]]; then # Run only post-move commands set_setting_value "$duckstationconf" "SearchDirectory" "$bios_folder" "duckstation" "BIOS" set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards" set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards" set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards" + dir_prep "$states_folder/psx/duckstation" "/var/data/duckstation/savestates" # This is hard-coded in Duckstation, always needed fi fi @@ -1768,9 +1763,15 @@ prepare_emulator() { } update_rpcs3_firmware() { + ( mkdir -p "$roms_folder/ps3/tmp" chmod 777 "$roms_folder/ps3/tmp" wget "$rpcs3_firmware" -P "$roms_folder/ps3/tmp/" + ) | + 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 RPCS3 Firmware Download" \ + --text="RetroDECK downloading the RPCS3 firmware, please wait." rpcs3 --installfw "$roms_folder/ps3/tmp/PS3UPDAT.PUP" rm -rf "$roms_folder/ps3/tmp" } @@ -1854,6 +1855,29 @@ do done } +finit_user_options_dialog() { + finit_available_options=() + + while IFS="^" read -r enabled option_name option_desc option_tag + do + finit_available_options=("${finit_available_options[@]}" "$enabled" "$option_name" "$option_desc" "$option_tag") + done < $finit_options_list + + + local choices=$(zenity \ + --list --width=1200 --height=720 \ + --checklist --hide-column=4 --ok-label="Confirm Selections" --extra-button="Enable All" \ + --separator=" " --print-column=4 \ + --text="Choose which options to enable:" \ + --column "Enabled?" \ + --column "Option" \ + --column "Description" \ + --column "option_flag" \ + "${finit_available_options[@]}") + + echo "${choices[*]}" +} + finit() { # Force/First init, depending on the situation @@ -1930,21 +1954,13 @@ finit() { conf_write # Write the new values to retrodeck.cfg - local finit_options_choices=$(zenity \ - --list --width=1200 --height=720 \ - --checklist --hide-column=4 --ok-label="Confirm Selections" --extra-button="Enable All" \ - --separator=" " --print-column=4 \ - --text="Choose which options to enable:" \ - --column "Enabled?" \ - --column "Option" \ - --column "Description" \ - --column "option_flag" \ - "${finit_options_list[@]}" ) + configurator_generic_dialog "RetroDECK Initial Setup" "The next dialog will be a list of optional actions to take during the initial setup.\n\nIf you choose to not do any of these now, they can be done later through the Configurator." + local finit_options_choices=$(finit_user_options_dialog) if [[ "$finit_options_choices" =~ (rpcs3_firmware|Enable All) ]]; then # Additional information on the firmware install process, as the emulator needs to be manually closed 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 - + 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." @@ -1954,15 +1970,21 @@ finit() { # Optional actions based on user choices if [[ "$finit_options_choices" =~ (rpcs3_firmware|Enable All) ]]; then - update_rpcs3_firmware + if [[ $(check_network_connectivity) == "true" ]]; then + update_rpcs3_firmware + fi fi if [[ "$finit_options_choices" =~ (rd_controller_profile|Enable All) ]]; then rsync -a "/app/retrodeck/binding-icons/" "$HOME/.steam/steam/tenfoot/resource/images/library/controller/binding_icons/" cp -f "$emuconfigs/retrodeck/defaults/RetroDECK_controller_config.vdf" "$HOME/.steam/steam/controller_base/templates/RetroDECK_controller_config.vdf" fi - - # Add packaged extras, after the ROMS folder has been initialized - cp /app/retrodeck/extras/doom1.wad "$roms_folder/doom/doom1.wad" # No -f in case the user already has it + if [[ "$finit_options_choices" =~ (rd_prepacks|Enable All) ]]; then + cp /app/retrodeck/extras/doom1.wad "$roms_folder/doom/doom1.wad" # No -f in case the user already has it + mkdir -p "/var/config/emulationstation/.emulationstation/gamelists/doom" + cp "/app/retrodeck/rd_prepacks/doom/gamelist.xml" "/var/config/emulationstation/.emulationstation/gamelists/doom/gamelist.xml" + mkdir -p "$media_folder/doom" + unzip -oq "/app/retrodeck/rd_prepacks/doom/doom.zip" -d "$media_folder/doom/" + fi ) | zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ diff --git a/global.sh b/global.sh index d557a526..bb76b0c4 100755 --- a/global.sh +++ b/global.sh @@ -14,7 +14,8 @@ bios_checklist="$emuconfigs/defaults/retrodeck/reference_lists/bios_checklist.cf compression_targets="$emuconfigs/defaults/retrodeck/reference_lists/compression_targets.cfg" # A config file containing supported compression types per system zip_compressable_extensions="$emuconfigs/defaults/retrodeck/reference_lists/zip_compressable_extensions.cfg" # A config file containing every file extension that is allowed to be compressed to .zip format, because there are a lot! easter_egg_checklist="$emuconfigs/defaults/retrodeck/reference_lists/easter_egg_checklist.cfg" # A config file listing days and times when special splash screens should show up -input_validation="$emuconfigs/defaults/retrodeck/reference_lists/input_validation.cfg" # List of valid CLI inputs +input_validation="$emuconfigs/defaults/retrodeck/reference_lists/input_validation.cfg" # A config file listing valid CLI inputs +finit_options_list="$emuconfigs/defaults/retrodeck/reference_lists/finit_options_list.cfg" # A config file listing available optional installs during finit splashscreen_dir="/var/config/emulationstation/.emulationstation/resources/graphics/extra-splashes" # The default location of extra splash screens current_splash_file="/var/config/emulationstation/.emulationstation/resources/graphics/splash.svg" # The active splash file that will be shown on boot default_splash_file="/var/config/emulationstation/.emulationstation/resources/graphics/splash-orig.svg" # The default RetroDECK splash screen diff --git a/post_update.sh b/post_update.sh index 3eb0333e..8ece8003 100644 --- a/post_update.sh +++ b/post_update.sh @@ -91,11 +91,13 @@ post_update() { dir_prep "$rdhome/gamelists" "/var/config/emulationstation/.emulationstation/gamelists" - cp "/app/retrodeck/extras/doom1.wad" "$roms_folder/doom/doom1.wad" # No -f in case the user already has it - mkdir -p "/var/config/emulationstation/.emulationstation/gamelists/doom" - cp -f "/app/retrodeck/rd_prepacks/doom/gamelist.xml" "/var/config/emulationstation/.emulationstation/gamelists/doom/gamelist.xml" - mkdir -p "$media_folder/doom" - unzip -oq "/app/retrodeck/rd_prepacks/doom/doom.zip" -d "$media_folder/doom/" + if [[ $(configurator_generic_question_dialog "RetroDECK DOOM Addition" "RetroDECK now runs DOOM!\n\nIf you would like to have this classic game added to your library, smash that Yes button!") == "true" ]]; then + cp "/app/retrodeck/extras/doom1.wad" "$roms_folder/doom/doom1.wad" # No -f in case the user already has it + mkdir -p "/var/config/emulationstation/.emulationstation/gamelists/doom" + cp -f "/app/retrodeck/rd_prepacks/doom/gamelist.xml" "/var/config/emulationstation/.emulationstation/gamelists/doom/gamelist.xml" + mkdir -p "$media_folder/doom" + unzip -oq "/app/retrodeck/rd_prepacks/doom/doom.zip" -d "$media_folder/doom/" + fi cp -f $emuconfigs/rpcs3/vfs.yml /var/config/rpcs3/vfs.yml sed -i 's^\^$(EmulatorDir): .*^$(EmulatorDir): '"$bios_folder/rpcs3/"'^' "$rpcs3vfsconf" @@ -104,7 +106,7 @@ post_update() { mkdir "$bios_folder/rpcs3" mv "$roms_folder/ps3/emudir/*" "$bios_folder/rpcs3/" rm "$roms_folder/ps3/emudir" - configurator_generic_dialog "As part of this update and due to a RPCS3 config upgrade, the files that used to exist at\n\n~/retrodeck/roms/ps3/emudir\n\nare now located at\n\n~/retrodeck/bios/rpcs3.\nYour existing files have been moved automatically." + configurator_generic_dialog "RetroDECK 0.7.0b Upgrade" "As part of this update and due to a RPCS3 config upgrade, the files that used to exist at\n\n~/retrodeck/roms/ps3/emudir\n\nare now located at\n\n~/retrodeck/bios/rpcs3.\nYour existing files have been moved automatically." fi mkdir -p "$bios_folder/rpcs3/dev_hdd0" mkdir -p "$bios_folder/rpcs3/dev_hdd1" @@ -117,9 +119,16 @@ post_update() { set_setting_value $es_settings "ApplicationUpdaterFrequency" "never" "es_settings" + if [[ -f "$saves_folder/duckstation/shared_card_1.mcd" || -f "$saves_folder/duckstation/shared_card_2.mcd" ]]; then + configurator_generic_dialog "RetroDECK 0.7.0b Upgrade" "As part of this update, the location of saves and states for Duckstation has been changed.\n\nYour files will be moved automatically, and can now be found at\n\n~.../saves/psx/duckstation/memcards/\nand\n~.../states/psx/duckstation/" + fi mkdir -p "$saves_folder/psx/duckstation/memcards" mv "$saves_folder/duckstation/*" "$saves_folder/psx/duckstation/memcards/" rmdir "$saves_folder/duckstation" # File-safe folder cleanup + unlink "/var/data/duckstation/memcards" + set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards" + set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards" + set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards" mkdir -p "$states_folder/psx" mv -t "$states_folder/psx/" "$states_folder/duckstation" unlink "/var/data/duckstation/savestates" @@ -128,7 +137,7 @@ post_update() { rm -rf /var/config/retrodeck/tools rm -rf /var/config/emulationstation/.emulationstation/gamelists/tools/ - configurator_generic_dialog "As part of this update, we are offering a new official RetroDECK controller profile!\nIt is an optional component that helps you get the most out of RetroDECK with a new in-game radial menu for unified hotkeys across emulators.\n\nThe files need to be installed outside of the normal ~/retrodeck folder, so we wanted your permission before proceeding.\nIf you decide to not install the profile now, it can always be done later through the Configurator.\n\nThe files will be installed at the following shared Steam locations:\n\n$HOME/.steam/steam/tenfoot/resource/images/library/controller/binding_icons/\n$HOME/.steam/steam/controller_base/templates/RetroDECK_controller_config.vdf" + configurator_generic_dialog "RetroDECK 0.7.0b Upgrade" "As part of this update, we are offering a new official RetroDECK controller profile!\nIt is an optional component that helps you get the most out of RetroDECK with a new in-game radial menu for unified hotkeys across emulators.\n\nThe files need to be installed outside of the normal ~/retrodeck folder, so we wanted your permission before proceeding.\nIf you decide to not install the profile now, it can always be done later through the Configurator.\n\nThe files will be installed at the following shared Steam locations:\n\n$HOME/.steam/steam/tenfoot/resource/images/library/controller/binding_icons/\n$HOME/.steam/steam/controller_base/templates/RetroDECK_controller_config.vdf" if [[ $(configurator_generic_question_dialog "RetroDECK Official Controller Profile" "Would you like to install the official RetroDECK controller profile?") == "true" ]]; then rsync -a "/app/retrodeck/binding-icons/" "$HOME/.steam/steam/tenfoot/resource/images/library/controller/binding_icons/" cp -f "$emuconfigs/retrodeck/defaults/RetroDECK_controller_config.vdf" "$HOME/.steam/steam/controller_base/templates/RetroDECK_controller_config.vdf"