diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 4ffb693a..8dfc36fa 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -64,6 +64,9 @@ jobs: # if the branch is coming from a PR the tag should be manually built - name: "Generate version tag" run: | + source automation_tools/version_extractor.sh + MANIFEST_VERSION="$(fetch_manifest_version)" + echo "MANIFEST_VERSION=$MANIFEST_VERSION" >> $GITHUB_ENV if [[ "$BRANCH_NAME" == 'refs/'* ]]; then pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') source_branch=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') @@ -71,9 +74,11 @@ jobs: echo "[DEBUG] source branch is: $source_branch" echo "TAG=PR-$pr_number-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV else - echo "TAG=${{env.BRANCH_NAME}}-${{ env.buildid }}" >> $GITHUB_ENV + TAG="$MANIFEST_VERSION-${{ env.buildid }}" + echo "TAG=$TAG" >> $GITHUB_ENV fi - echo "Version TAG: ${{ env.TAG }}" + echo "MANIFEST_VERSION: $MANIFEST_VERSION" + echo "Version TAG: $TAG" # backing up manifest in case download fails and hashes must be recalculated - name: Manifest backup @@ -159,6 +164,17 @@ jobs: repo: RetroDECK-cooker continue-on-error: true + - name: Rewrite Tag + run: | + git submodule deinit -f --all + git fetch --tags + if git rev-parse --verify "${{ env.TAG }}" >/dev/null 2>&1; then # if the tag exists + git tag -d "${{ env.TAG }}" # remove it from local repo + git push --delete origin "${{ env.TAG }}" # and from remote + fi + git tag "${{ env.TAG }}" # Create the tag locally + git push origin "${{ env.TAG }}" # Push the new tag in the remote repo + # In case it cannot publish the release at least it's providing the flatpak file for creating a manual release - name: Upload RetroDECK-cooker.flatpak uses: actions/upload-artifact@v3 @@ -171,6 +187,7 @@ jobs: # run: | # # Set variables for Gitea host, organization, repository, access token, and release details # GITEA_HOST="repo.retrodeck.net" + # UPLOAD_HOST="upload.retrodeck.net" # ORGANIZATION="RetroDECK" # REPO="RetroDECK-cooker" # GITEA_TOKEN="${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }}" @@ -201,19 +218,22 @@ jobs: # # Upload artifacts # curl -X POST \ # -H "Authorization: token ${GITEA_TOKEN}" \ + # -H "X-GitHub-Token: ${{ secrets.UPLOAD_TOKEN }}" \ # -H "Content-Type: multipart/form-data" \ # -F "attachment=@RetroDECK-cooker.flatpak" \ - # "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-cooker.flatpak" + # "http://$UPLOAD_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-cooker.flatpak" # # Upload artifacts sha # curl -X POST \ # -H "Authorization: token ${GITEA_TOKEN}" \ + # -H "X-GitHub-Token: ${{ secrets.UPLOAD_TOKEN }}" \ # -H "Content-Type: multipart/form-data" \ # -F "attachment=@RetroDECK-cooker.flatpak.sha" \ - # "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-cooker.flatpak.sha" + # "http://$UPLOAD_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-cooker.flatpak.sha" # curl -X POST \ # -H "Authorization: token ${GITEA_TOKEN}" \ + # -H "X-GitHub-Token: ${{ secrets.UPLOAD_TOKEN }}" \ # -H "Content-Type: multipart/form-data" \ # -F "attachment=@RetroDECK-Artifact.tar.gz" \ - # "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-Artifact.tar.gz" + # "http://$UPLOAD_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-Artifact.tar.gz" diff --git a/.github/workflows/emulator-updates.yaml b/.github/workflows/emulator-updates.yaml new file mode 100644 index 00000000..ef845cde --- /dev/null +++ b/.github/workflows/emulator-updates.yaml @@ -0,0 +1,56 @@ +name: Check Emulator Updates + +on: + # schedule: + # - cron: '0 18 * * *' + # push: + # branches: + # - main + workflow_dispatch: + +jobs: + check-updates: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flatpak-builder-tools + + - name: Check for emulator updates + run: | + flatpak-builder --check-updates ./net.retrodeck.retrodeck.yml --modules "modulo1,modulo2" # Sostituisci modulo1,modulo2 con i tuoi moduli specifici + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Create or update branch + run: | + git fetch origin + if git rev-parse --verify origin/feat/auto-emulator-updates; then + git branch -D feat/auto-emulator-updates + fi + git checkout -b feat/auto-emulator-updates + git add . + git commit -m "Update emulators" + git push --set-upstream origin feat/auto-emulator-updates --force + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + source: feat/auto-emulator-updates + destination: cooker-0.8.2b + title: 'Automated Emulator Updates' + body: 'This PR contains automated updates for specified emulators.' diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index 567aec26..a98b3360 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -115,6 +115,17 @@ jobs: repo: RetroDECK continue-on-error: true + - name: Rewrite Tag + run: | + git submodule deinit -f --all + git fetch --tags + if git rev-parse --verify "${{ env.REL_VER }}" >/dev/null 2>&1; then # if the tag exists + git tag -d "${{ env.REL_VER }}" # remove it from local repo + git push --delete origin "${{ env.REL_VER }}" # and from remote + fi + git tag "${{ env.REL_VER }}" # Create the tag locally + git push origin "${{ env.REL_VER }}" # Push the new tag in the remote repo + # In case it cannot publish the release at least it's providing the flatpak file for creating a manual release - name: Upload RetroDECK.flatpak uses: actions/upload-artifact@v3 @@ -123,35 +134,58 @@ jobs: path: RetroDECK.flatpak continue-on-error: true - - name: Publish the flatpak in a new release on Gitea - uses: ncipollo/release-action@v1 - env: - REL_VER: ${{ env.REL_VER }} - with: - tag: ${{ env.REL_VER }} - name: "RetroDECK v${{ env.REL_VER }}" - bodyFile: "body.md" - artifacts: "RetroDECK.flatpak,RetroDECK-Artifact.tar.gz" - allowUpdates: true - makeLatest: true - token: ${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }} - repo: "https://repo.retrodeck.net/RetroDECK/RetroDECK" - continue-on-error: true - - - name: Upload RetroDECK.flatpak to Gitea Release + - name: Publish release on Gitea run: | - curl -X POST \ + # Set variables for Gitea host, organization, repository, access token, and release details + GITEA_HOST="repo.retrodeck.net" + UPLOAD_HOST="upload.retrodeck.net" + ORGANIZATION="RetroDECK" + REPO="RetroDECK" + GITEA_TOKEN="${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }}" + RELEASE_NAME="RetroDECK v${{ env.REL_VER }}" + TAG="${{ env.REL_VER }}" + + payload=$(jq -cn \ + --arg tag_name "$TAG" \ + --arg name "$RELEASE_NAME" \ + --arg body "$(cat body.md)" \ + '{$tag_name, $name, $body}' + ) + + # Create a release using curl and capture the release ID + release_response=$(curl -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ - -F "file=@RetroDECK.flatpak" \ - "https://repo.retrodeck.net/RetroDECK/RetroDECK/releases/${{ env.REL_VER }}/assets?name=RetroDECK.flatpak" - env: - GITEA_TOKEN: ${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }} + -H "Content-Type: application/json" \ + -d "$payload" \ + "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases" + ) + + # Extract the release ID from the response + release_id=$(echo $release_response | jq -r '.id') + + # Upload artifacts + curl -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "X-GitHub-Token: ${{ secrets.UPLOAD_TOKEN }}" \ + -H "Content-Type: multipart/form-data" \ + -F "attachment=@RetroDECK.flatpak" \ + "http://$UPLOAD_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-cooker.flatpak" + + curl -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "X-GitHub-Token: ${{ secrets.UPLOAD_TOKEN }}" \ + -H "Content-Type: multipart/form-data" \ + -F "attachment=@RetroDECK-Artifact.tar.gz" \ + "http://$UPLOAD_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-Artifact.tar.gz" + continue-on-error: true # this will be in place until we reate an artifacts website that bypasses cloudflare limit - name: Upload RetroDECK.flatpak.sha to Gitea Release run: | curl -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ + -H "X-GitHub-Token: ${{ secrets.UPLOAD_TOKEN }}" \ -F "file=@RetroDECK.flatpak.sha" \ - "https://repo.retrodeck.net/RetroDECK/RetroDECK/releases/${{ env.REL_VER }}/assets?name=RetroDECK.flatpak.sha" + "https://$UPLOAD_HOST/RetroDECK/RetroDECK/releases/${{ env.REL_VER }}/assets?name=RetroDECK.flatpak.sha" env: GITEA_TOKEN: ${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }} + continue-on-error: true # this will be in place until we reate an artifacts website that bypasses cloudflare limit diff --git a/.gitignore b/.gitignore index 05fda91c..393e53ca 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ backup tmp .godot rd-submodules/es-de/patches-tmp* -.local/ +retrodeck-repo buildid *.bak incconfigs/ diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index 1b955846..2284832c 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -1,7 +1,7 @@ # The proper format for this file is # ACTION^PLACEHOLDERTEXT^URL^REPO(Optional) # hash^DOOMSHAPLACEHOLDER^https://buildbot.libretro.com/assets/cores/DOOM/Doom%20%28Shareware%29.zip -hash^DUCKSTATIONSHAPLACEHOLDER^https://github.com/stenzek/duckstation/releases/download/preview/DuckStation-x64.AppImage +#hash^DUCKSTATIONSHAPLACEHOLDER^https://github.com/stenzek/duckstation/releases/download/preview/DuckStation-x64.AppImage hash^SAMEDUCKSHAPLACEHOLDER^https://buildbot.libretro.com/nightly/linux/x86_64/latest/sameduck_libretro.so.zip hash^PPSSPPBIOSHASHPLACEHOLDER^https://github.com/hrydgard/ppsspp/archive/refs/heads/master.zip hash^MSXBIOSHASHPLACEHOLDER^http://bluemsx.msxblue.com/rel_download/blueMSXv282full.zip diff --git a/automation_tools/flatpak_build_bundle.sh b/automation_tools/flatpak_build_bundle.sh index 8e79186f..b242820b 100755 --- a/automation_tools/flatpak_build_bundle.sh +++ b/automation_tools/flatpak_build_bundle.sh @@ -3,9 +3,9 @@ # This is building the bundle RetroDECK.flatpak after the download and build steps are done if [ "${GITHUB_REF##*/}" = "main" ]; then - flatpak build-bundle "${GITHUB_WORKSPACE}/.local" "$GITHUB_WORKSPACE/RetroDECK.flatpak" net.retrodeck.retrodeck + flatpak build-bundle "${GITHUB_WORKSPACE}/retrodeck-repo" "$GITHUB_WORKSPACE/RetroDECK.flatpak" net.retrodeck.retrodeck sha256sum RetroDECK.flatpak > RetroDECK.flatpak.sha else - flatpak build-bundle "${GITHUB_WORKSPACE}/.local" "$GITHUB_WORKSPACE/RetroDECK-cooker.flatpak" net.retrodeck.retrodeck + flatpak build-bundle "${GITHUB_WORKSPACE}/retrodeck-repo" "$GITHUB_WORKSPACE/RetroDECK-cooker.flatpak" net.retrodeck.retrodeck sha256sum RetroDECK-cooker.flatpak > RetroDECK-cooker.flatpak.sha fi \ No newline at end of file diff --git a/automation_tools/flatpak_build_download_only.sh b/automation_tools/flatpak_build_download_only.sh index 8c779fbb..e8fca807 100755 --- a/automation_tools/flatpak_build_download_only.sh +++ b/automation_tools/flatpak_build_download_only.sh @@ -12,12 +12,12 @@ else FOLDER=retrodeck-flatpak-cooker fi -mkdir -vp "${GITHUB_WORKSPACE}"/{.local,retrodeck-flatpak-cooker} +mkdir -vp "${GITHUB_WORKSPACE}"/{retrodeck-repo,retrodeck-flatpak-cooker} flatpak-builder --user --force-clean \ --install-deps-from=flathub \ --install-deps-from=flathub-beta \ - --repo="${GITHUB_WORKSPACE}/.local" \ + --repo="${GITHUB_WORKSPACE}/retrodeck-repo" \ --download-only \ "${GITHUB_WORKSPACE}/${FOLDER}" \ net.retrodeck.retrodeck.yml diff --git a/automation_tools/flatpak_build_only.sh b/automation_tools/flatpak_build_only.sh index c7f84d82..33276379 100755 --- a/automation_tools/flatpak_build_only.sh +++ b/automation_tools/flatpak_build_only.sh @@ -12,13 +12,13 @@ else FOLDER=retrodeck-flatpak-cooker fi -mkdir -vp ${GITHUB_WORKSPACE}/.local +mkdir -vp ${GITHUB_WORKSPACE}/retrodeck-repo mkdir -vp ${GITHUB_WORKSPACE}/"$FOLDER" flatpak-builder --user --force-clean \ --install-deps-from=flathub \ --install-deps-from=flathub-beta \ - --repo=${GITHUB_WORKSPACE}/.local \ + --repo=${GITHUB_WORKSPACE}/retrodeck-repo \ --disable-download \ "${GITHUB_WORKSPACE}/$FOLDER" \ net.retrodeck.retrodeck.yml \ No newline at end of file diff --git a/automation_tools/main_version_checker.sh b/automation_tools/main_version_checker.sh index 87011bfd..d230b205 100755 --- a/automation_tools/main_version_checker.sh +++ b/automation_tools/main_version_checker.sh @@ -42,8 +42,8 @@ appdata_version=$(fetch_appdata_version) echo -e "Appdata:\t\t$appdata_version" # Additional checks -if [[ "$manifest_version" == "main" || "$manifest_version" == "THISBRANCH" ]]; then - echo "Manifest version cannot be 'main' or 'THISBRANCH'. Please fix it." +if [[ "$manifest_version" == "main" || "$manifest_version" == "THISBRANCH" || "$manifest_version" == *"cooker"* ]]; then + echo "Manifest version cannot be 'main', 'THISBRANCH', or contain 'cooker'. Please fix it." exit 1 fi diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index 895f2074..5d9a7c91 100755 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -8,6 +8,8 @@ # Needs the URL of the file, in this line format: hash^PLACEHOLDERTEXT^url # latestcommit: Finds the most recent commit of a git repo and updated the placeholder in the manifest. # Needs the URL of the repo and the branch to find the latest commit from, in this line format: latestcommit^PLACEHOLDERTEXT^url^branch +# latestghtag: Finds the most recent tag on a GitHub repo, for repos that don't have normal releases, but also shouldn't use the latest commit +# Needs the URL of the repo, in this line format: latestghtag^PLACEHOLDERTEXT^url # latestghrelease: Finds the download URL and SHA256 hash of the latest release from a git repo. # Needs the API URL of the repo, in this line format: latestappimage^PLACEHOLDERTEXT^https://api.github.com/repos///releases/latest^ # As this command updates two different placeholders (one for the URL, one for the file hash) in the manifest, @@ -48,7 +50,7 @@ cat "$automation_task_list" echo # Update all collected information -while IFS="^" read -r action placeholder url branch +while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]]; do if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then case "$action" in @@ -82,10 +84,20 @@ do /bin/sed -i 's^'"$placeholder"'^'"$commit"'^' $rd_manifest ;; + "latestghtag" ) + echo + echo "Placeholder text: $placeholder" + echo "Repo to get the latest tag from: $url" + echo + tag=$(git ls-remote "$url" | tail -n 1 | cut -f2 | sed 's|refs/tags/||') + echo "Tag found: $tag" + /bin/sed -i 's^'"$placeholder"'^'"$tag"'^' $rd_manifest + ;; + "latestghrelease" ) echo echo "Placeholder text: $placeholder" - echo "Repo to look for AppImage releases: $url" + echo "Repo to look for latest releases: $url" echo ghreleaseurl=$(curl -s "$url" | grep browser_download_url | grep "$branch\""$ | cut -d : -f 2,3 | tr -d \" | sed -n 1p | tr -d ' ') echo "GitHub release URL found: $ghreleaseurl" diff --git a/automation_tools/version_extractor.sh b/automation_tools/version_extractor.sh index b9f679ff..f4714575 100755 --- a/automation_tools/version_extractor.sh +++ b/automation_tools/version_extractor.sh @@ -32,3 +32,5 @@ fetch_manifest_version(){ manifest_version=$(echo "$manifest_version" | awk '{$1=$1;print}') echo "$manifest_version" } + +echo "Version extractor functions loaded" \ No newline at end of file diff --git a/developer_toolbox/build_retrodeck_locally.sh b/developer_toolbox/build_retrodeck_locally.sh index 85b9e90e..b7b53a63 100755 --- a/developer_toolbox/build_retrodeck_locally.sh +++ b/developer_toolbox/build_retrodeck_locally.sh @@ -2,9 +2,22 @@ # WARNING: run this script from the project root folder, not from here!! +# Check if script is running with elevated privileges +if [ "$EUID" -ne 0 ]; then + echo "The build might fail without some superuser permissions, please run me with sudo. Continue without sudo? [y/N,]" + read -r continue_without_sudo + if [[ "$continue_without_sudo" != "y" ]]; then + exit 1 + fi +fi + git submodule update --init --recursive export GITHUB_WORKSPACE="." + +# Initialize the Flatpak repo +ostree init --mode=archive-z2 --repo=${GITHUB_WORKSPACE}/retrodeck-repo + cp net.retrodeck.retrodeck.appdata.xml net.retrodeck.retrodeck.appdata.xml.bak cp net.retrodeck.retrodeck.yml net.retrodeck.retrodeck.yml.bak @@ -12,7 +25,8 @@ automation_tools/install_dependencies.sh automation_tools/cooker_build_id.sh automation_tools/pre_build_automation.sh automation_tools/cooker_flatpak_portal_add.sh -automation_tools/appdata_management.sh +# THIS SCRIPT IS BROKEN HENCE DISABLED FTM +# automation_tools/appdata_management.sh automation_tools/flatpak_build_download_only.sh automation_tools/flatpak_build_only.sh automation_tools/flatpak_build_bundle.sh diff --git a/emu-configs/cemu/controllerProfiles/SteamInput-P1-Gyro.xml b/emu-configs/cemu/controllerProfiles/SteamInput-P1-Gyro.xml index 83531018..209f6a5c 100644 --- a/emu-configs/cemu/controllerProfiles/SteamInput-P1-Gyro.xml +++ b/emu-configs/cemu/controllerProfiles/SteamInput-P1-Gyro.xml @@ -25,7 +25,7 @@ SDLController - 0_03000000de280000ff11000001000000 + 0_030079f6de280000ff11000001000000 Steam Virtual Gamepad 0 @@ -41,6 +41,54 @@ 1 + + 25 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + 10 + + + + 11 + + 24 @@ -93,50 +141,6 @@ 12 - - 11 - - - - 10 - - - - 9 - - - - 8 - - - - 7 - - - - 6 - - - - 5 - - - - 4 - - - - 3 - - - - 2 - - - - 1 - - diff --git a/emu-configs/cemu/controllerProfiles/SteamInput-P1.xml b/emu-configs/cemu/controllerProfiles/SteamInput-P1.xml index e62e1b06..98f98ede 100644 --- a/emu-configs/cemu/controllerProfiles/SteamInput-P1.xml +++ b/emu-configs/cemu/controllerProfiles/SteamInput-P1.xml @@ -4,7 +4,7 @@ SteamInput-P1 SDLController - 0_03000000de280000ff11000001000000 + 0_030079f6de280000ff11000001000000 Steam Virtual Gamepad 0 @@ -20,6 +20,10 @@ 1 + + 25 + + 24 @@ -65,56 +69,56 @@ - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - 6 - - - - 7 - - - - 8 - - - - 9 - - - - 10 - - - - 11 - + 13 + 12 - 13 - + 11 + + + + 10 + + + + 9 + + + + 8 + + + + 7 + + + + 6 + + + + 5 + + + + 4 + + + + 3 + + + + 2 + + + + 1 + diff --git a/emu-configs/cemu/controllerProfiles/controller0.xml b/emu-configs/cemu/controllerProfiles/controller0.xml index e62e1b06..4d0f6364 100644 --- a/emu-configs/cemu/controllerProfiles/controller0.xml +++ b/emu-configs/cemu/controllerProfiles/controller0.xml @@ -4,7 +4,7 @@ SteamInput-P1 SDLController - 0_03000000de280000ff11000001000000 + 0_030079f6de280000ff11000001000000 Steam Virtual Gamepad 0 @@ -20,6 +20,58 @@ 1 + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + 10 + + + + 11 + + + + 12 + + + + 25 + + 24 @@ -64,54 +116,6 @@ 14 - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - 6 - - - - 7 - - - - 8 - - - - 9 - - - - 10 - - - - 11 - - - - 12 - - 13 diff --git a/emu-configs/cemu/controllerProfiles/controller1.xml b/emu-configs/cemu/controllerProfiles/controller1.xml index 8cd44de7..7d94de0b 100644 --- a/emu-configs/cemu/controllerProfiles/controller1.xml +++ b/emu-configs/cemu/controllerProfiles/controller1.xml @@ -1,7 +1,6 @@ Wii U Pro Controller - SteamInput-P2 SDLController 1_03000000de280000ff11000001000000 @@ -19,65 +18,65 @@ 1 + + 12 + + 13 - - 14 - - - - 15 - - - - 16 - - - - 17 - - - - 18 - - - - 19 - - - - 20 - - - - 21 - - - - 22 - - 23 - 1 - + 22 + + + + 21 + + + + 20 + + + + 19 + + + + 18 + + + + 17 + + + + 16 + + + + 15 + + + + 24 + 2 - + 3 - + 4 - + 5 @@ -103,17 +102,17 @@ 10 - - 12 - - 25 - 24 - + 14 + + + + 1 + diff --git a/emu-configs/cemu/controllerProfiles/controller2.xml b/emu-configs/cemu/controllerProfiles/controller2.xml index ed9033cf..3a45edb9 100644 --- a/emu-configs/cemu/controllerProfiles/controller2.xml +++ b/emu-configs/cemu/controllerProfiles/controller2.xml @@ -20,25 +20,29 @@ - 24 - + 13 + - 25 - - - - 12 - + 23 + 10 + + 22 + + 9 + + 21 + + 8 @@ -60,21 +64,21 @@ - 3 - + 25 + - 13 - - - - 14 - + 12 + 1 + + 14 + + 15 @@ -87,6 +91,10 @@ 16 + + 3 + + 17 @@ -104,16 +112,8 @@ - 21 - - - - 22 - - - - 23 - + 24 + diff --git a/emu-configs/cemu/controllerProfiles/controller3.xml b/emu-configs/cemu/controllerProfiles/controller3.xml index c2c639ad..b3cc689f 100644 --- a/emu-configs/cemu/controllerProfiles/controller3.xml +++ b/emu-configs/cemu/controllerProfiles/controller3.xml @@ -20,25 +20,29 @@ - 24 - + 13 + - 25 - - - - 12 - + 23 + 10 + + 22 + + 9 + + 21 + + 8 @@ -60,21 +64,21 @@ - 3 - + 25 + - 13 - - - - 14 - + 12 + 1 + + 14 + + 15 @@ -87,6 +91,10 @@ 16 + + 3 + + 17 @@ -104,16 +112,8 @@ - 21 - - - - 22 - - - - 23 - + 24 + diff --git a/emu-configs/cemu/settings.xml b/emu-configs/cemu/settings.xml index 62a1e269..45c27204 100644 --- a/emu-configs/cemu/settings.xml +++ b/emu-configs/cemu/settings.xml @@ -94,9 +94,9 @@ 100 100 100 - alsa_output.pci-0000_04_00.5-platform-acp5x_mach.0.HiFi__hw_acp5x_1__sink - alsa_output.pci-0000_04_00.5-platform-acp5x_mach.0.HiFi__hw_acp5x_1__sink - filter-chain-source + default + default + default 2147483649 diff --git a/emu-configs/defaults/retrodeck/reference_lists/pretty_system_names.cfg b/emu-configs/defaults/retrodeck/reference_lists/pretty_system_names.cfg index e668911a..309b38fa 100644 --- a/emu-configs/defaults/retrodeck/reference_lists/pretty_system_names.cfg +++ b/emu-configs/defaults/retrodeck/reference_lists/pretty_system_names.cfg @@ -1,17 +1,23 @@ -dolphin^Dolphin (GameCube / Wii Standalone Emulator) +cemu^Cemu (Nintendo Wii U Standalone Emulator) +citra^Citra (Nintendo 3DS Standalone Emulator, via Ponzu) +dolphin^Dolphin (Nintendo GameCube / Wii Standalone Emulator) duckstation^Duckstation (Sony Playstation Standalone Emulator) gb^Nintendo GameBoy gba^Nintendo GameBoy Advance gbc^Nintendo GameBoy Color genesis^Sega Genesis/Master System gg^Sega GameGear +mame^MAME (Multi-Arcade Machine Standalone Emulator) +melonds^MelonDS (Nintendo DS Standalone Emulator) n64^Nintendo 64 pcsx2^PCSX2 (Sony Playstation 2 Standalone Emulator) ppsspp^PPSSPP (Sony PSP Standalone Emulator) primehack^Primehack (Metroid Prime Standalone Emulator) psx_ra^Sony Playstation (RetroArch Core) retroarch^RetroArch (Multi-emulator Frontend) +rpcs3^RPCS3 (Sony Playstation 3 Standalone Emulator) ryujinx^Ryujinx (Nintendo Switch Standalone Emulator) snes^Nintendo Super Nintendo +vita3k^Vita3K (Sony PSVita Standalone Emulator) +xemu^XEMU (Microsoft Xbox Standalone Emulator) yuzu^Yuzu (Nintendo Switch Standalone Emulator, via Ponzu) -citra^Citra (Nintendo 3DS Standalone Emulator, via Ponzu) \ No newline at end of file diff --git a/emu-configs/defaults/retrodeck/reference_lists/retrodeck_credits.txt b/emu-configs/defaults/retrodeck/reference_lists/retrodeck_credits.txt index 49d44557..e2f0a385 100644 --- a/emu-configs/defaults/retrodeck/reference_lists/retrodeck_credits.txt +++ b/emu-configs/defaults/retrodeck/reference_lists/retrodeck_credits.txt @@ -1,74 +1,67 @@ -Credits & The Team - -This is the page where we try to introduce the team and thank everyone who have contributed to the project so far. -If you feel you have contributed to the project but lacks mention, please contact us on discord! - The Team -XargonWan -RetroDECK project founder and also one of the founding members of AmberELEC. -IceNine451 -Creator of the RetroDECK configurator and the RetroDECK Framework. +--- + +XargonWan + +RetroDECK project founder and also one of the founding members of AmberELEC. +Grand General of the IPL (Italian Pizza Legion) also known as the Napoletanan Fist in the internal pizza war. + +--- Lazorne -Community management/outreach, testing, documentation and Wiki Lord. + +Community management/outreach, testing, documentation, emulator configurations, Steam Input and feature request / issue management. +Meme Lord of the Wiki and also the cult leader of the NPC (The Nordic Pizza Cult) also called by the others as "The Pizza Heresy Cult" or "Harbingers of Pizza Chaos". Instigator of the internal pizza war. + +--- + +jiannazzone + +Web Development, Community management/outreach, testing, documentation. Have not choosen a side yet in the Pizza War. + +--- + +IceNine451 + +Creator of the RetroDECK configurator, the RetroDECK Framework and various cool things. +Freedom loving leader of the MCCP (Murican Cheese Crust Patriots) in the internal pizza war. + +--- + +Lx32 + + +Develops various new features, functions and tools. +1st Commander of the IPL (Italian Pizza Legion) nicknamed Paladin al Taglio in the internal pizza war. + +--- WallK -Works on Godot Features. -LX32 -Works on a many projects. +Checks GODOT and other things. +Pizza Mercenary + +--- dottormac -Tester +Does bleeding edge cooker testing (lives in the danger zone), some feature suggestions and design. -Collaborators -Leon Styhre -Maker of EmulationStation Desktop Edition +--- -anthonycaccese -Theme creator for ES-DE and AmberELEC + We want give special thanks to: +- Our Patreon and donors that keeps the build servers running and provide feedback. -Additional credits -RavenKilit -Former Beta Tester and AmberELEC contributor +- All related emulation, front end and software projects that we are dependent on. -MorGuux -Made the RetroDECK steamdb graphics for the old logo +- All people that have put both time and money into emulation projects. -Pixelguin -Made the new logo and steamdb graphics +- All the users who help others with support, guidance and good spirit. -teotwaki -Generous cloud hosting sponsor +- All the users who help with testing and reporting issues. -Niroku / Atari -Helps with community management, is also part of Batocera +- All the community creators who creates various art and assets for the community. -Gabeboii -Webmaster - -Draco -Former server admiistrator and code consultant - -ItzSelenux -Maker of pixelitos - -Kenny.nl -The Kenny.nl project provides several free game assets under open licenses. - - -Special Thanks - -We want give special thanks to: - - Our Patreons that keeps the build servers running and provide feedback. - All related emulation projects, such as Batocera and AmberELEC where we are taking our inspiration. - All people that have put both time and money into emulation projects. - All the users who help others with support, guidance and good spirit. - All the users who help with testing and reporting issues. - All the community creators who creates various art and assets for the community. - -You are the ones that makes this project possible. +You are all the ones that makes this project possible. diff --git a/emu-configs/defaults/retrodeck/reference_lists/supported_emulators.cfg b/emu-configs/defaults/retrodeck/reference_lists/supported_emulators.cfg new file mode 100644 index 00000000..17f51083 --- /dev/null +++ b/emu-configs/defaults/retrodeck/reference_lists/supported_emulators.cfg @@ -0,0 +1,15 @@ +cemu^/app/bin/Cemu-wrapper +citra^/var/data/ponzu/Citra/bin/citra-qt +dolphin^/app/bin/dolphin-emu +duckstation^/app/bin/duckstation-qt +mame^/app/bin/mame +melonds^/app/bin/melonds +pcsx2^/app/bin/pcsx2-qt +ppsspp^/app/bin/PPSSPPSDL +primehack^/app/bin/primehack-wrapper +retroarch^/app/bin/retroarch +rpcs3^/app/bin/rpcs3 +ryujinx^/app/bin/Ryujinx.sh +vita3k^/app/bin/Vita3K +xemu^/app/bin/xemu +yuzu^/var/data/ponzu/Yuzu/bin/yuzu diff --git a/emu-configs/dolphin/Dolphin.ini b/emu-configs/dolphin/Dolphin.ini index fb00bed7..092c4b60 100644 --- a/emu-configs/dolphin/Dolphin.ini +++ b/emu-configs/dolphin/Dolphin.ini @@ -42,12 +42,17 @@ Threads = True [General] ISOPath0 = RETRODECKHOMEDIR/roms/wii ISOPath1 = RETRODECKHOMEDIR/roms/gc -ISOPaths = 3 +ISOPaths = 2 WiiSDCardPath = RETRODECKHOMEDIR/saves/wii/dolphin/sd.raw WirelessMac = 00:17:ab:83:9b:d4 HotkeysRequireFocus = True RecursiveISOPaths = True -ISOPath2 = RETRODECKHOMEDIR/roms/wii +DumpPath = /var/data/dolphin-emu/Dump/ +LoadPath = /var/data/dolphin-emu/Load/ +NANDRootPath = /var/data/dolphin-emu/Wii/ +ResourcePackPath = /var/data/dolphin-emu/ResourcePacks/ +WFSPath = +WiiSDCardSyncFolder = /var/data/dolphin-emu/Load/WiiSDSync/ [NetPlay] TraversalChoice = direct [BluetoothPassthrough] diff --git a/emu-configs/duckstation/settings.ini b/emu-configs/duckstation/settings.ini index 0936a2e7..65ca7e7b 100644 --- a/emu-configs/duckstation/settings.ini +++ b/emu-configs/duckstation/settings.ini @@ -7,7 +7,7 @@ SyncToHostRefreshRate = false IncreaseTimerResolution = true InhibitScreensaver = true StartPaused = false -StartFullscreen = false +StartFullscreen = true PauseOnFocusLoss = true PauseOnMenu = true SaveStateOnExit = false diff --git a/emu-configs/gzdoom/gzdoom.sh b/emu-configs/gzdoom/gzdoom.sh index 620b809f..692d7cab 100644 --- a/emu-configs/gzdoom/gzdoom.sh +++ b/emu-configs/gzdoom/gzdoom.sh @@ -68,7 +68,7 @@ else # Check if the .doom file exists if [[ ! -e "$doom_file" ]]; then log e "doom file not found in \"$doom_file\"" - zenity --error --no-wrap \ + rd_zenity --error --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK" \ --text="File \"$doom_file\" not found. Quitting." @@ -85,7 +85,7 @@ else # If the file is not found, exit with an error if [[ -z "$found_file" ]]; then log "[ERROR] File not found in \"$line\"" - zenity --error --no-wrap \ + rd_zenity --error --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK" \ --text="File \"$doom_file\" not found. Quitting." diff --git a/emu-configs/rpcs3/config.yml b/emu-configs/rpcs3/config.yml index 2660b26e..53bb6fc5 100644 --- a/emu-configs/rpcs3/config.yml +++ b/emu-configs/rpcs3/config.yml @@ -20,7 +20,6 @@ Core: SPU loop detection: false Max SPURS Threads: 6 SPU Block Size: Mega - Accurate GETLLAR: false Accurate SPU DMA: false Accurate SPU Reservations: true Accurate Cache Line Stores: false @@ -104,6 +103,7 @@ Video: Strict Texture Flushing: false Multithreaded RSX: false Relaxed ZCULL Sync: false + Force Hardware MSAA Resolve: false 3D Display Mode: Disabled Debug Program Analyser: false Accurate ZCULL stats: true @@ -165,6 +165,7 @@ Audio: Convert to 16 bit: false Audio Format: Stereo Audio Formats: 0 + Audio Channel Layout: Automatic Audio Device: "@@@default@@@" Master Volume: 100 Enable Buffering: true @@ -186,6 +187,7 @@ Input/Output: Buzz emulated controller: "Null" Turntable emulated controller: "Null" GHLtar emulated controller: "Null" + GameTablet emulated controller: Disabled Pad handler mode: Single-threaded Keep pads connected: false Pad handler sleep (microseconds): 1000 @@ -200,6 +202,7 @@ System: Keyboard Type: English keyboard (US standard) Enter button assignment: Enter with cross Console time offset (s): 0 + System Name: RPCS3-960 PSID high: 0 PSID low: 0 HDD Model Name: "" diff --git a/emu-configs/vita3k/config.yml b/emu-configs/vita3k/config.yml index c1114ec2..5cca3861 100644 --- a/emu-configs/vita3k/config.yml +++ b/emu-configs/vita3k/config.yml @@ -25,10 +25,15 @@ screen-filter: Bilinear v-sync: true anisotropic-filtering: 1 texture-cache: true +async-pipeline-compilation: true show-compile-shaders: true hashless-texture-cache: false +import-textures: false +export-textures: false +export-as-png: true boot-apps-full-screen: true audio-backend: SDL +audio-volume: 100 ngs-enable: true sys-button: 1 sys-lang: 1 @@ -78,16 +83,20 @@ keyboard-button-psbutton: 19 keyboard-gui-toggle-gui: 10 keyboard-gui-fullscreen: 68 keyboard-gui-toggle-touch: 23 +keyboard-toggle-texture-replacement: 0 +keyboard-take-screenshot: 0 user-id: 00 user-auto-connect: true -dump-textures: false +user-lang: "" display-info-message: true show-welcome: false +check-for-updates: false asia-font-support: false shader-cache: true spirv-shader: false +fps-hack: true current-ime-lang: 4 -psn-status: 0 +psn-signed-in: 0 http-enable: true http-timeout-attempts: 50 http-timeout-sleep-ms: 100 diff --git a/functions/050_save_migration.sh b/functions/050_save_migration.sh index b75672b4..4eaf7dc0 100644 --- a/functions/050_save_migration.sh +++ b/functions/050_save_migration.sh @@ -6,8 +6,8 @@ save_migration() { then # ROMs on SD card roms_folder="$default_sd/retrodeck/roms" - 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 - ln -s $roms_folder $rdhome/roms + 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 + ln -s $roms_folder "$rdhome/roms" fi else # ROMs on Internal @@ -30,7 +30,7 @@ save_migration() { # Doing the dir prep as we don't know from which version we came dir_prep "$media_folder" "/var/config/ES-DE/downloaded_media" dir_prep "$themes_folder" "/var/config/ES-DE/themes" - create_dir $rdhome/logs #this was added later, maybe safe to remove in a few versions + create_dir "$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 cp -fv /app/retrodeck/es_settings.xml /var/config/ES-DE/settings/es_settings.xml @@ -39,13 +39,13 @@ save_migration() { # Perform save and state migration if needed # Moving PCSX2 Saves - 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/sstates/* "$rdhome/states/ps2/pcsx2" + mv -fv /var/config/PCSX2/memcards/* "$rdhome/saves/ps2/memcards" # Moving Citra saves from legacy location to 0.5.0b structure - mv -fv $rdhome/saves/Citra/* $rdhome/saves/n3ds/citra - rmdir $rdhome/saves/Citra # Old folder cleanup + mv -fv "$rdhome/saves/Citra/"* "$rdhome/saves/n3ds/citra" + rmdir "$rdhome/saves/Citra" # Old folder cleanup versionwheresaveschanged="0.4.5b" # Hardcoded break point between unsorted and sorted saves @@ -54,7 +54,7 @@ save_migration() { 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" - zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ + rd_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." @@ -71,9 +71,9 @@ save_migration() { current_dest_folder= gamestoskip= - tar -C $rdhome -czf $save_backup_file saves # Backup save directory for safety + tar -C "$rdhome" -czf $save_backup_file saves # Backup save directory for safety log i "Saves backed up to" $save_backup_file $migration_logfile - tar -C $rdhome -czf $state_backup_file states # Backup state directory for safety + tar -C "$rdhome" -czf $state_backup_file states # Backup state directory for safety log i "States backed up to" $state_backup_file $migration_logfile ( @@ -144,7 +144,7 @@ save_migration() { done ) | - zenity --progress \ + rd_zenity --progress \ --icon-name=net.retrodeck.retrodeck \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title="Processing Files" \ @@ -154,14 +154,14 @@ save_migration() { --auto-close if [[ $(cat $migration_logfile | grep "ERROR" | wc -l) -eq 0 ]]; then - zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ + rd_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 cat $migration_logfile | grep "ERROR" > "$rdhome/manual_sort_needed.log" - zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ + rd_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" diff --git a/functions/checks.sh b/functions/checks.sh index 2bd9af51..d0a60f73 100644 --- a/functions/checks.sh +++ b/functions/checks.sh @@ -51,7 +51,7 @@ check_for_version_update() { if [[ ! "$update_ignore" == "$online_version" ]]; then if [[ "$update_repo" == "RetroDECK" ]] && [[ $(sed -e 's/[\.a-z]//g' <<< $version) -le $(sed -e 's/[\.a-z]//g' <<< $online_version) ]]; then - # choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \ + # choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \ # --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ # --title "RetroDECK Update Available" \ # --text="There is a new version of RetroDECK on the stable release channel $online_version. Would you like to update to it?\n\n(depending on your internet speed this could takes several minutes).") @@ -65,7 +65,7 @@ check_for_version_update() { # ( # flatpak-spawn --host flatpak update --noninteractive -y net.retrodeck.retrodeck # ) | - # zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + # rd_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 Updater" \ # --text="Upgrade in process please wait (this could takes several minutes)." @@ -74,7 +74,7 @@ check_for_version_update() { # fi # TODO: add the logic to check and update the branch from the configuration file log i "Showing new version found dialog" - choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="OK" --extra-button="Ignore this version" \ + choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="OK" --extra-button="Ignore this version" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK - New Update Available" \ --text="There is a new version of RetroDECK available: $online_version.\nYou can easily update from the app store you have installed, examples: KDE Discover or Gnome Software.\n\nIf you would like to ignore this notification, click the \"Ignore this version\" button.") @@ -85,7 +85,7 @@ check_for_version_update() { fi elif [[ "$update_repo" == "RetroDECK-cooker" ]] && [[ ! $version == $online_version ]]; then log i "Showing update request dialog as \"$online_version\" was found and is greater then \"$version\"" - choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \ + choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK - New Cooker Version Available" \ --text="There is a more recent version of RetroDECK cooker.\nYou are running version $hard_version. The latest is $online_version.\n\nWould you like to update?\nIf you would like to ignore this notification, click the \"Ignore this version\" button.\n\nIf you would like to disable these notifications entirely: disable Online Update Checks in the Configurator.") @@ -141,7 +141,7 @@ check_for_version_update() { rm -rf "$temp_folder" # Cleanup old bundles to save space ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Updater" \ --text="RetroDECK is updating to the latest version, please wait." @@ -156,11 +156,13 @@ check_for_version_update() { } validate_input() { - while IFS="^" read -r input action + while IFS="^" read -r input action || [[ -n "$input" ]]; do - if [[ "$input" == "$1" ]]; then - eval "$action" - input_validated="true" + if [[ ! $input == "#"* ]] && [[ ! -z "$input" ]]; then + if [[ "$input" == "$1" ]]; then + eval "$action" + input_validated="true" + fi fi done < $input_validation } diff --git a/functions/compression.sh b/functions/compression.sh index bb33cd2e..4b0bcdd8 100644 --- a/functions/compression.sh +++ b/functions/compression.sh @@ -26,6 +26,28 @@ compress_game() { elif [[ "$1" == "rvz" ]]; then dolphin-tool convert -f rvz -b 131072 -c zstd -l 5 -i "$source_file" -o "$dest_file.rvz" fi + + if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested + if [[ -f "${file%.*}.$1" ]]; then + log i "Performing post-compression file cleanup" + 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 + log i "Removing file $file_path/$line" + rm -f "$file_path/$line" + done < <(printf '%s\n' "$cue_bin_files") + log i "Removing file $(realpath "$file")" + rm -f $(realpath "$file") + else + log i "Removing file $(realpath "$file")" + rm -f "$(realpath "$file")" + fi + else + log i "Compressed file ${file%.*}.$1 not found, skipping original file deletion" + fi + fi } find_compatible_compression_format() { @@ -66,7 +88,7 @@ validate_for_chd() { log i "Validating .cue associated .bin files" local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") log i "Associated bin files read:" - log i $(printf '%s\n' "$cue_bin_files") + log i "$(printf '%s\n' "$cue_bin_files")" if [[ ! -z "$cue_bin_files" ]]; then while IFS= read -r line do @@ -96,6 +118,71 @@ validate_for_chd() { fi } +find_compatible_games() { + # The function takes the following arguments, which alter what files are compressed: + # "everything" - Compresses all games found into their compatible formats + # "all" - Compresses a list of user-chosen files into their compatible formats + # "chd" or "zip" or "rvz" - Compresses a list of user-chosen files into the given format + + if [[ -f "$godot_compression_compatible_games" ]]; then + rm -f "$godot_compression_compatible_games" # Godot data transfer temp files + fi + touch "$godot_compression_compatible_games" + + compressable_games_list=() + all_compressable_games=() + games_to_compress=() + target_selection="$1" + + if [[ "$1" == "everything" ]]; then + local compression_format="all" + else + local compression_format="$1" + fi + + if [[ $compression_format == "all" ]]; then + local compressable_systems_list=$(cat $compression_targets | sed '/^$/d' | sed '/^\[/d') + else + local compressable_systems_list=$(sed -n '/\['"$compression_format"'\]/, /\[/{ /\['"$compression_format"'\]/! { /\[/! p } }' $compression_targets | sed '/^$/d') + fi + + while IFS= read -r system # Find and validate all games that are able to be compressed with this compression type + do + compression_candidates=$(find "$roms_folder/$system" -type f -not -iname "*.txt") + if [[ ! -z $compression_candidates ]]; then + while IFS= read -r game + do + local compatible_compression_format=$(find_compatible_compression_format "$game") + if [[ $compression_format == "chd" ]]; then + if [[ $compatible_compression_format == "chd" && ! -f "$(echo ${game%.*}.chd)" ]]; then + all_compressable_games=("${all_compressable_games[@]}" "$game") + compressable_games_list=("${compressable_games_list[@]}" "false" "${game#$roms_folder}" "$game") + echo "${game}"^"$compatible_compression_format" >> "$godot_compression_compatible_games" + fi + elif [[ $compression_format == "zip" ]]; then + if [[ $compatible_compression_format == "zip" && ! -f "$(echo ${game%.*}.zip)" ]]; then + all_compressable_games=("${all_compressable_games[@]}" "$game") + compressable_games_list=("${compressable_games_list[@]}" "false" "${game#$roms_folder}" "$game") + echo "${game}"^"$compatible_compression_format" >> "$godot_compression_compatible_games" + fi + elif [[ $compression_format == "rvz" ]]; then + if [[ $compatible_compression_format == "rvz" && ! -f "$(echo ${game%.*}.rvz)" ]]; then + all_compressable_games=("${all_compressable_games[@]}" "$game") + compressable_games_list=("${compressable_games_list[@]}" "false" "${game#$roms_folder}" "$game") + echo "${game}"^"$compatible_compression_format" >> "$godot_compression_compatible_games" + fi + elif [[ $compression_format == "all" ]]; then + if [[ ! $compatible_compression_format == "none" ]]; then + all_compressable_games=("${all_compressable_games[@]}" "$game") + compressable_games_list=("${compressable_games_list[@]}" "false" "${game#$roms_folder}" "$game") + echo "${game}"^"$compatible_compression_format" >> "$godot_compression_compatible_games" + fi + fi + done < <(printf '%s\n' "$compression_candidates") + fi + done < <(printf '%s\n' "$compressable_systems_list") +} + cli_compress_single_game() { # This function will compress a single file passed from the CLI arguments # USAGE: cli_compress_single_game $full_file_path @@ -109,26 +196,6 @@ cli_compress_single_game() { if [[ ! $compatible_compression_format == "none" ]]; then log i "$(basename "$file") can be compressed to $compatible_compression_format" compress_game "$compatible_compression_format" "$file" "$system" - if [[ $post_compression_cleanup == [yY] ]]; then # Remove file(s) if requested - if [[ -f "${file%.*}.$compatible_compression_format" ]]; then - if [[ $(basename "$file") == *".cue" ]]; then - local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") - local file_path=$(dirname "$(realpath "$file")") - while IFS= read -r line - do # Remove associated .bin files - log i "Removing original file "$file_path/$line"" - rm -f "$file_path/$line" - done < <(printf '%s\n' "$cue_bin_files") # Remove original .cue file - log i "Removing original file $(basename "$file")" - rm -f "$file" - else - log i "Removing original file $(basename "$file")" - rm -f "$file" - fi - else - log w "Compressed version of $(basename "$file") not found, skipping deletion." - fi - fi else log w "$(basename "$file") does not have any compatible compression formats." fi @@ -171,26 +238,6 @@ cli_compress_all_games() { if [[ ! "$compatible_compression_format" == "none" ]]; then log i "$(basename "$file") can be compressed to $compatible_compression_format" compress_game "$compatible_compression_format" "$file" "$system" - if [[ $post_compression_cleanup == [yY] ]]; then # Remove file(s) if requested - if [[ -f "${file%.*}.$compatible_compression_format" ]]; then - 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 # Remove associated .bin files - log i "Removing original file "$file_path/$line"" - rm -f "$file_path/$line" - done < <(printf '%s\n' "$cue_bin_files") # Remove original .cue file - log i "Removing original file "$file"" - rm -f $(realpath "$file") - else - log i "Removing original file "$file"" - rm -f $(realpath "$file") - fi - else - log w "Compressed version of $(basename "$file") not found, skipping deletion." - fi - fi else log w "No compatible compression format found for $(basename "$file")" fi diff --git a/functions/configurator_functions.sh b/functions/configurator_functions.sh new file mode 100644 index 00000000..768215b8 --- /dev/null +++ b/functions/configurator_functions.sh @@ -0,0 +1,89 @@ +#!/bin/bash + +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 + # There is a "basic" and "expert" mode which outputs different levels of data + # USAGE: check_bios_files "mode" + + if [[ -f "$godot_bios_files_checked" ]]; then + rm -f "$godot_bios_files_checked" # Godot data transfer temp files + fi + touch "$godot_bios_files_checked" + + while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc || [[ -n "$bios_file" ]]; + do + if [[ ! $bios_file == "#"* ]] && [[ ! -z "$bios_file" ]]; then + 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 + if [[ "$1" == "basic" ]]; then + 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 + else + bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc" "$bios_subdir" "$bios_hash") + echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc"^"$bios_subdir"^"$bios_hash" >> "$godot_bios_files_checked" # Godot data transfer temp file + fi + fi + done < $bios_checklist +} + +find_empty_rom_folders() { + # This function will build an array of all the system subfolders in $roms_folder which are either empty or contain only systeminfo.txt for easy removal + + if [[ -f "$godot_empty_roms_folders" ]]; then + rm -f "$godot_empty_roms_folders" # Godot data transfer temp files + fi + touch "$godot_empty_roms_folders" + + empty_rom_folders_list=() + all_empty_folders=() + all_helper_files=() + + while IFS='^' read -r file dest || [[ -n "$file" ]]; + do + if [[ ! "$file" == "#"* ]] && [[ ! -z "$file" ]]; then + all_helper_files=("${all_helper_files[@]}" "$file") + fi + done < "$helper_files_list" + + for system in $(find "$roms_folder" -mindepth 1 -maxdepth 1 -type d -printf '%f\n') + do + local dir="$roms_folder/$system" + local files=$(ls -A1 "$dir") + local count=$(ls -A "$dir" | wc -l) + + if [[ $count -eq 0 ]]; then + # Directory is empty + empty_rom_folders_list=("${empty_rom_folders_list[@]}" "false" "$(realpath $dir)") + all_empty_folders=("${all_empty_folders[@]}" "$(realpath $dir)") + echo "$(realpath $dir)" >> "$godot_empty_roms_folders" # Godot data transfer temp file + elif [[ $count -eq 1 ]] && [[ "$(basename "${files[0]}")" == "systeminfo.txt" ]]; then + # Directory contains only systeminfo.txt + empty_rom_folders_list=("${empty_rom_folders_list[@]}" "false" "$(realpath $dir)") + all_empty_folders=("${all_empty_folders[@]}" "$(realpath $dir)") + echo "$(realpath $dir)" >> "$godot_empty_roms_folders" # Godot data transfer temp file + elif [[ $count -eq 2 ]] && [[ "$files" =~ "systeminfo.txt" ]]; then + # Directory contains 2 files, one of which is "systeminfo.txt" + for helper_file in ${all_helper_files[@]} # Compare helper file list to dir file list + do + if [[ "$files" =~ "$helper_file" ]]; then + contains_helper_file="true" # Helper file was found + break + fi + done + if [[ "$contains_helper_file" == "true" ]]; then + # Directory contains only systeminfo.txt and a helper file + empty_rom_folders_list=("${empty_rom_folders_list[@]}" "false" "$(realpath $dir)") + all_empty_folders=("${all_empty_folders[@]}" "$(realpath $dir)") + echo "$(realpath $dir)" >> "$godot_empty_roms_folders" # Godot data transfer temp file + fi + fi + done +} diff --git a/functions/dialogs.sh b/functions/dialogs.sh index 3772c7e9..613be8d2 100644 --- a/functions/dialogs.sh +++ b/functions/dialogs.sh @@ -1,7 +1,5 @@ #!/bin/bash -source /app/libexec/functions.sh - # Dialog colors purple="#a864fc" blue="#6fbfff" @@ -10,7 +8,7 @@ debug_dialog() { # This function is for displaying commands run by the Configurator without actually running them # USAGE: debug_dialog "command" - zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ + rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - Debug Dialog" \ --text="$1" @@ -19,7 +17,7 @@ debug_dialog() { configurator_process_complete_dialog() { # This dialog shows when a process is complete. # USAGE: configurator_process_complete_dialog "process text" - zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Quit" --extra-button="OK" \ + rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Quit" --extra-button="OK" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - Process Complete" \ --text="The process of $1 is now complete.\n\nYou may need to quit and restart RetroDECK for your changes to take effect\n\nClick OK to return to the Main Menu or Quit to quit RetroDECK." @@ -35,7 +33,7 @@ configurator_generic_dialog() { # This dialog is for showing temporary messages before another process happens. # USAGE: configurator_generic_dialog "title text" "info text" log i "Showing a configurator_generic_dialog" - zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ + rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "$1" \ --text="$2" @@ -45,7 +43,7 @@ configurator_generic_question_dialog() { # This dialog provides a generic dialog for getting a response from a user. # USAGE: $(configurator_generic_question_dialog "title text" "action text") # This function will return a "true" if the user clicks "Yes", and "false" if they click "No". - choice=$(zenity --title "RetroDECK - $1" --question --no-wrap --cancel-label="No" --ok-label="Yes" \ + choice=$(rd_zenity --title "RetroDECK - $1" --question --no-wrap --cancel-label="No" --ok-label="Yes" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --text="$2") if [[ $? == "0" ]]; then @@ -59,7 +57,7 @@ configurator_destination_choice_dialog() { # This dialog is for making things easy for new users to move files to common locations. Gives the options for "Internal", "SD Card" and "Custom" locations. # USAGE: $(configurator_destination_choice_dialog "folder being moved" "action text") # This function returns one of the values: "Back" "Internal Storage" "SD Card" "Custom Location" - choice=$(zenity --title "RetroDECK Configurator Utility - Moving $1 folder" --info --no-wrap --ok-label="Back" --extra-button="Internal Storage" --extra-button="SD Card" --extra-button="Custom Location" \ + choice=$(rd_zenity --title "RetroDECK Configurator Utility - Moving $1 folder" --info --no-wrap --ok-label="Back" --extra-button="Internal Storage" --extra-button="SD Card" --extra-button="Custom Location" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --text="$2") @@ -75,7 +73,7 @@ configurator_reset_confirmation_dialog() { # This dialog provides a confirmation for any reset functions, before the reset is actually performed. # USAGE: $(configurator_reset_confirmation_dialog "emulator being reset" "action text") # This function will return a "true" if the user clicks Confirm, and "false" if they click Cancel. - choice=$(zenity --title "RetroDECK Configurator Utility - Reset $1" --question --no-wrap --cancel-label="Cancel" --ok-label="Confirm" \ + choice=$(rd_zenity --title "RetroDECK Configurator Utility - Reset $1" --question --no-wrap --cancel-label="Cancel" --ok-label="Confirm" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --text="$2") if [[ $? == "0" ]]; then @@ -135,7 +133,7 @@ configurator_move_folder_dialog() { configurator_generic_dialog "RetroDECK Configurator - Move Folder" "The moving process was not completed, please try again." fi else # If there isn't enough space in the picked destination - zenity --icon-name=net.retrodeck.retrodeck --error --no-wrap \ + rd_zenity --icon-name=net.retrodeck.retrodeck --error --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - Move Directories" \ --text="The destination directory you have selected does not have enough free space for the files you are trying to move.\n\nPlease select a new destination or free up some space." @@ -172,7 +170,7 @@ changelog_dialog() { if [[ "$1" == "all" ]]; then xml sel -t -m "//release" -v "concat('RetroDECK version: ', @version)" -n -v "description" -n $rd_appdata | awk '{$1=$1;print}' | sed -e '/./b' -e :n -e 'N;s/\n$//;tn' > "/var/config/retrodeck/changelog.txt" - zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \ + rd_zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Changelogs" \ --filename="/var/config/retrodeck/changelog.txt" @@ -181,7 +179,7 @@ changelog_dialog() { echo -e "In RetroDECK version $1, the following changes were made:\n$version_changelog" > "/var/config/retrodeck/changelog-partial.txt" 2>/dev/null - zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \ + rd_zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Changelogs" \ --filename="/var/config/retrodeck/changelog-partial.txt" @@ -192,7 +190,7 @@ get_cheevos_token_dialog() { # This function will return a RetroAchvievements token from a valid username and password, will return "login failed" otherwise # USAGE: get_cheevos_token_dialog - local cheevos_info=$(zenity --forms --title="Cheevos" \ + local cheevos_info=$(rd_zenity --forms --title="Cheevos" \ --text="Username and password." \ --separator="^" \ --add-entry="Username" \ @@ -219,7 +217,7 @@ desktop_mode_warning() { if [[ $(check_desktop_mode) == "true" && $desktop_mode_warning == "true" ]]; then local message='You appear to be running RetroDECK in the Steam Deck'\''s Desktop mode!\n\nSome functions of RetroDECK may not work properly in Desktop mode, such as the Steam Deck'\''s normal controls.\n\nRetroDECK is best enjoyed in Game mode!\n\nDo you still want to proceed?' log i "Showing message:\n$message" - choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Never show this again" \ + choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Never show this again" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Desktop Mode Warning" \ --text="$message") @@ -247,7 +245,7 @@ low_space_warning() { if [[ "$used_percent" -ge 90 && -d "$HOME/retrodeck" ]]; then # If there is any RetroDECK data on the main drive to move local message='Your main drive is over 90% full!\n\nIf your drive fills completely this can lead to data loss or system crash.\n\nPlease consider moving some RetroDECK folders to other storage locations using the Configurator.' log i "Showing message:\n$message" - choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="OK" --extra-button="Never show this again" \ + choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="OK" --extra-button="Never show this again" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Low Space Warning" \ --text="$message") diff --git a/functions/framework.sh b/functions/framework.sh index 92f3b32e..08e736f3 100644 --- a/functions/framework.sh +++ b/functions/framework.sh @@ -410,47 +410,44 @@ deploy_single_patch() { cp -fv "$1" "$3" # Create a copy of the original file to be patched -while IFS="^" read -r action current_section setting_name setting_value system_name +while IFS="^" read -r action current_section setting_name setting_value system_name || [[ -n "$action" ]]; do + if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then + case $action in - case $action in + "disable_file" ) + eval disable_file "$setting_name" + ;; - "disable_file" ) - eval disable_file "$setting_name" - ;; + "enable_file" ) + eval enable_file "$setting_name" + ;; - "enable_file" ) - eval enable_file "$setting_name" - ;; + "add_setting_line" ) + add_setting_line "$3" "$setting_name" "$system_name" "$current_section" + ;; - "add_setting_line" ) - add_setting_line "$3" "$setting_name" "$system_name" "$current_section" - ;; + "disable_setting" ) + disable_setting "$3" "$setting_name" "$system_name" "$current_section" + ;; - "disable_setting" ) - disable_setting "$3" "$setting_name" "$system_name" "$current_section" - ;; + "enable_setting" ) + enable_setting "$3" "$setting_name" "$system_name" "$current_section" + ;; - "enable_setting" ) - enable_setting "$3" "$setting_name" "$system_name" "$current_section" - ;; + "change" ) + if [[ "$setting_value" = \$* ]]; then # If patch setting value is a reference to an internal variable name + eval setting_value="$setting_value" + fi + set_setting_value "$3" "$setting_name" "$setting_value" "$system_name" "$current_section" + ;; - "change" ) - if [[ "$setting_value" = \$* ]]; then # If patch setting value is a reference to an internal variable name - eval setting_value="$setting_value" - fi - set_setting_value "$3" "$setting_name" "$setting_value" "$system_name" "$current_section" - ;; + * ) + log e "Config line malformed: $action" + ;; - *"#"* ) - # Comment line in patch file - ;; - - * ) - echo "Config line malformed: $action" - ;; - - esac + esac + fi done < "$2" } @@ -461,60 +458,58 @@ deploy_multi_patch() { # Patch file format should be as follows, with optional entries in (). Optional settings can be left empty, but must still have ^ dividers: # $action^($current_section)^$setting_name^$setting_value^$system_name^($config file) -while IFS="^" read -r action current_section setting_name setting_value system_name config_file +while IFS="^" read -r action current_section setting_name setting_value system_name config_file || [[ -n "$action" ]]; do - case $action in + if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then + case $action in - "disable_file" ) - if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name - eval config_file="$config_file" - fi - disable_file "$config_file" - ;; + "disable_file" ) + if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name + eval config_file="$config_file" + fi + disable_file "$config_file" + ;; - "enable_file" ) - if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name - eval config_file="$config_file" - fi - enable_file "$config_file" - ;; + "enable_file" ) + if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name + eval config_file="$config_file" + fi + enable_file "$config_file" + ;; - "add_setting_line" ) - if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name - eval config_file="$config_file" - fi - add_setting_line "$config_file" "$setting_name" "$system_name" "$current_section" - ;; + "add_setting_line" ) + if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name + eval config_file="$config_file" + fi + add_setting_line "$config_file" "$setting_name" "$system_name" "$current_section" + ;; - "disable_setting" ) - if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name - eval config_file="$config_file" - fi - disable_setting "$config_file" "$setting_name" "$system_name" "$current_section" - ;; + "disable_setting" ) + if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name + eval config_file="$config_file" + fi + disable_setting "$config_file" "$setting_name" "$system_name" "$current_section" + ;; - "enable_setting" ) - if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name - eval config_file="$config_file" - fi - enable_setting "$config_file" "$setting_name" "$system_name" "$current_section" - ;; + "enable_setting" ) + if [[ "$config_file" = \$* ]]; then # If patch setting value is a reference to an internal variable name + eval config_file="$config_file" + fi + enable_setting "$config_file" "$setting_name" "$system_name" "$current_section" + ;; - "change" ) - if [[ "$setting_value" = \$* ]]; then # If patch setting value is a reference to an internal variable name - eval setting_value="$setting_value" - fi - set_setting_value "$config_file" "$setting_name" "$setting_value" "$system_name" "$current_section" - ;; + "change" ) + if [[ "$setting_value" = \$* ]]; then # If patch setting value is a reference to an internal variable name + eval setting_value="$setting_value" + fi + set_setting_value "$config_file" "$setting_name" "$setting_value" "$system_name" "$current_section" + ;; - *"#"* ) - # Comment line in patch file - ;; + * ) + log e "Config line malformed: $action" + ;; - * ) - echo "Config line malformed: $action" - ;; - - esac + esac + fi done < "$1" } diff --git a/functions/global.sh b/functions/global.sh index 704d7f9f..52db4426 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -7,12 +7,13 @@ source /app/libexec/checks.sh source /app/libexec/compression.sh source /app/libexec/dialogs.sh source /app/libexec/logger.sh -source /app/libexec/functions.sh +source /app/libexec/other_functions.sh source /app/libexec/multi_user.sh source /app/libexec/framework.sh source /app/libexec/post_update.sh source /app/libexec/prepare_component.sh source /app/libexec/presets.sh +source /app/libexec/configurator_functions.sh # Static variables rd_conf="/var/config/retrodeck/retrodeck.cfg" # RetroDECK config file path @@ -52,6 +53,9 @@ pretty_system_names_reference_list="$emuconfigs/defaults/retrodeck/reference_lis # Godot data transfer temp files godot_bios_files_checked="/var/config/retrodeck/godot/godot_bios_files_checked.tmp" +godot_current_preset_settings="/var/config/retrodeck/godot/godot_current_preset_settings.tmp" +godot_compression_compatible_games="/var/config/retrodeck/godot/godot_compression_compatible_games.tmp" +godot_empty_roms_folders="/var/config/retrodeck/godot/godot_empty_roms_folders.tmp" # Config files for emulators with single config files @@ -114,8 +118,7 @@ rpcs3vfsconf="/var/config/rpcs3/vfs.yml" # Vita3k config files -vita3kconf="/var/data/Vita3K/config.yml" -vita3kusrconfdir="$bios_folder/Vita3K/Vita3K" +vita3kconf="/var/config/Vita3K/config.yml" # MAME-SA config files @@ -131,6 +134,11 @@ if [[ ! -d "$rd_logs_folder/ES-DE" ]]; then dir_prep "$rd_logs_folder/ES-DE" "$es_source_logs" fi +# Initialize location of Godot temp data files, if it doesn't exist +if [[ ! -d "/var/config/retrodeck/godot" ]]; then + create_dir "/var/config/retrodeck/godot" +fi + # 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 mv "$HOME/retrodeck/.lock" $lockfile @@ -191,7 +199,6 @@ else fi conf_read - #tmplog_merger # This function is tempry(?) removed # Verify rdhome is where it is supposed to be. if [[ ! -d "$rdhome" ]]; then diff --git a/functions/logger.sh b/functions/logger.sh index d37dafb6..9c2ea6c3 100755 --- a/functions/logger.sh +++ b/functions/logger.sh @@ -86,11 +86,11 @@ log() { esac # Display the message in the terminal - echo -e "$colored_message" + echo -e "$colored_message" >&2 # Write the log message to the log file if [ ! -f "$logfile" ]; then - echo "$timestamp [WARN] Log file not found in \"$logfile\", creating it" + echo "$timestamp [WARN] Log file not found in \"$logfile\", creating it" >&2 touch "$logfile" fi echo "$log_message" >> "$logfile" diff --git a/functions/multi_user.sh b/functions/multi_user.sh index 10fced39..2e015cc4 100644 --- a/functions/multi_user.sh +++ b/functions/multi_user.sh @@ -2,7 +2,7 @@ multi_user_set_default_dialog() { chosen_user="$1" - choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="No and don't ask again" \ + choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="No and don't ask again" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Default User" \ --text="Would you like to set $chosen_user as the default user?\n\nIf the current user cannot be determined from the system, the default will be used.\nThis normally only happens in Desktop Mode.\n\nIf you would like to be asked which user is playing every time, click \"No and don't ask again\"") @@ -23,7 +23,7 @@ do full_userlist=("${full_userlist[@]}" "$user") done < <(ls -1 "$multi_user_data_folder") -chosen_user=$(zenity \ +chosen_user=$(rd_zenity \ --list --width=1200 --height=720 \ --ok-label="Select User" \ --text="Choose the current user:" \ @@ -65,7 +65,7 @@ multi_user_disable_multi_user_mode() { full_userlist=("${full_userlist[@]}" "$user") done < <(ls -1 "$multi_user_data_folder") - single_user=$(zenity \ + single_user=$(rd_zenity \ --list --width=1200 --height=720 \ --ok-label="Select User" \ --text="Choose the current user:" \ @@ -125,7 +125,7 @@ multi_user_determine_current_user() { multi_user_setup_new_user else # If running in Desktop mode for the first time configurator_generic_dialog "RetroDECK Multi-User Mode" "The current user could not be determined from the system and there is no existing userlist.\n\nPlease enter the Steam account username (not profile name) into the next dialog, or run RetroDECK in game mode." - if zenity --entry \ + if rd_zenity --entry \ --title="Specify Steam username" \ --text="Enter Steam username:" then # User clicked "OK" @@ -149,7 +149,7 @@ multi_user_determine_current_user() { multi_user_return_to_single_user() { single_user="$1" - echo "Returning to single-user mode for $single_user" + log i "Returning to single-user mode for $single_user" unlink "$saves_folder" unlink "$states_folder" unlink "$rd_conf" @@ -182,7 +182,7 @@ multi_user_return_to_single_user() { multi_user_setup_new_user() { # TODO: RPCS3 one-offs - echo "Setting up new user" + log i "Setting up new user" unlink "$saves_folder" unlink "$states_folder" dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder" @@ -220,7 +220,7 @@ multi_user_setup_new_user() { } multi_user_link_current_user_files() { - echo "Linking existing user" + log i "Linking existing user" ln -sfT "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder" ln -sfT "$multi_user_data_folder/$SteamAppUser/states" "$states_folder" ln -sfT "$multi_user_data_folder/$SteamAppUser/config/retrodeck/retrodeck.cfg" "$rd_conf" diff --git a/functions/functions.sh b/functions/other_functions.sh similarity index 87% rename from functions/functions.sh rename to functions/other_functions.sh index b8ea9953..dd56c244 100644 --- a/functions/functions.sh +++ b/functions/other_functions.sh @@ -8,10 +8,10 @@ directory_browse() { while [ $path_selected == false ] do - local target="$(zenity --file-selection --title="Choose $1" --directory)" + local target="$(rd_zenity --file-selection --title="Choose $1" --directory)" if [ ! -z "$target" ] #yes then - zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ + rd_zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ --text="Directory $target chosen, is this correct?" if [ $? == 0 ] then @@ -20,7 +20,7 @@ directory_browse() { break fi else - zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ + rd_zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ --text="No directory selected. Do you want to exit the selection process?" if [ $? == 0 ] then @@ -38,10 +38,10 @@ file_browse() { while [ $file_selected == false ] do - local target="$(zenity --file-selection --title="Choose $1")" + local target="$(rd_zenity --file-selection --title="Choose $1")" if [ ! -z "$target" ] #yes then - zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ + rd_zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ --text="File $target chosen, is this correct?" if [ $? == 0 ] then @@ -50,7 +50,7 @@ file_browse() { break fi else - zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ + rd_zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \ --text="No file selected. Do you want to exit the selection process?" if [ $? == 0 ] then @@ -89,13 +89,13 @@ move() { rsync -a --remove-source-files --ignore-existing --mkpath "$source_dir" "$dest_dir" # Copy files but don't overwrite conflicts find "$source_dir" -type d -empty -delete # Cleanup empty folders that were left behind ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Configurator Utility - Move in Progress" \ --text="Moving directory $(basename "$1") to new location of $2, please wait." if [[ -d "$source_dir" ]]; then # Some conflicting files remain - zenity --icon-name=net.retrodeck.retrodeck --error --no-wrap \ + rd_zenity --icon-name=net.retrodeck.retrodeck --error --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - Move Directories" \ --text="There were some conflicting files that were not moved.\n\nAll files that could be moved are in the new location,\nany files that already existed at the new location have not been moved and will need to be handled manually." @@ -133,7 +133,7 @@ download_file() { ( wget "$1" -O "$2" -q ) | - zenity --progress \ + rd_zenity --progress \ --title="Downloading File" \ --text="Downloading $3..." \ --pulsate \ @@ -153,7 +153,6 @@ update_rd_conf() { # STAGE 2: To handle presets sections that use duplicate setting names - mv -f $rd_conf $rd_conf_backup # Backup config file agiain before update but after Stage 1 expansion generate_single_patch $rd_defaults $rd_conf_backup $rd_update_patch retrodeck # Create a patch file for differences between defaults and current user settings sed -i '/change^^version/d' $rd_update_patch # Remove version line from temporary patch file deploy_single_patch $rd_defaults $rd_update_patch $rd_conf # Re-apply user settings to defaults file @@ -286,34 +285,9 @@ dir_prep() { log i "$symlink is now $real" } -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 - # There is a "basic" and "expert" mode which outputs different levels of data - # USAGE: check_bios_files "mode" - - 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 - if [[ "$1" == "basic" ]]; then - 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 - else - bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc" "$bios_subdir" "$bios_hash") - echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc"^"$bios_subdir"^"$bios_hash" >> "$godot_bios_files_checked" # Godot data transfer temp file - fi - done < $bios_checklist +rd_zenity() { + # This function replaces the standard 'zenity' command and filters out annoying GTK errors on Steam Deck + zenity 2> >(grep -v 'Gtk' >&2) "$@" } update_rpcs3_firmware() { @@ -343,7 +317,7 @@ make_name_pretty() { if [[ ! -z "$system" ]]; then IFS='^' read -r internal_name pretty_name < <(echo "$system") else - pretty_name="$system" + pretty_name="$1" fi echo "$pretty_name" } @@ -353,10 +327,10 @@ finit_browse() { path_selected=false while [ $path_selected == false ] do - local target="$(zenity --file-selection --title="Choose RetroDECK data directory location" --directory)" + local target="$(rd_zenity --file-selection --title="Choose RetroDECK data directory location" --directory)" if [[ ! -z "$target" ]]; then if [[ -w "$target" ]]; then - zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" \ + rd_zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" \ --cancel-label="No" \ --ok-label "Yes" \ --text="Your RetroDECK data folder will be:\n\n$target/retrodeck\n\nis that ok?" @@ -366,7 +340,7 @@ do echo "$target/retrodeck" break else - zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" --text="Do you want to quit?" + rd_zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" --text="Do you want to quit?" if [ $? == 0 ] # yes, quit then quit_retrodeck @@ -374,7 +348,7 @@ do fi fi else - zenity --error --no-wrap \ + rd_zenity --error --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK" \ --ok-label "Quit" \ @@ -387,13 +361,15 @@ done finit_user_options_dialog() { finit_available_options=() - while IFS="^" read -r enabled option_name option_desc option_tag + while IFS="^" read -r enabled option_name option_desc option_tag || [[ -n "$enabled" ]]; do - finit_available_options=("${finit_available_options[@]}" "$enabled" "$option_name" "$option_desc" "$option_tag") + if [[ ! $enabled == "#"* ]] && [[ ! -z "$enabled" ]]; then + finit_available_options=("${finit_available_options[@]}" "$enabled" "$option_name" "$option_desc" "$option_tag") + fi done < $finit_options_list - local choices=$(zenity \ + local choices=$(rd_zenity \ --list --width=1200 --height=720 \ --checklist --hide-column=4 --ok-label="Confirm Selections" --extra-button="Enable All" \ --separator=" " --print-column=4 \ @@ -437,7 +413,7 @@ finit() { if [ ! -d "$sdcard" ] # SD Card path is not existing then log e "SD card not found" - zenity --error --no-wrap \ + rd_zenity --error --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK" \ --ok-label "Browse" \ @@ -450,7 +426,7 @@ finit() { elif [ ! -w "$sdcard" ] #SD card found but not writable then log e "SD card found but not writable" - zenity --error --no-wrap \ + rd_zenity --error --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK" \ --ok-label "Quit" \ @@ -465,7 +441,7 @@ finit() { "Custom Location" ) log i "Custom Location selected" - zenity --info --no-wrap \ + rd_zenity --info --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK" \ --ok-label "Browse" \ @@ -479,6 +455,8 @@ finit() { esac + log i "\"retrodeck\" folder will be located in \"$rdhome\"" + prepare_component "reset" "retrodeck" # Parse the [paths] section of retrodeck.cfg and set the value of / create all needed folders conf_write # Write the new values to retrodeck.cfg @@ -494,7 +472,7 @@ finit() { 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 \ + rd_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." @@ -522,7 +500,7 @@ finit() { fi ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Initialization" \ --text="RetroDECK is finishing the initial setup process, please wait." @@ -585,13 +563,12 @@ deploy_helper_files() { # This script will distribute helper documentation files throughout the filesystem according to the $helper_files_list # USAGE: deploy_helper_files - while IFS='^' read -r file dest + while IFS='^' read -r file dest || [[ -n "$file" ]]; do if [[ ! "$file" == "#"* ]] && [[ ! -z "$file" ]]; then eval current_dest="$dest" cp -f "$helper_files_folder/$file" "$current_dest/$file" fi - done < "$helper_files_list" } @@ -604,13 +581,15 @@ easter_eggs() { current_day=$(date +"%0m%0d") # Read the current date in a format that can be calculated in ranges current_time=$(date +"%0H%0M") # Read the current time in a format that can be calculated in ranges if [[ ! -z $(cat $easter_egg_checklist) ]]; then - while IFS="^" read -r start_date end_date start_time end_time splash_file # Read Easter Egg checklist file and separate values + while IFS="^" read -r start_date end_date start_time end_time splash_file || [[ -n "$start_date" ]]; # Read Easter Egg checklist file and separate values do - if [[ "$((10#$current_day))" -ge "$((10#$start_date))" && "$((10#$current_day))" -le "$((10#$end_date))" && "$((10#$current_time))" -ge "$((10#$start_time))" && "$((10#$current_time))" -le "$((10#$end_time))" ]]; then # If current line specified date/time matches current date/time, set $splash_file to be deployed - new_splash_file="$splashscreen_dir/$splash_file" - break - else # When there are no matches, the default splash screen is set to deploy - new_splash_file="$default_splash_file" + if [[ ! $start_date == "#"* ]] && [[ ! -z "$start_date" ]]; then + if [[ "$((10#$current_day))" -ge "$((10#$start_date))" && "$((10#$current_day))" -le "$((10#$end_date))" && "$((10#$current_time))" -ge "$((10#$start_time))" && "$((10#$current_time))" -le "$((10#$end_time))" ]]; then # If current line specified date/time matches current date/time, set $splash_file to be deployed + new_splash_file="$splashscreen_dir/$splash_file" + break + else # When there are no matches, the default splash screen is set to deploy + new_splash_file="$default_splash_file" + fi fi done < $easter_egg_checklist else @@ -699,7 +678,7 @@ ponzu() { rm -rf "$rdhome/ponzu" } -ponzu_remove(){ +ponzu_remove() { # Call me with yuzu or citra and I will remove them @@ -739,7 +718,7 @@ branch_selector() { # Display branches in a Zenity list dialog selected_branch=$( - zenity --list \ + rd_zenity --list \ --icon-name=net.retrodeck.retrodeck \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Cooker Branch - Select Branch" \ @@ -749,7 +728,7 @@ branch_selector() { # Display warning message if [ $selected_branch ]; then - zenity --question --icon-name=net.retrodeck.retrodeck --no-wrap \ + rd_zenity --question --icon-name=net.retrodeck.retrodeck --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Cooker Branch - Switch Branch" \ --text="Are you sure you want to move to \"$selected_branch\" branch?" @@ -770,7 +749,7 @@ branch_selector() { flatpak-spawn --host flatpak install --user --bundle --noninteractive -y "$rdhome/RetroDECK_Updates/RetroDECK-cooker.flatpak" rm -rf "$rdhome/RetroDECK_Updates" # Cleanup old bundles to save space ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Updater" \ --text="RetroDECK is updating to the latest \"$selected_branch\" version, please wait." @@ -793,6 +772,22 @@ quit_retrodeck() { start_retrodeck() { easter_eggs # Check if today has a surprise splashscreen and load it if so ponzu + + # if steam sync is on do the magic + if [[ $steam_sync == "true" ]]; then + ( + python3 /app/libexec/steam-sync/steam-sync.py + ) | + zenity --progress \ + --title="Syncing with Steam" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --text="Syncing favorite games with Steam, please wait." \ + --percentage=25 \ + --pulsate \ + --auto-close \ + --auto-kill + fi + log i "Starting RetroDECK v$version" es-de } diff --git a/functions/post_update.sh b/functions/post_update.sh index 3dcc012b..c543cefb 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -304,7 +304,7 @@ post_update() { log i "In version 0.8.1b, the following changes were made that required config file updates/reset or other changes to the filesystem:" log i "- ES-DE files were moved inside the retrodeck folder, migrating to the new structure" log i "- Give the user the option to reset Ryujinx, which was not properly initialized in 0.8.0b" - + log d "ES-DE files were moved inside the retrodeck folder, migrating to the new structure" dir_prep "$rdhome/ES-DE/collections" "/var/config/ES-DE/collections" dir_prep "$rdhome/ES-DE/gamelists" "/var/config/ES-DE/gamelists" @@ -313,8 +313,7 @@ post_update() { set_setting_value "$es_settings" "UserThemeDirectory" "$rdhome/ES-DE/themes" "es_settings" mv -f "$rdhome/themes" "$rdhome/ES-DE/themes" && log d "Move of \"$rdhome/themes\" completed" mv -f "$rdhome/downloaded_media" "$rdhome/ES-DE/downloaded_media" && log d "Move of \"$rdhome/downloaded_media\" completed" - mv -f "$rdhome/gamelists/"* "$rdhome/ES-DE/gamelists" && log d "Move of \"$rdhome/gamelists/\" completed" - rm -rf "$rdhome/gamelists" + mv -f "$rdhome/gamelists/"* "$rdhome/ES-DE/gamelists" && log d "Move of \"$rdhome/gamelists/\" completed" && rm -rf "$rdhome/gamelists" log i "MAME-SA, migrating samples to the new exposed folder: from \"/var/data/mame/assets/samples\" to \"$bios_folder/mame-sa/samples\"" create_dir "$bios_folder/mame-sa/samples" @@ -339,6 +338,42 @@ post_update() { fi fi + if [[ $(check_version_is_older_than "0.8.2b") == "true" ]]; then + log i "Vita3K changed some paths, reflecting them: moving \"/var/data/Vita3K\" in \"/var/config/Vita3K\"" + move "/var/data/Vita3K" "/var/config/Vita3K" + log i "Moving ES-DE downloaded_media, gamelist, and themes from \"$rdhome\" to \"$rdhome/ES-DE\" due to a RetroDECK Framework bug" + move "$rdhome/themes" "$rdhome/ES-DE/themes" && log d "Move of \"$rdhome/themes\" completed" + move "$rdhome/downloaded_media" "$rdhome/ES-DE/downloaded_media" && log d "Move of \"$rdhome/downloaded_media\" completed" + move "$rdhome/gamelists" "$rdhome/ES-DE/gamelists" && log d "Move of \"$rdhome/gamelists/\" completed" + log i "Since in this version we moved to a PR build of Ryujinx we need to symlink it." + ln -sv $ryujinxconf "$(dirname $ryujinxconf)/PRConfig.json" + fi + + if [[ $(check_version_is_older_than "0.8.3b") == "true" ]]; then + # In version 0.8.3b, the following changes were made: + # - Recovery from a failed move of the themes, downloaded_media and gamelists folder to their new ES-DE locations. + if [[ !-d "$rdhome/ES-DE/themes" || ! -d "$rdhome/ES-DE/downloaded_media" || ! -d "$rdhome/ES-DE/gamelists" ]]; then + log i "Moving ES-DE downloaded_media, gamelist, and themes from \"$rdhome\" to \"$rdhome/ES-DE\" due to a RetroDECK Framework bug" + if [[ -d "$rdhome/themes" && ! -d "$rdhome/ES-DE/themes" ]]; then + move "$rdhome/themes" "$rdhome/ES-DE/themes" && log d "Move of \"$rdhome/themes\" completed" + else + log i "ES-DE themes appears to already have been migrated." + fi + if [[ -d "$rdhome/downloaded_media" && ! -d "$rdhome/ES-DE/downloaded_media" ]]; then + move "$rdhome/downloaded_media" "$rdhome/ES-DE/downloaded_media" && log d "Move of \"$rdhome/downloaded_media\" completed" + else + log i "ES-DE downloaded media appears to already have been migrated." + fi + if [[ -d "$rdhome/gamelists" && ! -d "$rdhome/ES-DE/gamelists" ]]; then + move "$rdhome/gamelists" "$rdhome/ES-DE/gamelists" && log d "Move of \"$rdhome/gamelists/\" completed" + else + log i "ES-DE gamelists appears to already have been migrated." + fi + else + log i "ES-DE dfolders appears to already have been migrated." + fi + fi + # if [[ $(check_version_is_older_than "0.9.0b") == "true" ]]; then # # Placeholder for version 0.9.0b # rm /var/config/emulationstation/.emulationstation # remving the old symlink to .emulationstation as it might be not needed anymore @@ -352,7 +387,10 @@ post_update() { # log AND ZENITY "Found Cemu keys.txt" in "/var/data/Cemu/keys.txt", for a better compatibility is better to move it into "$bios_folder/cemu/mlc/keys.txt, do you want to continue? # if yes: mv "/var/data/Cemu/keys.txt" "$bios_folder/cemu/mlc/keys.txt" # ln -s "$bios_folder/cemu/mlc/keys.txt" "/var/data/Cemu/keys.txt" <--- AND THIS SHOULD BE EVEN PUT IN THE PREPARATION SCRIPT - # fi + # fi + # TODO: is this true? + # log i "Since in this version we restored Ryujinx to a main buikd we don't need the symlink anymore." + # rm "$(dirname $ryujinxconf)/PRConfig.json" # fi # The following commands are run every time. @@ -372,7 +410,7 @@ post_update() { deploy_helper_files build_retrodeck_current_presets ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 - Upgrade Process" \ --width=400 --height=200 \ diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index ef7e768c..e402fbb7 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -12,16 +12,19 @@ prepare_component() { action="$1" component=$(echo "$2" | tr '[:upper:]' '[:lower:]') call_source="$3" + component_found="false" log d "Preparing component: \"$component\", action: \"$action\"" if [[ "$component" == "retrodeck" ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Update the paths of all folders in retrodeck.cfg and create them while read -r config_line; do local current_setting_name=$(get_setting_name "$config_line" "retrodeck") if [[ ! $current_setting_name =~ (rdhome|sdcard) ]]; then # Ignore these locations local current_setting_value=$(get_setting_value "$rd_conf" "$current_setting_name" "retrodeck" "paths") - declare -g "$current_setting_name=$rdhome/$(basename $current_setting_value)" + declare -g "$current_setting_name=$rdhome/${current_setting_value#*retrodeck/}" #removes everything until "retrodeck" and adds the actual retrodeck folder + log d "Setting: $current_setting_name=$current_setting_value" if [[ ! $current_setting_name == "logs_folder" ]]; then # Don't create a logs folder normally, we want to maintain the current files exactly to not lose early-install logs. create_dir "$rdhome/$(basename $current_setting_value)" else # Log folder-specific actions @@ -31,8 +34,8 @@ prepare_component() { fi fi done < <(grep -v '^\s*$' $rd_conf | awk '/^\[paths\]/{f=1;next} /^\[/{f=0} f') - create_dir "/var/config/retrodeck/godot" - + create_dir "/var/config/retrodeck/godot" # TODO: what is this for? Can we delete it or add it to the retrodeck.cfg so the folder will be created by the above script? + 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 @@ -49,9 +52,10 @@ prepare_component() { fi if [[ "$component" =~ ^(es-de|all)$ ]]; then # For use after ESDE-related folders are moved or a reset - log i "--------------------------------" - log i "Prepearing ES-DE" - log i "--------------------------------" + component_found="true" + log i "--------------------------------" + log i "Prepearing ES-DE" + log i "--------------------------------" if [[ "$action" == "reset" ]]; then rm -rf /var/config/ES-DE create_dir /var/config/ES-DE/settings @@ -77,9 +81,10 @@ prepare_component() { fi if [[ "$component" =~ ^(retroarch|all)$ ]]; then - log i "--------------------------------" - log i "Prepearing RetroArch" - log i "--------------------------------" + component_found="true" + log i "--------------------------------" + log i "Prepearing RetroArch" + log i "--------------------------------" if [[ "$action" == "reset" ]]; then # Run reset-only commands if [[ $multi_user_mode == "true" ]]; then # Multi-user actions create_dir -d "$multi_user_data_folder/$SteamAppUser/config/retroarch" @@ -120,7 +125,7 @@ prepare_component() { create_dir "$bios_folder/fbneo/cheats" create_dir "$bios_folder/fbneo/blend" dir_prep "$mods_folder/FBNeo" "$bios_folder/fbneo/patched" - + # PPSSPP log i "--------------------------------" log i "Prepearing PPSSPP_LIBRETRO" @@ -168,11 +173,11 @@ prepare_component() { set_setting_value "$ra_scummvm_conf" "themepath" "$mods_folder/RetroArch/ScummVM/theme" "libretro_scummvm" "scummvm" set_setting_value "$ra_scummvm_conf" "savepath" "$saves_folder/scummvm" "libretro_scummvm" "scummvm" set_setting_value "$ra_scummvm_conf" "browser_lastpath" "$roms_folder/scummvm" "libretro_scummvm" "scummvm" - + dir_prep "$texture_packs_folder/RetroArch-Mesen" "/var/config/retroarch/system/HdPacks" dir_prep "$texture_packs_folder/RetroArch-Mupen64Plus/cache" "/var/config/retroarch/system/Mupen64plus/cache" dir_prep "$texture_packs_folder/RetroArch-Mupen64Plus/hires_texture" "/var/config/retroarch/system/Mupen64plus/hires_texture" - + # Reset default preset settings set_setting_value "$rd_conf" "retroarch" "$(get_setting_value "$rd_defaults" "retroarch" "retrodeck" "cheevos")" "retrodeck" "cheevos" set_setting_value "$rd_conf" "retroarch" "$(get_setting_value "$rd_defaults" "retroarch" "retrodeck" "cheevos_hardcore")" "retrodeck" "cheevos_hardcore" @@ -211,6 +216,7 @@ prepare_component() { fi if [[ "$component" =~ ^(citra|citra-emu|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "------------------------" log i "Prepearing CITRA" @@ -244,7 +250,7 @@ prepare_component() { set_setting_value "$rd_conf" "citra" "$(get_setting_value "$rd_defaults" "citra" "retrodeck" "ask_to_exit")" "retrodeck" "ask_to_exit" fi if [[ "$action" == "postmove" ]]; then # Run only post-move commands - dir_prep "$rdhome/bios/citra/sysdata" "/var/data/citra-emu/sysdata" + dir_prep "$bios_folder/citra/sysdata" "/var/data/citra-emu/sysdata" dir_prep "$rdhome/logs/citra" "/var/data/citra-emu/log" dir_prep "$mods_folder/Citra" "/var/data/citra-emu/load/mods" dir_prep "$texture_packs_folder/Citra" "/var/data/citra-emu/load/textures" @@ -256,6 +262,7 @@ prepare_component() { fi if [[ "$component" =~ ^(cemu|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "----------------------" log i "Prepearing CEMU" @@ -283,6 +290,7 @@ prepare_component() { fi if [[ "$component" =~ ^(dolphin|dolphin-emu|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "----------------------" log i "Prepearing DOLPHIN" @@ -336,6 +344,7 @@ prepare_component() { fi if [[ "$component" =~ ^(duckstation|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "------------------------" log i "Prepearing DUCKSTATION" @@ -381,6 +390,7 @@ prepare_component() { fi if [[ "$component" =~ ^(melonds|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "----------------------" log i "Prepearing MELONDS" @@ -419,6 +429,7 @@ prepare_component() { fi if [[ "$component" =~ ^(pcsx2|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "----------------------" log i "Prepearing PCSX2" @@ -463,6 +474,7 @@ prepare_component() { fi if [[ "$component" =~ ^(pico8|pico-8|all)$ ]]; then + component_found="true" if [[ ("$action" == "reset") || ("$action" == "postmove") ]]; then dir_prep "$bios_folder/pico-8" "$HOME/.lexaloffle/pico-8" # Store binary and config files together. The .lexaloffle directory is a hard-coded location for the PICO-8 config file, cannot be changed dir_prep "$roms_folder/pico8" "$bios_folder/pico-8/carts" # Symlink default game location to RD roms for cleanliness (this location is overridden anyway by the --root_path launch argument anyway) @@ -473,6 +485,7 @@ prepare_component() { fi if [[ "$component" =~ ^(ppsspp|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "------------------------" log i "Prepearing PPSSPPSDL" @@ -501,6 +514,7 @@ prepare_component() { fi if [[ "$component" =~ ^(primehack|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "----------------------" log i "Prepearing Primehack" @@ -544,6 +558,7 @@ prepare_component() { fi if [[ "$component" =~ ^(rpcs3|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "------------------------" log i "Prepearing RPCS3" @@ -580,6 +595,7 @@ prepare_component() { fi if [[ "$component" =~ ^(ryujinx|all)$ ]]; then + component_found="true" # NOTE: for techincal reasons the system folder of Ryujinx IS NOT a sumlink of the bios/switch/keys as not only the keys are located there # When RetroDECK starts there is a "manage_ryujinx_keys" function that symlinks the keys only in Rryujinx/system. if [[ "$action" == "reset" ]]; then # Run reset-only commands @@ -612,6 +628,9 @@ prepare_component() { dir_prep "$saves_folder/switch/ryujinx/sdcard" "/var/config/Ryujinx/sdcard" dir_prep "$bios_folder/switch/firmware" "/var/config/Ryujinx/bis/system/Contents/registered" dir_prep "$bios_folder/switch/keys" "/var/config/Ryujinx/system" + # TODO: delete these two lines after Ryujinx is back to a proper build + log i "Since in this version we moved to a PR build of Ryujinx we need to symlink it." # TODO: deleteme later + ln -sv $ryujinxconf "$(dirname $ryujinxconf)/PRConfig.json" # TODO: deleteme later fi fi # if [[ "$action" == "reset" ]] || [[ "$action" == "postmove" ]]; then # Run commands that apply to both resets and moves @@ -624,6 +643,7 @@ prepare_component() { fi if [[ "$component" =~ ^(yuzu|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "----------------------" log i "Prepearing YUZU" @@ -677,6 +697,7 @@ prepare_component() { fi if [[ "$component" =~ ^(xemu|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "------------------------" log i "Prepearing XEMU" @@ -721,6 +742,7 @@ prepare_component() { fi if [[ "$component" =~ ^(vita3k|all)$ ]]; then + component_found="true" if [[ "$action" == "reset" ]]; then # Run reset-only commands log i "----------------------" log i "Prepearing Vita3K" @@ -729,22 +751,23 @@ prepare_component() { log d "Figure out what Vita3k needs for multi-user" 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" - create_dir "/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" + rm -rf "/var/config/Vita3K" + create_dir "/var/config/Vita3K" + cp -fvr "$emuconfigs/vita3k/config.yml" "$vita3kconf" # component config + cp -fvr "$emuconfigs/vita3k/ux0" "$bios_folder/Vita3K/" # User config + set_setting_value "$vita3kconf" "pref-path" "$bios_folder/Vita3K/" "vita3k" fi # Shared actions - dir_prep "$saves_folder/psvita/vita3k" "$bios_folder/Vita3K/Vita3K/ux0/user/00/savedata" # Multi-user safe? + dir_prep "$saves_folder/psvita/vita3k" "$bios_folder/Vita3K/ux0/user/00/savedata" # Multi-user safe? 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? - set_setting_value "$vita3kconf" "pref-path" "$rdhome/bios/Vita3K/Vita3K/" "vita3k" + dir_prep "$saves_folder/psvita/vita3k" "$bios_folder/Vita3K/ux0/user/00/savedata" # Multi-user safe? + set_setting_value "$vita3kconf" "pref-path" "$bios_folder/Vita3K/" "vita3k" fi fi if [[ "$component" =~ ^(mame|all)$ ]]; then + component_found="true" # TODO: do a proper script # This is just a placeholder script to test the emulator's flow log i "----------------------" @@ -814,6 +837,7 @@ prepare_component() { fi if [[ "$component" =~ ^(gzdoom|all)$ ]]; then + component_found="true" # TODO: do a proper script # This is just a placeholder script to test the emulator's flow log i "----------------------" @@ -824,7 +848,7 @@ prepare_component() { create_dir "/var/data/gzdoom/audio/midi" create_dir "/var/data/gzdoom/audio/fm_banks" create_dir "/var/data/gzdoom/audio/soundfonts" - create_dir "$rdhome/bios/gzdoom" + create_dir "$bios_folder/gzdoom" cp -fvr "$emuconfigs/gzdoom/gzdoom.ini" "/var/config/gzdoom" @@ -834,6 +858,7 @@ prepare_component() { fi if [[ "$component" =~ ^(steam_rom_manager|all)$ ]]; then + component_found="true" log i "----------------------" log i "Prepearing STEAM ROM MANAGER" log i "----------------------" diff --git a/functions/presets.sh b/functions/presets.sh index 19fcbcec..aac3c321 100644 --- a/functions/presets.sh +++ b/functions/presets.sh @@ -4,30 +4,9 @@ change_preset_dialog() { # This function will build a list of all systems compatible with a given preset, their current enable/disabled state and allow the user to change one or more # USAGE: change_preset_dialog "$preset" - local preset="$1" - pretty_preset_name=${preset//_/ } # Preset name prettification - pretty_preset_name=$(echo $pretty_preset_name | awk '{for(i=1;i<=NF;i++){$i=toupper(substr($i,1,1))substr($i,2)}}1') # Preset name prettification - local current_preset_settings=() - local current_enabled_systems=() - local current_disabled_systems=() - local changed_systems=() - local changed_presets=() - local section_results=$(sed -n '/\['"$preset"'\]/, /\[/{ /\['"$preset"'\]/! { /\[/! p } }' $rd_conf | sed '/^$/d') + build_preset_list_options "$1" - while IFS= read -r config_line - do - system_name=$(get_setting_name "$config_line" "retrodeck") - all_systems=("${all_systems[@]}" "$system_name") - system_value=$(get_setting_value "$rd_conf" "$system_name" "retrodeck" "$preset") - if [[ "$system_value" == "true" ]]; then - current_enabled_systems=("${current_enabled_systems[@]}" "$system_name") - elif [[ "$system_value" == "false" ]]; then - current_disabled_systems=("${current_disabled_systems[@]}" "$system_name") - fi - current_preset_settings=("${current_preset_settings[@]}" "$system_value" "$(make_name_pretty $system_name)" "$system_name") - done < <(printf '%s\n' "$section_results") - - choice=$(zenity \ + choice=$(rd_zenity \ --list --width=1200 --height=720 \ --checklist \ --separator="," \ @@ -42,7 +21,56 @@ change_preset_dialog() { if [[ ! -z $choice || "$rc" == 0 ]]; then ( - IFS="," read -ra choices <<< "$choice" + make_preset_changes + ) | + rd_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 Configurator Utility - Presets Configuration" \ + --text="Setting up your presets, please wait..." + else + log i "No preset choices made" + fi +} + +build_preset_list_options() { + # This function will build a list of all the systems available for a given preset + # The list will be generated into a Godot temp file and the variable $current_preset_settings + + if [[ -f "$godot_current_preset_settings" ]]; then + rm -f "$godot_current_preset_settings" # Godot data transfer temp files + fi + touch "$godot_current_preset_settings" + + preset="$1" + pretty_preset_name=${preset//_/ } # Preset name prettification + pretty_preset_name=$(echo $pretty_preset_name | awk '{for(i=1;i<=NF;i++){$i=toupper(substr($i,1,1))substr($i,2)}}1') # Preset name prettification + current_preset_settings=() + current_enabled_systems=() + current_disabled_systems=() + changed_systems=() + changed_presets=() + local section_results=$(sed -n '/\['"$preset"'\]/, /\[/{ /\['"$preset"'\]/! { /\[/! p } }' $rd_conf | sed '/^$/d') + + while IFS= read -r config_line + do + system_name=$(get_setting_name "$config_line" "retrodeck") + all_systems=("${all_systems[@]}" "$system_name") + system_value=$(get_setting_value "$rd_conf" "$system_name" "retrodeck" "$preset") + if [[ "$system_value" == "true" ]]; then + current_enabled_systems=("${current_enabled_systems[@]}" "$system_name") + elif [[ "$system_value" == "false" ]]; then + current_disabled_systems=("${current_disabled_systems[@]}" "$system_name") + fi + current_preset_settings=("${current_preset_settings[@]}" "$system_value" "$(make_name_pretty $system_name)" "$system_name") + echo "$system_value"^"$(make_name_pretty $system_name)"^"$system_name" >> "$godot_current_preset_settings" + done < <(printf '%s\n' "$section_results") +} + + +make_preset_changes() { + # This function will take an array $choices, which contains the names of systems that have been enabled for this preset and enable them in the backend + + IFS="," read -ra choices <<< "$choice" for emulator in "${all_systems[@]}"; do if [[ " ${choices[*]} " =~ " ${emulator} " && ! " ${current_enabled_systems[*]} " =~ " ${emulator} " ]]; then changed_systems=("${changed_systems[@]}" "$emulator") @@ -51,11 +79,14 @@ change_preset_dialog() { fi set_setting_value "$rd_conf" "$emulator" "true" "retrodeck" "$preset" # Check for conflicting presets for this system - while IFS=: read -r preset_being_checked known_incompatible_preset; do - if [[ "$preset" == "$preset_being_checked" ]]; then - if [[ $(get_setting_value "$rd_conf" "$emulator" "retrodeck" "$known_incompatible_preset") == "true" ]]; then - changed_presets=("${changed_presets[@]}" "$known_incompatible_preset") - set_setting_value "$rd_conf" "$emulator" "false" "retrodeck" "$known_incompatible_preset" + while IFS=: read -r preset_being_checked known_incompatible_preset || [[ -n "$preset_being_checked" ]]; + do + if [[ ! $preset_being_checked == "#"* ]] && [[ ! -z "$preset_being_checked" ]]; then + if [[ "$preset" == "$preset_being_checked" ]]; then + if [[ $(get_setting_value "$rd_conf" "$emulator" "retrodeck" "$known_incompatible_preset") == "true" ]]; then + changed_presets=("${changed_presets[@]}" "$known_incompatible_preset") + set_setting_value "$rd_conf" "$emulator" "false" "retrodeck" "$known_incompatible_preset" + fi fi fi done < "$incompatible_presets_reference_list" @@ -71,14 +102,6 @@ change_preset_dialog() { for emulator in "${changed_systems[@]}"; do build_preset_config $emulator ${changed_presets[*]} done - ) | - 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 Configurator Utility - Presets Configuration" \ - --text="Setting up your presets, please wait..." - else - echo "No choices made" - fi } build_preset_config() { @@ -96,81 +119,83 @@ build_preset_config() { local read_system_name=$(get_setting_name "$system_line") if [[ "$read_system_name" == "$system_being_changed" ]]; then local read_system_enabled=$(get_setting_value "$rd_conf" "$read_system_name" "retrodeck" "$current_preset") - while IFS='^' read -r action read_preset read_setting_name new_setting_value section target_file defaults_file + while IFS='^' read -r action read_preset read_setting_name new_setting_value section target_file defaults_file || [[ -n "$action" ]]; do - case "$action" in + if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then + case "$action" in - "config_file_format" ) - if [[ "$read_preset" == "retroarch-all" ]]; then - local retroarch_all="true" - local read_config_format="retroarch" - else - local read_config_format="$read_preset" - fi - ;; + "config_file_format" ) + if [[ "$read_preset" == "retroarch-all" ]]; then + local retroarch_all="true" + local read_config_format="retroarch" + else + local read_config_format="$read_preset" + fi + ;; - "change" ) - if [[ "$read_preset" == "$current_preset" ]]; then - if [[ "$target_file" = \$* ]]; then # Read current target file and resolve if it is a variable - 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 - eval defaults_file=$defaults_file - fi - local read_defaults_file="$defaults_file" - if [[ "$read_system_enabled" == "true" ]]; then - if [[ "$new_setting_value" = \$* ]]; then - eval new_setting_value=$new_setting_value + "change" ) + if [[ "$read_preset" == "$current_preset" ]]; then + if [[ "$target_file" = \$* ]]; then # Read current target file and resolve if it is a variable + eval target_file=$target_file fi - if [[ "$read_config_format" == "retroarch" && ! "$retroarch_all" == "true" ]]; then # If this is a RetroArch core, generate the override file - if [[ ! -f "$read_target_file" ]]; then - create_dir "$(realpath "$(dirname "$read_target_file")")" - echo "$read_setting_name = \""$new_setting_value"\"" > "$read_target_file" - else - if [[ -z $(grep -o -P "^$read_setting_name\b" "$read_target_file") ]]; then - add_setting "$read_target_file" "$read_setting_name" "$new_setting_value" "$read_config_format" "$section" + local read_target_file="$target_file" + if [[ "$defaults_file" = \$* ]]; then #Read current defaults file and resolve if it is a variable + eval defaults_file=$defaults_file + fi + local read_defaults_file="$defaults_file" + if [[ "$read_system_enabled" == "true" ]]; then + if [[ "$new_setting_value" = \$* ]]; then + eval new_setting_value=$new_setting_value + fi + if [[ "$read_config_format" == "retroarch" && ! "$retroarch_all" == "true" ]]; then # If this is a RetroArch core, generate the override file + if [[ ! -f "$read_target_file" ]]; then + create_dir "$(realpath "$(dirname "$read_target_file")")" + echo "$read_setting_name = \""$new_setting_value"\"" > "$read_target_file" else - set_setting_value "$read_target_file" "$read_setting_name" "$new_setting_value" "$read_config_format" "$section" - fi + if [[ -z $(grep -o -P "^$read_setting_name\b" "$read_target_file") ]]; then + add_setting "$read_target_file" "$read_setting_name" "$new_setting_value" "$read_config_format" "$section" + else + set_setting_value "$read_target_file" "$read_setting_name" "$new_setting_value" "$read_config_format" "$section" + fi + fi + else + set_setting_value "$read_target_file" "$read_setting_name" "$new_setting_value" "$read_config_format" "$section" fi else - set_setting_value "$read_target_file" "$read_setting_name" "$new_setting_value" "$read_config_format" "$section" - fi - else - if [[ "$read_config_format" == "retroarch" && ! "$retroarch_all" == "true" ]]; then - if [[ -f "$read_target_file" ]]; then - delete_setting "$read_target_file" "$read_setting_name" "$read_config_format" "$section" - if [[ -z $(cat "$read_target_file") ]]; then # If the override file is empty - rm -f "$read_target_file" - fi - if [[ -z $(ls -1 "$(dirname "$read_target_file")") ]]; then # If the override folder is empty - rmdir "$(realpath "$(dirname "$read_target_file")")" + if [[ "$read_config_format" == "retroarch" && ! "$retroarch_all" == "true" ]]; then + if [[ -f "$read_target_file" ]]; then + delete_setting "$read_target_file" "$read_setting_name" "$read_config_format" "$section" + if [[ -z $(cat "$read_target_file") ]]; then # If the override file is empty + rm -f "$read_target_file" + fi + if [[ -z $(ls -1 "$(dirname "$read_target_file")") ]]; then # If the override folder is empty + rmdir "$(realpath "$(dirname "$read_target_file")")" + fi fi + else + local default_setting_value=$(get_setting_value "$read_defaults_file" "$read_setting_name" "$read_config_format" "$section") + set_setting_value "$read_target_file" "$read_setting_name" "$default_setting_value" "$read_config_format" "$section" fi - else - local default_setting_value=$(get_setting_value "$read_defaults_file" "$read_setting_name" "$read_config_format" "$section") - set_setting_value "$read_target_file" "$read_setting_name" "$default_setting_value" "$read_config_format" "$section" fi fi - fi - ;; + ;; - "enable" ) - if [[ "$read_preset" == "$current_preset" ]]; then - if [[ "$read_system_enabled" == "true" ]]; then - enable_file "$read_setting_name" - else - disable_file "$read_setting_name" + "enable" ) + if [[ "$read_preset" == "$current_preset" ]]; then + if [[ "$read_system_enabled" == "true" ]]; then + enable_file "$read_setting_name" + else + disable_file "$read_setting_name" + fi fi - fi - ;; + ;; - * ) - echo "Other data: $action $read_preset $read_setting_name $new_setting_value $section" # DEBUG - ;; + * ) + log d "Other data: $action $read_preset $read_setting_name $new_setting_value $section" # DEBUG + ;; - esac + esac + fi done < <(cat "$presets_dir/$read_system_name"_presets.cfg) fi done < <(printf '%s\n' "$preset_section") @@ -182,7 +207,7 @@ build_retrodeck_current_presets() { # This can also be used to build the "current" state post-update after adding new systems # USAGE: build_retrodeck_current_presets - while IFS= read -r current_setting_line # Read the existing retrodeck.cfg + while IFS= read -r current_setting_line || [[ -n "$current_setting_line" ]]; # Read the existing retrodeck.cfg do if [[ (! -z "$current_setting_line") && (! "$current_setting_line" == "#"*) && (! "$current_setting_line" == "[]") ]]; then # If the line has a valid entry in it if [[ ! -z $(grep -o -P "^\[.+?\]$" <<< "$current_setting_line") ]]; then # If the line is a section header diff --git a/net.retrodeck.retrodeck.appdata.xml b/net.retrodeck.retrodeck.appdata.xml index ba2f06ca..617f0a4b 100644 --- a/net.retrodeck.retrodeck.appdata.xml +++ b/net.retrodeck.retrodeck.appdata.xml @@ -67,7 +67,46 @@ GPL-3.0 CC0-1.0 - + + https://github.com/XargonWan/RetroDECK/releases/tag/0.9.0b + +

Changes:

+
    +
  • WELCOME TO cooker-0.9.0b!
  • +
+

Known issues:

+
    +
  • Please check the know issues in the Wiki under General Information.
  • +
+
+
+ + https://github.com/XargonWan/RetroDECK/releases/tag/0.8.2b + +

Changes:

+
    +
  • ES-DE: updated to 3.0.3
  • +
  • RUNTIME: updated to KDE 6.7
  • +
  • All emulators and engines updated
  • +
  • CONFIGURATOR: fixed an issue in the multi-file compression tool that prevented some type of files to be converted
  • +
  • CONFIGURATOR: added headless state for some functions (this will help to migrate to the Godot Configurator)
  • +
  • CONFIGURATOR: added a new "Empty ROMs folder removal" tool helping the user to cleanup the roms folder by deleting the empty folders
  • +
  • CONFIGURATOR: added a new "Rebuild removed ROMs folders" tool. This is complementary to the previous one:by recreating the whole roms folder structure
  • +
  • CONFIGURATOR: chd compression functionality restored
  • +
  • FRAMEWORK: fixed an issue where second level subfolders inside retrodeck folder were not correctly placed, this caused errors on ES-DE as themes and downloaded_media folder could not be found after a reset or first install
  • +
  • CEMU: now audio should work correctly when docking and undocking the Steam Deck
  • +
  • CEMU: added microphone blow input to R3
  • +
  • DOLPHIN: now supports RetroAchivements but must be manually enabled from the emulator as the Configurator is not yet prepared for that
  • +
  • DUCKSTATION: now out of the rolling release
  • +
  • INFRASTRUCTURE: we now have a self-hosted Gitea repo in case fo disaster recovery
  • +
+

Known issues:

+
    +
  • Please check the know issues in the Wiki under General Information.
  • +
+
+
+ https://github.com/XargonWan/RetroDECK/releases/tag/0.8.1b

Changes:

@@ -96,7 +135,7 @@

Known issues:

    -
  • Please check the know issues in the Wiki under General Infomration.
  • +
  • Please check the know issues in the Wiki under General Information.
@@ -154,7 +193,7 @@

Known issues:

    -
  • Please check the know issues in the Wiki under General Infomration.
  • +
  • Please check the know issues in the Wiki under General Information.
@@ -172,7 +211,7 @@

Known issues:

    -
  • Please check the know issues in the Wiki under General Infomration.
  • +
  • Please check the know issues in the Wiki under General Information.
@@ -208,7 +247,7 @@

Known issues:

    -
  • Please check the know issues in the Wiki under General Infomration
  • +
  • Please check the know issues in the Wiki under General Information
@@ -222,7 +261,7 @@

Known issues:

    -
  • Please check the know issues in the Wiki under General Infomration
  • +
  • Please check the know issues in the Wiki under General Information
diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 4fbd83a5..e117887b 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -1,11 +1,11 @@ app-id: net.retrodeck.retrodeck runtime: org.kde.Platform -runtime-version: "6.5" +runtime-version: "6.7" sdk: org.kde.Sdk base: org.electronjs.Electron2.BaseApp # Needed for Steam ROM Manager base-version: "22.08" sdk-extensions: - - org.freedesktop.Sdk.Extension.llvm16 # Needed for RPCS3 (llvm17 actually) + - org.freedesktop.Sdk.Extension.llvm18 # Needed for RPCS3 command: retrodeck.sh finish-args: @@ -72,7 +72,7 @@ modules: # # UPDATE STEPS FOR MAIN: # [ ] Update the VERSION variable on line containing "VERSION=THISBRANCH" - # [x] Update the appdata.xml with the version number and notes + # [ ] Update the appdata.xml with the version number and notes # - name: version-initialization buildsystem: simple @@ -80,8 +80,8 @@ modules: - | # on main please update this with the version variable, eg: VERSION=0.8.0b - # on cooker will be THISBRANCH - VERSION=THISBRANCH + # on cooker will be VERSION=cooker-0.9.0b for example + VERSION=cooker-0.9.0b git checkout ${GITHUB_REF_NAME} mkdir -p ${FLATPAK_DEST}/retrodeck/ @@ -225,21 +225,13 @@ modules: - /lib/cmake sources: - type: archive - url: https://github.com/KhronosGroup/glslang/archive/14.1.0.tar.gz - sha256: b5e4c36d60eda7613f36cfee3489c6f507156829c707e1ecd7f48ca45b435322 + url: https://github.com/KhronosGroup/glslang/archive/14.2.0.tar.gz + sha256: 14a2edbb509cb3e51a9a53e3f5e435dbf5971604b4b833e63e6076e8c0a997b5 x-checker-data: type: anitya stable-only: true project-id: 205796 url-template: https://github.com/KhronosGroup/glslang/archive/$version.tar.gz - # - type: git - # url: https://github.com/KhronosGroup/SPIRV-Tools.git - # tag: sdk-1.3.261.1 - # dest: External/spirv-tools - # - type: git - # url: https://github.com/KhronosGroup/SPIRV-Headers.git - # tag: sdk-1.3.261.1 - # dest: External/spirv-tools/external/spirv-headers # enables motion controls on non-wii controllers (switch, ps4, etc) # dependency of: DOLPHIN, RPCS3 @@ -249,16 +241,20 @@ modules: config-opts: - -Dtests=disabled - -Ddocumentation=disabled + cleanup: + - /bin + - /include + - /lib/pkgconfig + - /share sources: - type: archive - url: https://www.freedesktop.org/software/libevdev/libevdev-1.13.1.tar.xz - sha256: 06a77bf2ac5c993305882bc1641017f5bec1592d6d1b64787bad492ab34f2f36 + url: https://www.freedesktop.org/software/libevdev/libevdev-1.13.2.tar.xz + sha256: 3eca86a6ce55b81d5bce910637fc451c8bbe373b1f9698f375c7f1ad0de3ac48 x-checker-data: type: anitya project-id: 20540 stable-only: true url-template: https://www.freedesktop.org/software/libevdev/libevdev-$version.tar.xz - # dependency of: CEMU - name: rapidjson buildsystem: cmake-ninja @@ -317,13 +313,20 @@ modules: # dependency of: CEMU, RPCS3 - rd-submodules/shared-modules/glew/glew.json - # dependency of: XEMU, MelonDS + # dependency of: XEMU, MelonDS (4.7.0) - name: libslirp buildsystem: meson + cleanup: + - /include sources: - - type: git - url: https://gitlab.freedesktop.org/slirp/libslirp.git - tag: v4.7.0 + - type: archive + url: https://gitlab.freedesktop.org/slirp/libslirp/-/archive/v4.8.0/libslirp-v4.8.0.tar.gz + sha256: 2a98852e65666db313481943e7a1997abff0183bd9bea80caec1b5da89fda28c + x-checker-data: + type: anitya + project-id: 96796 + stable-only: true + url-template: https://gitlab.freedesktop.org/slirp/libslirp/-/archive/v$version/libslirp-v$version.tar.gz # dependency of: CEMU (1.0.26), DOLPHIN (1.0.27) - name: libusb @@ -360,7 +363,7 @@ modules: sources: - type: git url: https://github.com/FFmpeg/FFmpeg.git - tag: n5.1.1 + tag: n5.1.4 - name: freeimage no-autogen: true @@ -423,15 +426,15 @@ modules: # ES-DE Themes - START - - name: art-book-next-es-de + - name: RetroDECK Theme buildsystem: simple build-commands: - - mkdir -p ${FLATPAK_DEST}/share/es-de/themes/art-book-next-es-de/ - - mv -f * ${FLATPAK_DEST}/share/es-de/themes/art-book-next-es-de/ + - mkdir -p ${FLATPAK_DEST}/share/es-de/themes/retrodeck/ + - mv -f * ${FLATPAK_DEST}/share/es-de/themes/retrodeck/ sources: - type: git - url: https://github.com/anthonycaccese/art-book-next-es-de.git - commit: 4fe896af7447404f6ea083335cd661c91b0f7860 + url: https://github.com/RetroDECK/RetroDECK-theme + commit: 975c41cac99d150b6ae86a1dfd19988058c69aad # ES-DE Themes - END @@ -722,8 +725,8 @@ modules: - ln -s "${FLATPAK_DEST}/pcsx2-qt/usr/bin/pcsx2-qt" "${FLATPAK_DEST}/bin/pcsx2-qt" sources: - type: file - url: https://github.com/PCSX2/pcsx2/releases/download/v1.7.5769/pcsx2-v1.7.5769-linux-appimage-x64-Qt.AppImage - sha256: d819a339b9f3c43ee44fe9b6d975b9f76cff7716b5976a3b94f77e2cf4cab667 + url: https://github.com/PCSX2/pcsx2/releases/download/v2.0.3/pcsx2-v2.0.3-linux-appimage-x64-Qt.AppImage + sha256: ce1a6240643a1c7b68d5ad21789bf9de218fcef6f61649a6503b7de7bfce186f # PCSX2 - END @@ -731,7 +734,6 @@ modules: # https://github.com/flathub/org.DolphinEmu.dolphin-emu # WHEN UPADTING: remember to update rd-submodules/dolphin contents - # needed for screensaver inhibition - name: xdg-screensaver-shim buildsystem: meson sources: @@ -751,21 +753,22 @@ modules: - /share/man post-install: - install -D -t ${FLATPAK_DEST}/bin/ dolphin-emu-wrapper - - sed -i -e 's/"2048"/"512"/g' /app/share/icons/hicolor/scalable/apps/dolphin-emu.svg + - sed -i -e 's/viewBox="0 0 1024.02 571.29"/viewBox="0 -285.645 1024 1024" width="2048" + height="2048"/g' /app/share/icons/hicolor/scalable/apps/dolphin-emu.svg sources: - type: git # Sometimes Dolphin or its submodules clone are failing in https so it must done in ssh # fatal: remote transport reported error # url: ssh://git@github.com/dolphin-emu/dolphin.git url: https://github.com/dolphin-emu/dolphin.git - commit: 032c77b462a220016f23c5079e71bb23e0ad2adf - x-checker-data: - type: json - url: https://dolphin-emu.org/update/latest/beta - commit-query: .hash - version-query: .shortrev - timestamp-query: .date - is-main-source: true + commit: cc3ff347b437fd80f3a2880d1bbc7ba2d5f191f4 + # x-checker-data: + # type: json + # url: https://dolphin-emu.org/update/latest/beta + # commit-query: .hash + # version-query: .shortrev + # timestamp-query: .date + # is-main-source: true # detects whether dolphin is running in a flatpak sandbox # and makes it use xdg directories if it is. # prevents dolphin from attempting to write conf files @@ -853,8 +856,8 @@ modules: sources: - type: git url: https://github.com/xemu-project/xemu.git - tag: v0.7.120 - commit: 94d826a4f125d755d6d37069ad7084bfde33d650 + tag: v0.7.126 + commit: b2b6a98d5ea21970cd2436a1912230f4b97c5e03 x-checker-data: type: json url: https://api.github.com/repos/xemu-project/xemu/releases/latest @@ -900,11 +903,8 @@ modules: buildsystem: cmake-ninja builddir: true build-options: - # llvm17 is not available in framework 6.5 but in 6.6, so we're trying llvm16 and cross our fingers until Primehack is updated (as Primehack breaks on 6.6) - #append-ld-library-path: /usr/lib/sdk/llvm17/lib - #append-path: /usr/lib/sdk/llvm17/bin - append-ld-library-path: /usr/lib/sdk/llvm16/lib - append-path: /usr/lib/sdk/llvm16/bin + append-ld-library-path: /usr/lib/sdk/llvm18/lib + append-path: /usr/lib/sdk/llvm18/bin cflags: &optflags -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer @@ -930,8 +930,7 @@ modules: - -DUSE_SYSTEM_ZLIB=ON - -Wno-dev post-install: - #- cp /usr/lib/sdk/llvm17/lib/libLLVM-17.so /app/lib/ - - cp /usr/lib/sdk/llvm16/lib/libLLVM-16.so /app/lib/ + - cp /usr/lib/sdk/llvm18/lib/libLLVM.so.18.1 /app/lib/ - |- set -eux COMM_TAG="$(awk -F'[\{,]' '/version{.*}/{printf "%d.%d.%d", $2, $3, $4}' ../rpcs3/rpcs3_version.cpp)" @@ -940,7 +939,7 @@ modules: sources: - type: git url: https://github.com/RPCS3/rpcs3.git - commit: 4ecf8ecd06c15f0557e1d9243f31e4c2d7baebe2 + commit: 5b973448bf75a239f34fd9c7698c8a02b04e2ea9 # RPCS3 - END @@ -955,17 +954,14 @@ modules: - -DENABLE_SDL=ON - -DENABLE_EVDEV=ON - -DDISTRIBUTOR=Flathub - - -DQT_DIR= cleanup: - /share/man post-install: - install -D primehack-wrapper /app/bin/primehack-wrapper sources: - type: git - url: https://github.com/XargonWan/primehack - commit: af7710ef7b04a632b4294eae5e0eff8fe9c4d1f8 - #url: https://github.com/TheDrifter363/primehack.git - #commit: 6295c695307a67f11ee202b05cbdd7b5c1edae5c + url: https://github.com/shiiion/dolphin.git + commit: 81bfb9686afd2d190134b44dd72d3cee876fe2ab # This commit refers to the PR 166: https://github.com/shiiion/dolphin/pull/166, please change it when it's approved # detects whether dolphin is running in a flatpak sandbox # and makes it use xdg directories if it is. # prevents dolphin from attempting to write conf files @@ -984,9 +980,9 @@ modules: - primehack "$@" dest-filename: primehack-wrapper - # # PRIMEHACK - END + # PRIMEHACK - END - # Duckstation-AppImage - START + # Duckstation-AppImage - START - AUTOUPDATED # https://github.com/stenzek/duckstation/releases/tag/preview - name: Duckstation-AppImage @@ -999,8 +995,8 @@ modules: - ln -s "${FLATPAK_DEST}/duckstation/usr/bin/duckstation-qt" "${FLATPAK_DEST}/bin/duckstation-qt" sources: - type: file - url: https://github.com/stenzek/duckstation/releases/download/preview/DuckStation-x64.AppImage - sha256: DUCKSTATIONSHAPLACEHOLDER + url: https://github.com/stenzek/duckstation/releases/download/v0.1-6937/DuckStation-x64.AppImage + sha256: 8a16f034cc8b11341ed9ad382226549301736794582bdec46a5e19b3ca981e07 # Duckstation-AppImage - END @@ -1089,8 +1085,8 @@ modules: - /share sources: - type: archive - url: https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxWidgets-3.2.4.tar.bz2 - sha256: 0640e1ab716db5af2ecb7389dbef6138d7679261fbff730d23845ba838ca133e + url: https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.5/wxWidgets-3.2.5.tar.bz2 + sha256: 0ad86a3ad3e2e519b6a705248fc9226e3a09bbf069c6c692a02acf7c2d1c6b51 x-checker-data: type: anitya project-id: 5150 @@ -1110,8 +1106,21 @@ modules: x-checker-data: type: git tag-pattern: ^v([\d.]+-\d+)$ - tag: v2.0-79 - commit: efbbb817fe1cbe09ee132344b44a0f61f8b8ac96 + tag: v2.0-88 + commit: aefbb918beb8718af8f190a73018ff63bf801d95 + disable-submodules: true + - type: git + url: https://github.com/mozilla/cubeb + commit: 6c1a6e151c1f981a2800d40af7c041cfcccc710e + dest: dependencies/cubeb + - type: git + url: https://github.com/Exzap/ZArchive + dest: dependencies/ZArchive + tag: v0.1.2 + - type: git + url: https://github.com/ocornut/imgui + dest: dependencies/imgui + commit: f65bcf481ab34cd07d3909aab1479f409fa79f2f - type: shell commands: - sed "s/set(EXPERIMENTAL_VERSION.*/set(EXPERIMENTAL_VERSION \"$(git describe @@ -1159,7 +1168,7 @@ modules: # Cemu - END - # Vita3K - START + # Vita3K - START - AUTOUPDATED - name: vita3k buildsystem: simple @@ -1177,7 +1186,7 @@ modules: sha256: VITA3KSHAPLACEHOLDER - type: file path: res/retrodeck.png - + # Vita3K - END # SOLARUS - START @@ -1255,17 +1264,34 @@ modules: # Ryujinx Appimage - START # https://ryujinx.org/download - - name: Ryujinx + # Temporary disabled to test a symlink fix build + # - name: Ryujinx + # buildsystem: simple + # build-commands: + # - | + # tar -zxvf *.tar.gz + # mv -v publish ${FLATPAK_DEST}/ryujinx + # ln -sv ${FLATPAK_DEST}/ryujinx/Ryujinx ${FLATPAK_DEST}/bin/Ryujinx.sh + # sources: + # - type: file + # url: https://github.com/Ryujinx/release-channel-master/releases/download/1.1.1343/ryujinx-1.1.1343-linux_x64.tar.gz + # sha256: 3cd2172d2f42a0fb93a83bffe6bd8fb2d1d81fb45afc80e0068a245c8f755ac1 + + - name: Ryujinx-with-symlink-fix buildsystem: simple build-commands: - | - tar -zxvf *.tar.gz - mv -v publish ${FLATPAK_DEST}/ryujinx - ln -sv ${FLATPAK_DEST}/ryujinx/Ryujinx ${FLATPAK_DEST}/bin/Ryujinx.sh + mkdir -p ${FLATPAK_DEST}/ryujinx + mkdir -p ${FLATPAK_DEST}/bin + chmod +x Ryujinx.sh + chmod +x Ryujinx + mv -v * ${FLATPAK_DEST}/ryujinx + ln -sv ${FLATPAK_DEST}/ryujinx/Ryujinx.sh ${FLATPAK_DEST}/bin/Ryujinx.sh + chmod +x ${FLATPAK_DEST}/bin/Ryujinx.sh sources: - - type: file - url: https://github.com/Ryujinx/release-channel-master/releases/download/1.1.1297/ryujinx-1.1.1297-linux_x64.tar.gz - sha256: 28b38754e7d2e92083b313b23278c180ae54ac025edbbd0276ec03baec0cec0f + - type: archive + url: https://gitlab.com/-/project/59825450/uploads/8519a04d7a3f5b5949f14b6ad25a4185/ryujinx-Release-1.1.0+81fd228-linux_x64.zip + sha256: 9e4a4393a3dcc44fda2aec40c2842492e30656c7369a9959d865a3351f12eeb9 # Ryujinx Appimage - END @@ -1334,4 +1360,4 @@ modules: sources: - type: git url: https://github.com/XargonWan/RetroDECK.git - branch: THISBRANCH + branch: THISBRANCH \ No newline at end of file diff --git a/old/disabled-workflows/cooker-selfhosted.yml b/old/disabled-workflows/cooker-selfhosted.yml index 2931fac4..4ffb693a 100644 --- a/old/disabled-workflows/cooker-selfhosted.yml +++ b/old/disabled-workflows/cooker-selfhosted.yml @@ -1,32 +1,31 @@ name: "Build cooker" on: - # push: - # branches: - # - cooker* - # - feat* - # paths: - # - '.github/workflows/**' - # - 'automation_tools/**' - # - 'emu-configs/**' - # - 'es-configs/**' - # - 'functions/**' - # - 'rd-submodules/**' - # - '*.sh' - # - 'net.retrodeck.retrodeck.yml' - # - 'net.retrodeck.retrodeck.appdata.xml' - # pull_request: - # branches: - # - cooker* + push: + branches: + - cooker* + - feat* + paths: + - '.github/workflows/**' + - 'automation_tools/**' + - 'emu-configs/**' + - 'es-configs/**' + - 'functions/**' + - 'rd-submodules/**' + - '*.sh' + - 'net.retrodeck.retrodeck.yml' + - 'net.retrodeck.retrodeck.appdata.xml' + pull_request: + branches: + - cooker* # Italy (CET): 11:00 PM # Japan (JST): 7:00 AM - schedule: - - cron: '0 22 * * *' + # schedule: + # - cron: '0 22 * * *' workflow_dispatch: - jobs: Building_RetroDECK: @@ -49,6 +48,33 @@ jobs: - name: Generate cooker build ID run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_build_id.sh" + - name: Get branch name + id: branch_name + run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV + + # if it's a feature branch it will not marked as "latest" cooker version + - name: "Set makeLatest (cooker only)" + run: | + if [[ "$BRANCH_NAME" == 'feat/'* || "$BRANCH_NAME" == 'refs/'* ]]; then + echo "MAKE_LATEST=false" >> $GITHUB_ENV + else + echo "MAKE_LATEST=true" >> $GITHUB_ENV + fi + + # if the branch is coming from a PR the tag should be manually built + - name: "Generate version tag" + run: | + if [[ "$BRANCH_NAME" == 'refs/'* ]]; then + pr_number=$(echo ${{env.BRANCH_NAME}} | awk -F'/' '{print $3}') + source_branch=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') + source_branch=${source_branch//\//-} + echo "[DEBUG] source branch is: $source_branch" + echo "TAG=PR-$pr_number-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV + else + echo "TAG=${{env.BRANCH_NAME}}-${{ env.buildid }}" >> $GITHUB_ENV + fi + echo "Version TAG: ${{ env.TAG }}" + # backing up manifest in case download fails and hashes must be recalculated - name: Manifest backup run: "cp ${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml ${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml.bak" @@ -109,23 +135,10 @@ jobs: id: commits continue-on-error: true - - name: Get branch name - id: branch_name - run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV - - # if it's a feature branch it will not marked as "latest" cooker version - - name: "Set makeLatest (cooker only)" - run: | - if [[ "$BRANCH_NAME" == 'feat/'* ]]; then - echo "MAKE_LATEST=false" >> $GITHUB_ENV - else - echo "MAKE_LATEST=true" >> $GITHUB_ENV - fi - - name: Publish the flatpak in a new cooker release uses: ncipollo/release-action@v1 with: - tag: "${{env.BRANCH_NAME}}-${{ env.buildid }}" + tag: "${{env.TAG}}" body: | # Release Notes (Cooker) This is a cooker snapshot based on the commit: ${{ github.event.repository.full_name }}@${{github.sha}}. @@ -139,7 +152,7 @@ jobs: Cooker channel is provided for the community to test fixes and explore new functionality. Please DO NOT open issues or ask support on this build. - artifacts: "RetroDECK-cooker.flatpak,RetroDECK-Artifact.tar.gz" + artifacts: "RetroDECK-cooker.flatpak,RetroDECK-cooker.flatpak.sha,RetroDECK-Artifact.tar.gz" allowUpdates: true makeLatest: ${{env.MAKE_LATEST}} # if it's a feat branch is not considered the latest build token: ${{ secrets.TRIGGER_BUILD_TOKEN }} @@ -154,3 +167,53 @@ jobs: path: RetroDECK-cooker.flatpak continue-on-error: true + # - name: Upload RetroDECK-cooker.flatpak to Gitea Release + # run: | + # # Set variables for Gitea host, organization, repository, access token, and release details + # GITEA_HOST="repo.retrodeck.net" + # ORGANIZATION="RetroDECK" + # REPO="RetroDECK-cooker" + # GITEA_TOKEN="${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }}" + # RELEASE_NAME="RetroDECK ${{env.TAG}}" + # TAG="${{env.TAG}}" + # RELEASE_BODY="# Release Notes (Cooker) + # This is a cooker snapshot based on the commit: ${{ github.event.repository.full_name }}@${{github.sha}}. + # On branch [${{env.BRANCH_NAME}}](https://repo.retrodeck.net/RetroDECK/RetroDECK/src/branch/${{env.BRANCH_NAME}}). + + # ## Commits since last release + # ${{ steps.commits.outputs.commits }} + + # For the full release note for this build please refer to the channel [#BETA-TESTING](https://discord.gg/WDc5C9YWMx) on our Discord server. + + # Cooker channel is provided for the community to test fixes and explore new functionality. + # Please DO NOT open issues or ask support on this build." + + # # Create a release using curl and capture the release ID + # release_response=$(curl -X POST \ + # -H "Authorization: token ${GITEA_TOKEN}" \ + # -H "Content-Type: application/json" \ + # -d "{\"tag_name\":\"$TAG\",\"name\":\"$RELEASE_NAME\",\"body\":\"$RELEASE_BODY\"}" \ + # "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases") + + # # Extract the release ID from the response + # release_id=$(echo $release_response | jq -r '.id') + + # # Upload artifacts + # curl -X POST \ + # -H "Authorization: token ${GITEA_TOKEN}" \ + # -H "Content-Type: multipart/form-data" \ + # -F "attachment=@RetroDECK-cooker.flatpak" \ + # "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-cooker.flatpak" + + # # Upload artifacts sha + # curl -X POST \ + # -H "Authorization: token ${GITEA_TOKEN}" \ + # -H "Content-Type: multipart/form-data" \ + # -F "attachment=@RetroDECK-cooker.flatpak.sha" \ + # "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-cooker.flatpak.sha" + + # curl -X POST \ + # -H "Authorization: token ${GITEA_TOKEN}" \ + # -H "Content-Type: multipart/form-data" \ + # -F "attachment=@RetroDECK-Artifact.tar.gz" \ + # "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases/$release_id/assets?name=RetroDECK-Artifact.tar.gz" diff --git a/emu-configs/defaults/citra/citra-qt-config.ini b/old/emu-configs/defaults/citra/citra-qt-config.ini similarity index 100% rename from emu-configs/defaults/citra/citra-qt-config.ini rename to old/emu-configs/defaults/citra/citra-qt-config.ini diff --git a/emu-configs/defaults/dolphin/Dolphin.ini b/old/emu-configs/defaults/dolphin/Dolphin.ini similarity index 77% rename from emu-configs/defaults/dolphin/Dolphin.ini rename to old/emu-configs/defaults/dolphin/Dolphin.ini index 5ac640b9..73f06aa0 100644 --- a/emu-configs/defaults/dolphin/Dolphin.ini +++ b/old/emu-configs/defaults/dolphin/Dolphin.ini @@ -51,10 +51,17 @@ Threads = True ISOPath0 = ISOPath1 = ISOPaths = 2 -WiiSDCardPath = WirelessMac = HotkeysRequireFocus = True RecursiveISOPaths = False +NANDRootPath = +DumpPath = /var/data/dolphin-emu/Dump/ +LoadPath = /var/data/dolphin-emu/Load/ +NANDRootPath = /var/data/dolphin-emu/Wii/ +ResourcePackPath = /var/data/dolphin-emu/ResourcePacks/ +WFSPath = +WiiSDCardPath = +WiiSDCardSyncFolder = /var/data/dolphin-emu/Load/WiiSDSync/ [Interface] ConfirmStop = True CursorVisibility = 0 @@ -63,6 +70,14 @@ PauseOnFocusLost = False ShowActiveTitle = True UseBuiltinTitleDatabase = True UsePanicHandlers = True +[NetPlay] +TraversalChoice = direct +[Core] +SelectedLanguage = 0 +SerialPort1 = 255 +SkipIPL = True +SlotA = 8 +SlotB = 255 [BluetoothPassthrough] Enabled = False [DSP] @@ -77,4 +92,4 @@ SavesInRomPath = False SavesPath = Threads = True [Input] -BackgroundInput = False +BackgroundInput = False \ No newline at end of file diff --git a/emu-configs/defaults/dolphin/FreeLook.ini b/old/emu-configs/defaults/dolphin/FreeLook.ini similarity index 100% rename from emu-configs/defaults/dolphin/FreeLook.ini rename to old/emu-configs/defaults/dolphin/FreeLook.ini diff --git a/emu-configs/defaults/dolphin/GBA.ini b/old/emu-configs/defaults/dolphin/GBA.ini similarity index 100% rename from emu-configs/defaults/dolphin/GBA.ini rename to old/emu-configs/defaults/dolphin/GBA.ini diff --git a/emu-configs/defaults/dolphin/GCPadNew.ini b/old/emu-configs/defaults/dolphin/GCPadNew.ini similarity index 100% rename from emu-configs/defaults/dolphin/GCPadNew.ini rename to old/emu-configs/defaults/dolphin/GCPadNew.ini diff --git a/emu-configs/defaults/dolphin/GFX.ini b/old/emu-configs/defaults/dolphin/GFX.ini similarity index 100% rename from emu-configs/defaults/dolphin/GFX.ini rename to old/emu-configs/defaults/dolphin/GFX.ini diff --git a/emu-configs/defaults/dolphin/Hotkeys.ini b/old/emu-configs/defaults/dolphin/Hotkeys.ini similarity index 100% rename from emu-configs/defaults/dolphin/Hotkeys.ini rename to old/emu-configs/defaults/dolphin/Hotkeys.ini diff --git a/emu-configs/defaults/dolphin/Qt.ini b/old/emu-configs/defaults/dolphin/Qt.ini similarity index 100% rename from emu-configs/defaults/dolphin/Qt.ini rename to old/emu-configs/defaults/dolphin/Qt.ini diff --git a/emu-configs/defaults/dolphin/WiimoteNew.ini b/old/emu-configs/defaults/dolphin/WiimoteNew.ini similarity index 100% rename from emu-configs/defaults/dolphin/WiimoteNew.ini rename to old/emu-configs/defaults/dolphin/WiimoteNew.ini diff --git a/emu-configs/defaults/duckstation/settings.ini b/old/emu-configs/defaults/duckstation/settings.ini similarity index 100% rename from emu-configs/defaults/duckstation/settings.ini rename to old/emu-configs/defaults/duckstation/settings.ini diff --git a/emu-configs/defaults/melonds/melonDS.ini b/old/emu-configs/defaults/melonds/melonDS.ini similarity index 100% rename from emu-configs/defaults/melonds/melonDS.ini rename to old/emu-configs/defaults/melonds/melonDS.ini diff --git a/emu-configs/defaults/pcsx2-qt/PCSX2.ini b/old/emu-configs/defaults/pcsx2-qt/PCSX2.ini similarity index 100% rename from emu-configs/defaults/pcsx2-qt/PCSX2.ini rename to old/emu-configs/defaults/pcsx2-qt/PCSX2.ini diff --git a/emu-configs/defaults/ppsspp/controls.ini b/old/emu-configs/defaults/ppsspp/controls.ini similarity index 100% rename from emu-configs/defaults/ppsspp/controls.ini rename to old/emu-configs/defaults/ppsspp/controls.ini diff --git a/emu-configs/defaults/ppsspp/ppsspp.ini b/old/emu-configs/defaults/ppsspp/ppsspp.ini similarity index 100% rename from emu-configs/defaults/ppsspp/ppsspp.ini rename to old/emu-configs/defaults/ppsspp/ppsspp.ini diff --git a/emu-configs/defaults/primehack/Dolphin.ini b/old/emu-configs/defaults/primehack/Dolphin.ini similarity index 100% rename from emu-configs/defaults/primehack/Dolphin.ini rename to old/emu-configs/defaults/primehack/Dolphin.ini diff --git a/emu-configs/defaults/primehack/FreeLookController.ini b/old/emu-configs/defaults/primehack/FreeLookController.ini similarity index 100% rename from emu-configs/defaults/primehack/FreeLookController.ini rename to old/emu-configs/defaults/primehack/FreeLookController.ini diff --git a/emu-configs/defaults/primehack/GBA.ini b/old/emu-configs/defaults/primehack/GBA.ini similarity index 100% rename from emu-configs/defaults/primehack/GBA.ini rename to old/emu-configs/defaults/primehack/GBA.ini diff --git a/emu-configs/defaults/primehack/GCKeyNew.ini b/old/emu-configs/defaults/primehack/GCKeyNew.ini similarity index 100% rename from emu-configs/defaults/primehack/GCKeyNew.ini rename to old/emu-configs/defaults/primehack/GCKeyNew.ini diff --git a/emu-configs/defaults/primehack/GCPadNew.ini b/old/emu-configs/defaults/primehack/GCPadNew.ini similarity index 100% rename from emu-configs/defaults/primehack/GCPadNew.ini rename to old/emu-configs/defaults/primehack/GCPadNew.ini diff --git a/emu-configs/defaults/primehack/Logger.ini b/old/emu-configs/defaults/primehack/Logger.ini similarity index 100% rename from emu-configs/defaults/primehack/Logger.ini rename to old/emu-configs/defaults/primehack/Logger.ini diff --git a/emu-configs/defaults/primehack/Qt.ini b/old/emu-configs/defaults/primehack/Qt.ini similarity index 100% rename from emu-configs/defaults/primehack/Qt.ini rename to old/emu-configs/defaults/primehack/Qt.ini diff --git a/emu-configs/defaults/primehack/WiimoteNew.ini b/old/emu-configs/defaults/primehack/WiimoteNew.ini similarity index 100% rename from emu-configs/defaults/primehack/WiimoteNew.ini rename to old/emu-configs/defaults/primehack/WiimoteNew.ini diff --git a/emu-configs/defaults/retroarch/retroarch-core-options.cfg b/old/emu-configs/defaults/retroarch/retroarch-core-options.cfg similarity index 100% rename from emu-configs/defaults/retroarch/retroarch-core-options.cfg rename to old/emu-configs/defaults/retroarch/retroarch-core-options.cfg diff --git a/emu-configs/defaults/retroarch/retroarch.cfg b/old/emu-configs/defaults/retroarch/retroarch.cfg similarity index 100% rename from emu-configs/defaults/retroarch/retroarch.cfg rename to old/emu-configs/defaults/retroarch/retroarch.cfg diff --git a/emu-configs/defaults/rpcs3/config.yml b/old/emu-configs/defaults/rpcs3/config.yml similarity index 100% rename from emu-configs/defaults/rpcs3/config.yml rename to old/emu-configs/defaults/rpcs3/config.yml diff --git a/emu-configs/defaults/rpcs3/vfs.yml b/old/emu-configs/defaults/rpcs3/vfs.yml similarity index 100% rename from emu-configs/defaults/rpcs3/vfs.yml rename to old/emu-configs/defaults/rpcs3/vfs.yml diff --git a/emu-configs/defaults/xemu/xemu.toml b/old/emu-configs/defaults/xemu/xemu.toml similarity index 100% rename from emu-configs/defaults/xemu/xemu.toml rename to old/emu-configs/defaults/xemu/xemu.toml diff --git a/emu-configs/defaults/yuzu/qt-config.ini b/old/emu-configs/defaults/yuzu/qt-config.ini similarity index 100% rename from emu-configs/defaults/yuzu/qt-config.ini rename to old/emu-configs/defaults/yuzu/qt-config.ini diff --git a/rd-submodules/primehack/detectflatpak.patch b/rd-submodules/primehack/detectflatpak.patch index 60dd1a2d..9c744da5 100644 --- a/rd-submodules/primehack/detectflatpak.patch +++ b/rd-submodules/primehack/detectflatpak.patch @@ -30,5 +30,4 @@ index 8d9dc2abb8..8a9d39a3d5 100644 const char* data_home = getenv("XDG_DATA_HOME"); std::string data_path = -- -2.37.1 - +2.37.1 \ No newline at end of file diff --git a/rd-submodules/primehack/nodirtyversion.patch b/rd-submodules/primehack/nodirtyversion.patch index 20b6f3c1..8d8482e3 100644 --- a/rd-submodules/primehack/nodirtyversion.patch +++ b/rd-submodules/primehack/nodirtyversion.patch @@ -1,13 +1,12 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9af66009a1..2acd3bed9a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -149,7 +149,7 @@ if(GIT_FOUND) +diff --git a/CMake/ScmRevGen.cmake b/CMake/ScmRevGen.cmake +index aacf7491ce..503791cda8 100644 +--- a/CMake/ScmRevGen.cmake ++++ b/CMake/ScmRevGen.cmake +@@ -7,7 +7,7 @@ if(GIT_FOUND) OUTPUT_VARIABLE DOLPHIN_WC_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE) # defines DOLPHIN_WC_DESCRIBE - execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty + execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --always --long OUTPUT_VARIABLE DOLPHIN_WC_DESCRIBE - OUTPUT_STRIP_TRAILING_WHITESPACE) - + OUTPUT_STRIP_TRAILING_WHITESPACE) \ No newline at end of file diff --git a/rd-submodules/retroarch b/rd-submodules/retroarch index c2aad986..eec4bcca 160000 --- a/rd-submodules/retroarch +++ b/rd-submodules/retroarch @@ -1 +1 @@ -Subproject commit c2aad98600a47ab250f1b133328d0ccc1310f65e +Subproject commit eec4bcca8c9e514467fb62cca4a7b2d12c6a2328 diff --git a/rd-submodules/ryujinx b/rd-submodules/ryujinx index ea1dae93..41761a7d 160000 --- a/rd-submodules/ryujinx +++ b/rd-submodules/ryujinx @@ -1 +1 @@ -Subproject commit ea1dae930a6f61388c2b5e05f95bb6ed0120926e +Subproject commit 41761a7dc36ec8520bdaca796d9d0b1219b66a07 diff --git a/rd-submodules/shared-modules b/rd-submodules/shared-modules index f63cb3f5..782d3cc0 160000 --- a/rd-submodules/shared-modules +++ b/rd-submodules/shared-modules @@ -1 +1 @@ -Subproject commit f63cb3f5fff835c141769d35cd54ce0ae042fcbf +Subproject commit 782d3cc04ccdd8071017f622d4bacd35faecbd86 diff --git a/res/extra_splashes/rd-pride.svg b/res/extra_splashes/rd-pride.svg new file mode 100644 index 00000000..4c473f49 --- /dev/null +++ b/res/extra_splashes/rd-pride.svg @@ -0,0 +1,141 @@ + + diff --git a/res/icon-pride.png b/res/icon-pride.png new file mode 100644 index 00000000..afbde32a Binary files /dev/null and b/res/icon-pride.png differ diff --git a/res/icon-pride.svg b/res/icon-pride.svg new file mode 100644 index 00000000..afb01d39 --- /dev/null +++ b/res/icon-pride.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + diff --git a/retrodeck.sh b/retrodeck.sh index 92ccd025..9488f90b 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -113,7 +113,7 @@ if [ -f "$lockfile" ]; then set_setting_value $rd_conf "update_check" "true" retrodeck "options" set_setting_value $rd_conf "developer_options" "true" retrodeck "options" cooker_base_version=$(echo $hard_version | cut -d'-' -f2) - choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Upgrade" --extra-button="Don't Upgrade" --extra-button="Full Wipe and Fresh Install" \ + choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Upgrade" --extra-button="Don't Upgrade" --extra-button="Full Wipe and Fresh Install" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Cooker Upgrade" \ --text="You appear to be upgrading to a \"cooker\" build of RetroDECK.\n\nWould you like to perform the standard post-update process, skip the post-update process or remove ALL existing RetroDECK folders and data (including ROMs and saves) to start from a fresh install?\n\nPerforming the normal post-update process multiple times may lead to unexpected results.") @@ -184,20 +184,4 @@ if [[ $update_check == "true" ]]; then fi # Normal Startup - start_retrodeck - -if [[ $steam_sync == "true" ]]; then - ( - python3 /app/libexec/steam-sync/steam-sync.py - ) | - zenity --progress \ - --title="Syncing with Steam" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --text="Syncing favorite games with Steam, please wait." \ - --percentage=25 \ - --pulsate \ - --auto-close \ - --auto-kill - -fi diff --git a/tools/configurator.sh b/tools/configurator.sh index 853f1fee..b1e2a09c 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -52,6 +52,8 @@ source /app/libexec/global.sh # - Move Screenshots folder # - Move Mods folder # - Move Texture Packs folder +# - Tool: Remove Empty ROM Folders +# - Tool: Rebuild All ROM Folders # - Tool: Compress Games # - Compress Single Game # - Compress Multiple Games - CHD @@ -99,8 +101,8 @@ source /app/libexec/global.sh # - Change Multi-user mode # - Change Update channel # - Browse the wiki -# - USB Import tool # - Install: RetroDECK Starter Pack +# - Tool: USB Import # DIALOG TREE FUNCTIONS @@ -122,7 +124,7 @@ configurator_welcome_dialog() { "RetroDECK: About" "Show additional information about RetroDECK") fi - choice=$(zenity --list --title="RetroDECK Configurator Utility" --cancel-label="Quit" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility" --cancel-label="Quit" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "${welcome_menu_options[@]}") @@ -154,11 +156,6 @@ configurator_welcome_dialog() { configurator_about_retrodeck_dialog ;; - "Sync with Steam" ) - log i "Configurator: opening \"$choice\" menu" - configurator_add_steam - ;; - "Developer Options" ) log i "Configurator: opening \"$choice\" menu" configurator_generic_dialog "RetroDECK Configurator - Developer Options" "The following features and options are potentially VERY DANGEROUS for your RetroDECK install!\n\nThey should be considered the bleeding-edge of upcoming RetroDECK features, and never used when you have important saves/states/roms that are not backed up!\n\nYOU HAVE BEEN WARNED!" @@ -174,7 +171,7 @@ configurator_welcome_dialog() { } configurator_presets_and_settings_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - Presets & Settings" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - Presets & Settings" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "Global: Presets & Settings" "Here you find presets and settings that that span over multiple emulators" \ @@ -207,7 +204,7 @@ configurator_presets_and_settings_dialog() { } configurator_global_presets_and_settings_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - Global: Presets & Settings" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - Global: Presets & Settings" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "Widescreen: Enable/Disable" "Enable or disable widescreen in supported systems" \ @@ -290,7 +287,7 @@ configurator_global_presets_and_settings_dialog() { } configurator_retroarch_presets_and_settings_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroArch: Presets & Settings" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroArch: Presets & Settings" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "Borders: Enable/Disable" "Enable or disable borders in supported systems" ) @@ -312,7 +309,7 @@ configurator_retroarch_presets_and_settings_dialog() { } configurator_wii_and_gamecube_presets_and_settings_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - Wii & GameCube: Presets & Settings" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - Wii & GameCube: Presets & Settings" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "Dolphin Textures: Universal Dynamic Input" "Enable/Disable Venomalia's Universal Dynamic Input Textures for Dolphin" \ @@ -340,7 +337,7 @@ configurator_wii_and_gamecube_presets_and_settings_dialog() { configurator_dolphin_input_textures_dialog() { if [[ -d "/var/data/dolphin-emu/Load/DynamicInputTextures" ]]; then - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - Dolphin Textures: Universal Dynamic Input" \ --text="Custom input textures are currently enabled. Do you want to disable them?" @@ -354,7 +351,7 @@ configurator_dolphin_input_textures_dialog() { configurator_wii_and_gamecube_presets_and_settings_dialog fi else - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - Dolphin Textures: Universal Dynamic Input" \ --text="Custom input textures are currently disabled. Do you want to enable them?\n\nThis process may take several minutes to complete." @@ -366,7 +363,7 @@ configurator_dolphin_input_textures_dialog() { mkdir "/var/data/dolphin-emu/Load/DynamicInputTextures" rsync -rlD --mkpath "/app/retrodeck/extras/DynamicInputTextures/" "/var/data/dolphin-emu/Load/DynamicInputTextures/" ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Configurator Utility - Dolphin Custom Input Textures Install" configurator_process_complete_dialog "enabling Dolphin custom input textures" @@ -378,7 +375,7 @@ configurator_dolphin_input_textures_dialog() { configurator_primehack_input_textures_dialog() { if [[ -d "/var/data/primehack/Load/DynamicInputTextures" ]]; then - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - Dolphin Custom Input Textures" \ --text="Custom input textures are currently enabled. Do you want to disable them?" @@ -392,7 +389,7 @@ configurator_primehack_input_textures_dialog() { configurator_wii_and_gamecube_presets_and_settings_dialog fi else - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - Primehack Custom Input Textures" \ --text="Custom input textures are currently disabled. Do you want to enable them?\n\nThis process may take several minutes to complete." @@ -404,7 +401,7 @@ configurator_primehack_input_textures_dialog() { mkdir "/var/data/primehack/Load/DynamicInputTextures" rsync -rlD --mkpath "/app/retrodeck/extras/DynamicInputTextures/" "/var/data/primehack/Load/DynamicInputTextures/" ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Configurator Utility - Primehack Custom Input Textures Install" configurator_process_complete_dialog "enabling Primehack custom input textures" @@ -416,7 +413,7 @@ configurator_primehack_input_textures_dialog() { configurator_power_user_warning_dialog() { if [[ $power_user_warning == "true" ]]; then - choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Never show this again" \ + choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Never show this again" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Power User Warning" \ --text="Making manual changes to an emulator's configuration may create serious issues,\nand some settings may be overwitten during RetroDECK updates or when using presets.\n\nSome standalone emulator functions may not work properly outside of Desktop mode.\n\nPlease continue only if you know what you're doing.\n\nDo you want to continue?") @@ -460,7 +457,7 @@ configurator_open_emulator_dialog() { emulator_list+=("Citra" "Open the 3DS emulator Citra") fi - emulator=$(zenity --list \ + emulator=$(rd_zenity --list \ --title "RetroDECK Configurator Utility - Open Emulator" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --text="Which emulator do you want to launch?" \ @@ -559,6 +556,8 @@ configurator_retrodeck_tools_dialog() { local choices=( "Tool: Move Folders" "Move RetroDECK folders between internal/SD card or to a custom location" + "Tool: Remove Empty ROM Folders" "Remove some or all of the empty ROM folders" + "Tool: Rebuild All ROM Folders" "Rebuild any missing default ROM folders" "Tool: Compress Games" "Compress games for systems that support it" "Install: RetroDECK Controller Layouts" "Install the custom RetroDECK controller layouts on Steam" "Install: PS3 Firmware" "Download and install PS3 firmware for use with the RPCS3 emulator" @@ -573,7 +572,7 @@ configurator_retrodeck_tools_dialog() { choices+=("Ponzu - Remove Citra" "Run Ponzu to remove Citra from RetroDECK. Configurations and saves will be mantained.") fi - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Tools" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Tools" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "${choices[@]}") @@ -585,6 +584,48 @@ configurator_retrodeck_tools_dialog() { configurator_retrodeck_move_tool_dialog ;; + "Tool: Remove Empty ROM Folders" ) + log i "Configurator: opening \"$choice\" menu" + + configurator_generic_dialog "RetroDECK Configurator - Remove Empty ROM Folders" "Before removing any identified empty ROM folders,\nplease make sure your ROM collection is backed up, just in case!" + configurator_generic_dialog "RetroDECK Configurator - Remove Empty ROM Folders" "Searching for empty rom folders, please be patient..." + find_empty_rom_folders + + choice=$(rd_zenity \ + --list --width=1200 --height=720 --title "RetroDECK Configurator - RetroDECK: Remove Empty ROM Folders" \ + --checklist --hide-column=3 --ok-label="Remove Selected" --extra-button="Remove All" \ + --separator="," --print-column=2 \ + --text="Choose which ROM folders to remove:" \ + --column "Remove?" \ + --column "System" \ + "${empty_rom_folders_list[@]}") + + local rc=$? + if [[ $rc == "0" && ! -z $choice ]]; then # User clicked "Remove Selected" with at least one system selected + IFS="," read -ra folders_to_remove <<< "$choice" + for folder in "${folders_to_remove[@]}"; do + log i "Removing empty folder $folder" + rm -rf "$folder" + done + configurator_generic_dialog "RetroDECK Configurator - Remove Empty ROM Folders" "The removal process is complete." + elif [[ ! -z $choice ]]; then # User clicked "Remove All" + for folder in "${all_empty_folders[@]}"; do + log i "Removing empty folder $folder" + rm -rf "$folder" + done + configurator_generic_dialog "RetroDECK Configurator - Remove Empty ROM Folders" "The removal process is complete." + fi + + configurator_retrodeck_tools_dialog + ;; + + "Tool: Rebuild All ROM Folders" ) + log i "Configurator: opening \"$choice\" menu" + es-de --create-system-dirs + configurator_generic_dialog "RetroDECK Configurator - Rebuild All ROM Folders" "The rebuilding process is complete.\n\nAll missing default ROM folders will now exist in $roms_folder" + configurator_retrodeck_tools_dialog + ;; + "Tool: Compress Games" ) log i "Configurator: opening \"$choice\" menu" configurator_generic_dialog "RetroDECK Configurator - Compression Tool" "Depending on your library and compression choices, the process can sometimes take a long time.\nPlease be patient once it is started!" @@ -608,7 +649,7 @@ configurator_retrodeck_tools_dialog() { ( update_rpcs3_firmware ) | - zenity --progress --no-cancel --pulsate --auto-close \ + rd_zenity --progress --no-cancel --pulsate --auto-close \ --icon-name=net.retrodeck.retrodeck \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title="Downloading PS3 Firmware" \ @@ -627,7 +668,7 @@ configurator_retrodeck_tools_dialog() { ( update_vita3k_firmware ) | - zenity --progress --pulsate \ + rd_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" \ @@ -661,7 +702,7 @@ configurator_retrodeck_tools_dialog() { } configurator_retrodeck_move_tool_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Move Tool" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Move Tool" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "Move all of RetroDECK" "Move the entire retrodeck folder to a new location" \ @@ -733,7 +774,7 @@ configurator_retrodeck_move_tool_dialog() { } configurator_compression_tool_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Compression Tool" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Compression Tool" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "Compress Single Game" "Compress a single game into a compatible format" \ @@ -794,30 +835,8 @@ configurator_compress_single_game_dialog() { echo "# Compressing $(basename "$file") to $compatible_compression_format format" # This updates the Zenity dialog log i "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 [[ -f "${file%.*}.$compatible_compression_format" ]]; then - log i "Performing post-compression file cleanup" - 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 - log i "Removing file $file_path/$line" - rm -f "$file_path/$line" - done < <(printf '%s\n' "$cue_bin_files") - log i "Removing file $(realpath $file)" - rm -f $(realpath "$file") - else - log i "Removing file $(realpath $file)" - rm -f "$(realpath "$file")" - fi - else - log i "Compressed file ${file%.*}.$compatible_compression_format not found, skipping original file deletion" - configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "A compressed version of the file was not found, skipping deletion." - fi - fi ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Configurator Utility - Compression in Progress" configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "The compression process is complete." @@ -835,78 +854,37 @@ configurator_compress_single_game_dialog() { configurator_compress_multiple_games_dialog() { # This dialog will display any games it finds to be compressable, from the systems listed under each compression type in compression_targets.cfg - local compressable_games_list=() - local all_compressable_games=() - local games_to_compress=() - local target_selection="$1" + find_compatible_games "$1" - if [[ "$1" == "everything" ]]; then - local compression_format="all" - else - local compression_format="$1" - fi + if [[ ! $(echo "${#all_compressable_games[@]}") == "0" ]]; then + if [[ ! "$target_selection" == "everything" ]]; then # If the user chose to not auto-compress everything + choice=$(rd_zenity \ + --list --width=1200 --height=720 --title "RetroDECK Configurator - RetroDECK: Compression Tool" \ + --checklist --hide-column=3 --ok-label="Compress Selected" --extra-button="Compress All" \ + --separator="," --print-column=3 \ + --text="Choose which games to compress:" \ + --column "Compress?" \ + --column "Game" \ + --column "Game Full Path" \ + "${compressable_games_list[@]}") - if [[ $compression_format == "all" ]]; then - local compressable_systems_list=$(cat $compression_targets | sed '/^$/d' | sed '/^\[/d') - else - local compressable_systems_list=$(sed -n '/\['"$compression_format"'\]/, /\[/{ /\['"$compression_format"'\]/! { /\[/! p } }' $compression_targets | sed '/^$/d') - fi - - while IFS= read -r system # Find and validate all games that are able to be compressed with this compression type - do - compression_candidates=$(find "$roms_folder/$system" -type f -not -iname "*.txt") - if [[ ! -z $compression_candidates ]]; then - while IFS= read -r game - do - local compatible_compression_format=$(find_compatible_compression_format "$game") - if [[ $compression_format == "chd" ]]; then - if [[ $compatible_compression_format == "chd" ]]; then - all_compressable_games=("${all_compressable_games[@]}" "$game") - compressable_games_list=("${compressable_games_list[@]}" "false" "${game#$roms_folder}" "$game") - fi - elif [[ $compression_format == "zip" ]]; then - if [[ $compatible_compression_format == "zip" ]]; then - all_compressable_games=("${all_compressable_games[@]}" "$game") - compressable_games_list=("${compressable_games_list[@]}" "false" "${game#$roms_folder}" "$game") - fi - elif [[ $compression_format == "rvz" ]]; then - if [[ $compatible_compression_format == "rvz" ]]; then - all_compressable_games=("${all_compressable_games[@]}" "$game") - compressable_games_list=("${compressable_games_list[@]}" "false" "${game#$roms_folder}" "$game") - fi - elif [[ $compression_format == "all" ]]; then - if [[ ! $compatible_compression_format == "none" ]]; then - all_compressable_games=("${all_compressable_games[@]}" "$game") - compressable_games_list=("${compressable_games_list[@]}" "false" "${game#$roms_folder}" "$game") - fi - fi - done < <(printf '%s\n' "$compression_candidates") - fi - done < <(printf '%s\n' "$compressable_systems_list") - - if [[ ! "$target_selection" == "everything" ]]; then # If the user chose to not auto-compress everything - choice=$(zenity \ - --list --width=1200 --height=720 --title "RetroDECK Configurator - RetroDECK: Compression Tool" \ - --checklist --hide-column=3 --ok-label="Compress Selected" --extra-button="Compress All" \ - --separator="," --print-column=3 \ - --text="Choose which games to compress:" \ - --column "Compress?" \ - --column "Game" \ - --column "Game Full Path" \ - "${compressable_games_list[@]}") - - local rc=$? - if [[ $rc == "0" && ! -z $choice ]]; then # User clicked "Compress Selected" with at least one game selected - IFS="," read -ra games_to_compress <<< "$choice" - local total_games_to_compress=${#games_to_compress[@]} - local games_left_to_compress=$total_games_to_compress - elif [[ ! -z $choice ]]; then # User clicked "Compress All" + local rc=$? + if [[ $rc == "0" && ! -z $choice ]]; then # User clicked "Compress Selected" with at least one game selected + IFS="," read -ra games_to_compress <<< "$choice" + local total_games_to_compress=${#games_to_compress[@]} + local games_left_to_compress=$total_games_to_compress + elif [[ ! -z $choice ]]; then # User clicked "Compress All" + games_to_compress=("${all_compressable_games[@]}") + local total_games_to_compress=${#all_compressable_games[@]} + local games_left_to_compress=$total_games_to_compress + fi + else # The user chose to auto-compress everything games_to_compress=("${all_compressable_games[@]}") local total_games_to_compress=${#all_compressable_games[@]} local games_left_to_compress=$total_games_to_compress fi - else # The user chose to auto-compress everything - games_to_compress=("${all_compressable_games[@]}") + else + configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "No compressable files were found." fi if [[ ! $(echo "${#games_to_compress[@]}") == "0" ]]; then @@ -922,30 +900,9 @@ configurator_compress_multiple_games_dialog() { games_left_to_compress=$((games_left_to_compress-1)) log i "Games left to compress: $games_left_to_compress" compress_game "$compression_format" "$file" "$system" - if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested - if [[ -f "${file%.*}.$compatible_compression_format" ]]; then - 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 - log i "Removing file $file_path/$line" - rm -f "$file_path/$line" - done < <(printf '%s\n' "$cue_bin_files") - log i "Removing file $(realpath $file)" - rm -f $(realpath "$file") - else - log i "Removing file $(realpath $file)" - rm -f "$(realpath "$file")" - fi - else - log i "Compressed file ${file%.*}.$compatible_compression_format not found, skipping original file deletion" - configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "Compression of $(basename $file) failed, skipping deletion." - fi - fi done ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --auto-close \ + rd_zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --auto-close \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - Compression in Progress" configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "The compression process is complete!" @@ -956,7 +913,7 @@ configurator_compress_multiple_games_dialog() { } configurator_compression_cleanup_dialog() { - zenity --icon-name=net.retrodeck.retrodeck --question --no-wrap --cancel-label="No" --ok-label="Yes" \ + rd_zenity --icon-name=net.retrodeck.retrodeck --question --no-wrap --cancel-label="No" --ok-label="Yes" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - RetroDECK: Compression Tool" \ --text="Do you want to remove old files after they are compressed?\n\nClicking \"No\" will leave all files behind which will need to be cleaned up manually and may result in game duplicates showing in the RetroDECK library.\n\nPlease make sure you have a backup of your ROMs before using automatic cleanup!" @@ -970,7 +927,7 @@ configurator_compression_cleanup_dialog() { configurator_online_update_setting_dialog() { if [[ $(get_setting_value $rd_conf "update_check" retrodeck "options") == "true" ]]; then - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - RetroDECK Online Update Check" \ --text="Online update checks for RetroDECK are currently enabled.\n\nDo you want to disable them?" @@ -982,7 +939,7 @@ configurator_online_update_setting_dialog() { configurator_retrodeck_tools_dialog fi else - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - RetroDECK Online Update Check" \ --text="Online update checks for RetroDECK are currently disabled.\n\nDo you want to enable them?" @@ -997,7 +954,7 @@ configurator_online_update_setting_dialog() { } configurator_retrodeck_troubleshooting_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Troubleshooting" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Troubleshooting" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "Backup: RetroDECK Userdata" "Compress and backup important RetroDECK user data folders" \ @@ -1014,7 +971,7 @@ configurator_retrodeck_troubleshooting_dialog() { ( backup_retrodeck_userdata ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Configurator Utility - Backup in Progress" \ --text="Backing up RetroDECK userdata, please wait..." @@ -1059,7 +1016,7 @@ configurator_check_bios_files() { check_bios_files "basic" - zenity --list --title="RetroDECK Configurator Utility - Check & Verify: BIOS Files" --cancel-label="Back" \ + rd_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 \ --column "BIOS File Name" \ --column "System" \ @@ -1077,7 +1034,7 @@ configurator_check_bios_files_expert_mode() { check_bios_files "expert" - zenity --list --title="RetroDECK Configurator Utility - Check & Verify: BIOS Files" --cancel-label="Back" \ + rd_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 \ --column "BIOS File Name" \ --column "System" \ @@ -1095,7 +1052,7 @@ configurator_check_multifile_game_structure() { local folder_games=($(find $roms_folder -maxdepth 2 -mindepth 2 -type d ! -name "*.m3u" ! -name "*.ps3")) if [[ ${#folder_games[@]} -gt 1 ]]; then echo "$(find $roms_folder -maxdepth 2 -mindepth 2 -type d ! -name "*.m3u" ! -name "*.ps3")" > $logs_folder/multi_file_games_"$(date +"%Y_%m_%d_%I_%M_%p").log" - zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ + rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - Check & Verify: Multi-file structure" \ --text="The following games were found to have the incorrect folder structure:\n\n$(find $roms_folder -maxdepth 2 -mindepth 2 -type d ! -name "*.m3u" ! -name "*.ps3")\n\nIncorrect folder structure can result in failure to launch games or saves being in the incorrect location.\n\nPlease see the RetroDECK wiki for more details!\n\nYou can find this list of games in ~/retrodeck/logs" @@ -1114,7 +1071,7 @@ configurator_reset_dialog() { "Reset RetroDECK" "Reset RetroDECK to default settings" ) - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Reset" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Reset" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ "${choices[@]}") @@ -1148,7 +1105,7 @@ configurator_reset_dialog() { "Reset Emulator or Engine" ) log i "Configurator: opening \"$choice\" menu" - component_to_reset=$(zenity --list \ + component_to_reset=$(rd_zenity --list \ --title "RetroDECK Configurator Utility - Reset Specific Standalone Emulator" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --text="Which emulator or engine do you want to reset to default?" \ @@ -1190,7 +1147,7 @@ configurator_reset_dialog() { ;; "Reset RetroDECK Component" ) - component_to_reset=$(zenity --list \ + component_to_reset=$(rd_zenity --list \ --title "RetroDECK Configurator Utility - Reset Specific RetroDECK Component" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --text="Which component do you want to reset to default settings?" \ @@ -1225,7 +1182,7 @@ configurator_reset_dialog() { ( prepare_component "reset" "all" ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ + rd_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 Initialization" \ --text="RetroDECK is finishing the reset process, please wait." @@ -1243,7 +1200,7 @@ configurator_reset_dialog() { "Reset RetroDECK" ) log i "Configurator: opening \"$choice\" menu" if [[ $(configurator_reset_confirmation_dialog "RetroDECK" "Are you sure you want to reset RetroDECK entirely?\n\nThis process cannot be undone.") == "true" ]]; then - zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ + rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - Reset RetroDECK" \ --text="You are resetting RetroDECK to its default state.\n\nAfter the process is complete you will need to exit RetroDECK and run it again, where you will go through the initial setup process." @@ -1264,7 +1221,7 @@ configurator_reset_dialog() { } configurator_about_retrodeck_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK: About" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroDECK: About" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Description" \ "Version History" "View the version changelogs for RetroDECK" \ @@ -1279,7 +1236,7 @@ configurator_about_retrodeck_dialog() { "Credits" ) log i "Configurator: opening \"$choice\" menu" - zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \ + rd_zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Credits" \ --filename="$emuconfigs/defaults/retrodeck/reference_lists/retrodeck_credits.txt" @@ -1344,7 +1301,7 @@ configurator_version_history_dialog() { all_versions_list=("${all_versions_list[@]}" "RetroDECK $rd_version Changelog" "View the changes specific to version $rd_version") done - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK Version History" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroDECK Version History" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Description" \ "Full RetroDECK Changelog" "View the list of all changes that have ever been made to RetroDECK" \ @@ -1369,14 +1326,14 @@ configurator_version_history_dialog() { } configurator_developer_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - Developer Options" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - Developer Options" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Description" \ "Change Multi-user mode" "Enable or disable multi-user support" \ "Change Update Channel" "Change between normal and cooker builds" \ "Browse the Wiki" "Browse the RetroDECK wiki online" \ - "USB Import" "Prepare a USB device for ROMs or import an existing collection" \ - "Install RetroDECK Starter Pack" "Install the optional RetroDECK starter pack" ) + "Install RetroDECK Starter Pack" "Install the optional RetroDECK starter pack" \ + "Tool: USB Import" "Prepare a USB device for ROMs or import an existing collection") case $choice in @@ -1396,11 +1353,6 @@ configurator_developer_dialog() { configurator_developer_dialog ;; - "USB Import" ) - log i "Configurator: opening \"$choice\" menu" - configurator_usb_import_dialog - ;; - "Install RetroDECK Starter Pack" ) log i "Configurator: opening \"$choice\" menu" if [[ $(configurator_generic_question_dialog "Install: RetroDECK Starter Pack" "The RetroDECK creators have put together a collection of classic retro games you might enjoy!\n\nWould you like to have them automatically added to your library?") == "true" ]]; then @@ -1409,6 +1361,11 @@ configurator_developer_dialog() { configurator_developer_dialog ;; + "Tool: USB Import" ) + log i "Configurator: opening \"$choice\" menu" + configurator_usb_import_dialog + ;; + "" ) # No selection made or Back button clicked log i "Configurator: going back" configurator_welcome_dialog @@ -1418,7 +1375,7 @@ configurator_developer_dialog() { configurator_retrodeck_multiuser_dialog() { if [[ $(get_setting_value $rd_conf "multi_user_mode" retrodeck "options") == "true" ]]; then - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - RetroDECK Multi-user Support" \ --text="Multi-user support is currently enabled. Do you want to disable it?\n\nIf there is more than one user configured,\nyou will be given a choice of which to use as the single RetroDECK user.\n\nThis user's files will be moved to the default locations.\n\nOther users' files will remain in the mutli-user-data folder.\n" @@ -1430,7 +1387,7 @@ configurator_retrodeck_multiuser_dialog() { configurator_developer_dialog fi else - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - RetroDECK Multi-user support" \ --text="Multi-user support is currently disabled. Do you want to enable it?\n\nThe current user's saves and states will be backed up and then moved to the \"retrodeck/multi-user-data\" folder.\nAdditional users will automatically be stored in their own folder here as they are added." @@ -1446,7 +1403,7 @@ configurator_retrodeck_multiuser_dialog() { configurator_online_update_channel_dialog() { if [[ $(get_setting_value $rd_conf "update_repo" retrodeck "options") == "RetroDECK" ]]; then - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - RetroDECK Change Update Branch" \ --text="You are currently on the production branch of RetroDECK updates. Would you like to switch to the cooker branch?\n\nAfter installing a cooker build, you may need to remove the \"stable\" branch install of RetroDECK to avoid overlap." @@ -1458,7 +1415,7 @@ configurator_online_update_channel_dialog() { configurator_developer_dialog fi else - zenity --question \ + rd_zenity --question \ --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator - RetroDECK Change Update Branch" \ --text="You are currently on the cooker branch of RetroDECK updates. Would you like to switch to the production branch?\n\nAfter installing a production build, you may need to remove the \"cooker\" branch install of RetroDECK to avoid overlap." @@ -1473,25 +1430,27 @@ configurator_online_update_channel_dialog() { } configurator_usb_import_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - Developer Options" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - Developer Options" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Description" \ - "Prepare USB device" "Create ROM folders on a selected USB device" \ + "Prepare USB device" "Create ROM and BIOS folders on a selected USB device" \ "Import from USB" "Import collection from a previously prepared device" ) case $choice in "Prepare USB device" ) log i "Configurator: opening \"$choice\" menu" + configurator_generic_dialog "RetroDeck Configurator - USB Import" "If you have an SD card installed that is not currently configured in RetroDECK it may show up in this list, but not be suitable for USB import.\n\nPlease select your desired drive carefully." + external_devices=() while read -r size device_path; do device_name=$(basename "$device_path") external_devices=("${external_devices[@]}" "$device_name" "$size" "$device_path") - done < <(df --output=size,target | grep media | grep -v $default_sd | awk '{$1=$1;print}') + done < <(df --output=size,target -h | grep "/run/media/" | grep -v "$sdcard" | awk '{$1=$1;print}') if [[ "${#external_devices[@]}" -gt 0 ]]; then - choice=$(zenity --list --title="RetroDECK Configurator Utility - USB Migration Tool" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - USB Migration Tool" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --hide-column=3 --print-column=3 \ --column "Device Name" \ @@ -1500,8 +1459,33 @@ configurator_usb_import_dialog() { "${external_devices[@]}") if [[ ! -z "$choice" ]]; then - es-de --home "$choice" --create-system-dirs - rm -rf "$choice/ES-DE" # Cleanup unnecessary folder + es-de --home "$choice/RetroDECK Import" --create-system-dirs + rm -rf "$choice/RetroDECK Import/ES-DE" # Cleanup unnecessary folder + create_dir "$choice/RetroDECK Import/BIOS" + + # Prepare default BIOS folder subfolders + create_dir "$choice/RetroDECK Import/BIOS/np2kai" + create_dir "$choice/RetroDECK Import/BIOS/dc" + create_dir "$choice/RetroDECK Import/BIOS/Mupen64plus" + create_dir "$choice/RetroDECK Import/BIOS/quasi88" + create_dir "$choice/RetroDECK Import/BIOS/fbneo/samples" + create_dir "$choice/RetroDECK Import/BIOS/fbneo/cheats" + create_dir "$choice/RetroDECK Import/BIOS/fbneo/blend" + create_dir "$choice/RetroDECK Import/BIOS/fbneo/patched" + create_dir "$choice/RetroDECK Import/BIOS/citra/sysdata" + create_dir "$choice/RetroDECK Import/BIOS/cemu" + create_dir "$choice/RetroDECK Import/BIOS/pico-8/carts" + create_dir "$choice/RetroDECK Import/BIOS/pico-8/cdata" + create_dir "$choice/RetroDECK Import/BIOS/rpcs3/dev_hdd0" + create_dir "$choice/RetroDECK Import/BIOS/rpcs3/dev_hdd1" + create_dir "$choice/RetroDECK Import/BIOS/rpcs3/dev_flash" + create_dir "$choice/RetroDECK Import/BIOS/rpcs3/dev_flash2" + create_dir "$choice/RetroDECK Import/BIOS/rpcs3/dev_flash3" + create_dir "$choice/RetroDECK Import/BIOS/rpcs3/dev_bdvd" + create_dir "$choice/RetroDECK Import/BIOS/rpcs3/dev_usb000" + create_dir "$choice/RetroDECK Import/BIOS/Vita3K/" + create_dir "$choice/RetroDECK Import/BIOS/mame-sa/samples" + create_dir "$choice/RetroDECK Import/BIOS/gzdoom" fi else configurator_generic_dialog "RetroDeck Configurator - USB Import" "There were no USB devices found." @@ -1514,14 +1498,14 @@ configurator_usb_import_dialog() { external_devices=() while read -r size device_path; do - if [[ -d "$device_path/ROMs" ]]; then + if [[ -d "$device_path/RetroDECK Import/ROMs" ]]; then device_name=$(basename "$device_path") external_devices=("${external_devices[@]}" "$device_name" "$size" "$device_path") fi - done < <(df --output=size,target | grep media | grep -v $default_sd | awk '{$1=$1;print}') + done < <(df --output=size,target -h | grep "/run/media/" | grep -v "$sdcard" | awk '{$1=$1;print}') if [[ "${#external_devices[@]}" -gt 0 ]]; then - choice=$(zenity --list --title="RetroDECK Configurator Utility - USB Migration Tool" --cancel-label="Back" \ + choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - USB Migration Tool" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --hide-column=3 --print-column=3 \ --column "Device Name" \ @@ -1530,21 +1514,23 @@ configurator_usb_import_dialog() { "${external_devices[@]}") if [[ ! -z "$choice" ]]; then - if [[ $(verify_space "$choice/ROMs" "$roms_folder") == "false" ]]; then - if [[ $(configurator_generic_question_dialog "RetroDECK Configurator Utility - USB Migration Tool" "You MAY not have enough free space to import this ROM library.\n\nThis utility only imports new additions from the USB device, so if there are a lot of the same ROMs in both locations you are likely going to be fine\nbut we are not able to verify how much data will be transferred before it happens.\n\nIf you are unsure, please verify your available free space before continuing.\n\nDo you want to continue now?") == "true" ]]; then + if [[ $(verify_space "$choice/RetroDECK Import/ROMs" "$roms_folder") == "false" || $(verify_space "$choice/RetroDECK Import/BIOS" "$bios_folder") == "false" ]]; then + if [[ $(configurator_generic_question_dialog "RetroDECK Configurator Utility - USB Migration Tool" "You MAY not have enough free space to import this ROM/BIOS library.\n\nThis utility only imports new additions from the USB device, so if there are a lot of the same files in both locations you are likely going to be fine\nbut we are not able to verify how much data will be transferred before it happens.\n\nIf you are unsure, please verify your available free space before continuing.\n\nDo you want to continue now?") == "true" ]]; then ( - rsync -a --mkpath "$choice/ROMs/"* "$roms_folder" + rsync -a --mkpath "$choice/RetroDECK Import/ROMs/"* "$roms_folder" + rsync -a --mkpath "$choice/RetroDECK Import/BIOS/"* "$bios_folder" ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --auto-close \ + rd_zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --auto-close \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - USB Import In Progress" configurator_generic_dialog "RetroDECK Configurator - USB Migration Tool" "The import process is complete!" fi else ( - rsync -a --mkpath "$choice/ROMs/"* "$roms_folder" + rsync -a --mkpath "$choice/RetroDECK Import/ROMs/"* "$roms_folder" + rsync -a --mkpath "$choice/RetroDECK Import/BIOS/"* "$bios_folder" ) | - zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --auto-close \ + rd_zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --auto-close \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --title "RetroDECK Configurator Utility - USB Import In Progress" configurator_generic_dialog "RetroDECK Configurator - USB Migration Tool" "The import process is complete!" @@ -1561,7 +1547,6 @@ configurator_usb_import_dialog() { configurator_developer_dialog ;; esac - } # START THE CONFIGURATOR