Merge remote-tracking branch 'upstream/cooker-0.5.3b' into cooker-configurator

This commit is contained in:
icenine451 2022-10-24 09:35:07 -04:00
commit 0be522145d
12 changed files with 256 additions and 207 deletions

View file

@ -44,6 +44,7 @@ jobs:
- name: Build flatpak
run: |
git config --global protocol.allow always
flatpak-builder --user --force-clean --install-deps-from=flathub --install-deps-from=flathub-beta --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml
- name: Create Artifact for flathub

View file

@ -28,6 +28,8 @@ jobs:
git clone --recursive https://github.com/XargonWan/RetroDECK RetroDECK
cd $gits_folder/RetroDECK
relname="main-"$(git rev-parse --short HEAD)
git checkout $rd_branch
git submodule init
git submodule update
@ -36,7 +38,6 @@ jobs:
#sync -rav --progress --exclude={'res/screenshots/','shared-modules/','rd-submodules/retroarch','.git/','docs','retrodeck-flatpak/','retrodeck-flatpak-cooker/','.flatpak-builder/'} ~/RetroDECK/ ~/flathub/
cd $gits_folder/flathub
git checkout master
git rm -rf *
@ -71,14 +72,9 @@ jobs:
sed -i "s#__SHA__#$sha#g" net.retrodeck.retrodeck.yml
echo -e "Resulting manifest:\n"
cat net.retrodeck.retrodeck.yml
git config --global user.name "${{ secrets.GITNAME }}"
git config --global user.email "${{ secrets.GITMAIL }}"
git add *
git commit -m "Updated flathub/net.retrodeck.retrodeck from RetroDECK/$rd_branch"
git remote -v
git push --force https://${{ secrets.TRIGGER_BUILD_TOKEN }}@github.com/flathub/net.retrodeck.retrodeck.git master
git push --force https://${{ secrets.TRIGGER_BUILD_TOKEN }}@github.com/flathub/net.retrodeck.retrodeck.git $relname

View file

@ -17,18 +17,13 @@ jobs:
runs-on: self-hosted
steps:
- name: Get date for artifacts
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d_%H%M%S')"
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Remove stuck mounts
run: sudo umount -f /home/administrator/actions-runner/_work/RetroDECK/RetroDECK/.flatpak-builder/rofiles/*
continue-on-error: true
- name: Generate build ID
id: generating_buildid
run: echo "##[set-output name=build-id;]$(echo "${{ steps.extract_branch.outputs.branch }}-${{ steps.date.outputs.date }}")"
run: echo "##[set-output name=build-id;]$(echo "$( git rev-parse --short HEAD )")"
- uses: actions/checkout@v3
@ -38,34 +33,42 @@ jobs:
git submodule init
git submodule update
sudo apt install -y flatpak flatpak-builder p7zip-full
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user -y org.kde.Sdk//5.15-21.08 org.kde.Platform//5.15-21.08 io.qt.qtwebengine.BaseApp/x86_64/5.15-21.08 org.freedesktop.Sdk.Extension.llvm13
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user -y --noninteractive \
org.kde.Sdk//6.3 \
org.kde.Platform//6.3 \
org.freedesktop.Platform.ffmpeg-full/x86_64/21.08 \
io.qt.qtwebengine.BaseApp/x86_64/6.3 \
org.freedesktop.Sdk.Extension.llvm13 \
org.freedesktop.Sdk.Extension.dotnet6/x86_64/21.08
# for main remember to change ${HOME} into ${GITHUB_WORKSPACE}
- name: Build flatpak
run: |
flatpak-builder --build-only --user --force-clean --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-main net.retrodeck.retrodeck.yml
git config --global protocol.allow always
flatpak-builder --user --force-clean --install-deps-from=flathub --install-deps-from=flathub-beta --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-main net.retrodeck.retrodeck.yml
- name: Create Artifact for flathub
run: |
tar -czf ${GITHUB_WORKSPACE}/RetroDECK-Artifact.tar.gz -C ${GITHUB_WORKSPACE}/retrodeck-flatpak-main .
hash=($(sha256sum ${GITHUB_WORKSPACE}/RetroDECK-Artifact.tar.gz))
echo $hash > ${GITHUB_WORKSPACE}/RetroDECK-Artifact.sha
mv -f RetroDECK-Artifact.* ${{ secrets.ARTIFACT_REPO }}
continue-on-error: true
- name: Create Bundle
run: |
flatpak-builder --user --force-clean --repo=${GITHUB_WORKSPACE}/local ${GITHUB_WORKSPACE}/retrodeck-flatpak-main net.retrodeck.retrodeck.yml
flatpak build-bundle ${GITHUB_WORKSPACE}/local RetroDECK.flatpak net.retrodeck.retrodeck
- name: Read version from version file
id: version
run: echo "##[set-output name=version;]$(cat $(find . -name version))"
- name: Publish the flatpak in a new release
uses: ncipollo/release-action@v1
with:
#tag: "${{ steps.version.outputs.version }}"
tag: "${{ steps.generating_buildid.outputs.build-id }}"
body: |
# Release Notes
( Write release notes here )
artifacts: "RetroDECK.flatpak"
artifacts: "RetroDECK.flatpak,RetroDECK-Artifact.tar.gz"
allowUpdates: true
prerelease: true
draft: true

View file

@ -34,7 +34,7 @@ No, RetroDECK doesn't support Windows, but the project is fully open source so y
## How can I install it?
Just install it from Discover store.<br/>
However if you want to test the cooker version you can follow the [Installation instructions](https://github.com/XargonWan/RetroDECK/wiki#installation-instructions) on the Wiki
However if you want to test the cooker version you can follow the [Installation instructions](https://github.com/XargonWan/RetroDECK/wiki/How-to:-Getting-started) on the Wiki
## Can I help?
Of course, any help is appreciated, and not only by programming, just check out our [Discord](https://discord.gg/Dz3szYsP8g)!

View file

@ -0,0 +1 @@
sort_savefiles_by_content_enable = "false"

View file

@ -3147,7 +3147,7 @@ video_scale = "3.000000"
video_scale_integer = "false"
video_scale_integer_overscale = "false"
video_shader_delay = "0"
video_shader_dir = "/app/retrodeck/overlays/shaders"
video_shader_dir = "/var/config/retroarch/shaders"
video_shader_enable = "true"
video_shader_preset_save_reference_enable = "true"
video_shader_remember_last_dir = "false"

View file

@ -824,9 +824,9 @@
<fullname>Nintendo 3DS</fullname>
<path>%ROMPATH%/n3ds</path>
<extension>.3ds .3DS .3dsx .3DSX .app .APP .axf .AXF .cci .CCI .cxi .CXI .elf .ELF .7z .7Z .zip .ZIP</extension>
<command label="Citra (Standalone)">%EMULATOR_CITRA% %ROM%</command>
<command label="Citra">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra_libretro.so %ROM%</command>
<command label="Citra 2018">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra2018_libretro.so %ROM%</command>
<command label="Citra (Standalone)">%EMULATOR_CITRA% %ROM%</command>
<platform>n3ds</platform>
<theme>n3ds</theme>
</system>
@ -1083,8 +1083,8 @@
<fullname>Sony PlayStation 3</fullname>
<path>%ROMPATH%/ps3</path>
<extension>.desktop .ps3 .PS3 .ps3dir .PS3DIR</extension>
<command label="RPCS3 Shortcut (Standalone)">%ENABLESHORTCUTS% %EMULATOR_OS-SHELL% %ROM%</command>
<command label="RPCS3 Directory (Standalone)">%EMULATOR_RPCS3% --no-gui %ROM%</command>
<command label="RPCS3 Shortcut (Standalone)">%ENABLESHORTCUTS% %EMULATOR_OS-SHELL% %ROM%</command>
<platform>ps3</platform>
<theme>ps3</theme>
</system>

View file

@ -69,11 +69,37 @@
<releases>
<release version="0.6.0b" date="2022-10-12">
<url>https://github.com/XargonWan/RetroDECK/releases/tag/0.6.0b</url>
<release version="0.5.2b" date="2022-10-13">
<url>https://github.com/XargonWan/RetroDECK/releases/tag/0.5.2b</url>
<description>
<ul>
<li>TBD</li>
<li>VERY IMPORTANT: We are moving your saves! This can take time on the first boot. If you miss some saves they are not gone. Please read more in the wiki.</li>
<li>Fixed Citra save migration folder</li>
<li>Fixed a bug where the videos were not played correctly in some cases</li>
<li>Fixed the Rewind tool</li>
</ul>
</description>
</release>
<release version="0.5.1b" date="2022-10-12">
<url>https://github.com/XargonWan/RetroDECK/releases/tag/0.5.1b</url>
<description>
<ul>
<li>VERY IMPORTANT: We are moving your saves! This can take time on the first boot. If you miss some saves they are not gone. Please read more in the wiki.</li>
<li>Fixed a bug where Yuzu was not compiled correctly</li>
<li>Updated Yuzu</li>
<li>New Logo and Theme</li>
<li>Two new themes added: Alekfull-NX-Light and Retrofix-Revisited</li>
<li>Updated ES-DE to 1.2.6</li>
<li>Implemented the first steps towards a universal Emulator Configuration Tool in the TOOLS menu</li>
<li>Ability to log into your RetroAchievements account under the TOOLS menu for RetroArch only (supported standalones coming soon)</li>
<li>Updated RetroArch and all the standalone emulators</li>
<li>Added several free assets/fonts for RetroArch, PPSSPP, XEMU and BlueMSX</li>
<li>Added a new DEFAULT Emulator for the PS2: PCSX2-QT (the former PCSX2 default emulator is now called "PCSX2 (Legacy)")</li>
<li>Changed the DEFAULT Emulator for the PSX: Swanstation (Libretro) Core</li>
<li>Added a new Standalone Emulator for the PSX: Duckstation</li>
<li>Enhanced XEMU (XBOX) experience</li>
<li>And more, for the complete patch notes please check the wiki...</li>
</ul>
</description>
</release>
@ -117,8 +143,6 @@
</description>
</release>
<release version="0.4.4b" date="2022-07-18">
<release version="0.4.4b" date="2022-07-18">
<url>https://github.com/XargonWan/RetroDECK/releases/tag/0.4.4b</url>
<description>
@ -374,4 +398,4 @@
</release>
</releases>
</component>
</component>

View file

@ -76,7 +76,7 @@ modules:
- |
git checkout ${GITHUB_REF_NAME}
mkdir -p ${FLATPAK_DEST}/retrodeck/
VERSION="0.6.0b-cooker"
VERSION="0.5.3b"
if [[ $VERSION == *"cooker"* ]];
then
VERSION="cooker-"$(git rev-parse --short HEAD)
@ -86,7 +86,7 @@ modules:
sources:
- type: git
url: https://github.com/XargonWan/RetroDECK.git
branch: cooker
branch: cooker-0.5.3b
- name: xmlstarlet
config-opts:
@ -232,7 +232,7 @@ modules:
sources:
- type: git
url: https://gitlab.com/es-de/emulationstation-de
branch: 18b2ee412e1bb3ea35ffd6e680ebf1dacda8e0ff
branch: f8d782f1f3b1fba8a119b793edd01f37e0258953
- type: shell
commands:
- sed -i 's/QUIT EMULATIONSTATION/QUIT RETRODECK/g' es-app/src/guis/GuiMenu.cpp
@ -587,12 +587,13 @@ modules:
sources:
- type: archive
url: >-
https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2
sha256: 475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39
https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2
sha256: 1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0
x-checker-data:
type: anitya
project-id: 6845
url-template: https://boostorg.jfrog.io/artifactory/main/release/$version/source/boost_1_79_0.tar.bz2
url-template: >-
https://boostorg.jfrog.io/artifactory/main/release/$version/source/boost_1_80_0.tar.bz2
- name: nv-codec-headers
make-install-args:
- PREFIX=/app
@ -619,8 +620,8 @@ modules:
- -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON
- -DYUZU_USE_QT_WEB_ENGINE=ON
- -DYUZU_USE_BUNDLED_FFMPEG=ON
- -DDISPLAY_VERSION=1150
- -DBUILD_TAG=mainline-1150
- -DDISPLAY_VERSION=1195
- -DBUILD_TAG=mainline-1195
- -DBUILD_REPOSITORY=yuzu-emu/yuzu-mainline
#- -DCMAKE_PREFIX_PATH=/run/build/yuzu/_flatpak_build/externals/qt5_5_15_2
build-options:
@ -635,11 +636,11 @@ modules:
- install -Dm755 ../yuzu-launcher.sh /app/bin/yuzu-launcher
- install -Dm644 ../dist/yuzu.svg /app/share/icons/hicolor/scalable/apps/yuzu.svg
sources:
- disable-submodules: true # FLATHUB WORKAROUND
#- disable-submodules: true # FLATHUB WORKAROUND
- type: git
url: https://github.com/yuzu-emu/yuzu-mainline.git
tag: mainline-0-1171
commit: 3b25d1fe22f5eee7a046432884d78b25a3950988
tag: mainline-0-1195
commit: 04db31a25a51f2daa296776eb4e58496ee74d49e
disable-shallow-clone: true
x-checker-data:
type: git
@ -958,8 +959,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.3366/pcsx2-v1.7.3366-linux-AppImage-64bit-AVX2-Qt.AppImage
sha256: 00790594de30929a11056b95d89650cbf523cc2bb1dc27df3a99e215722ec90c
url: https://github.com/PCSX2/pcsx2/releases/download/v1.7.3478/pcsx2-v1.7.3478-linux-AppImage-64bit-AVX2-Qt.AppImage
sha256: c36e22cb49656d1997255bfe9491217349c05f5179ca3b47475f7d2280588014
# PCSX2 - END
@ -1435,4 +1436,4 @@ modules:
sources:
- type: git
url: https://github.com/XargonWan/RetroDECK.git
branch: cooker
branch: cooker-0.5.3b

@ -1 +1 @@
Subproject commit bcd152baf434eea464b9e58e48078ff674c13886
Subproject commit 176c8715bdd09a1282a3861839dd2bd976380403

View file

@ -89,6 +89,9 @@ standalones_init() {
dir_prep "$rdhome/bios/switch/keys" "/var/data/yuzu/keys"
# initializing the firmware folder
dir_prep "$rdhome/bios/switch/registered" "/var/data/yuzu/nand/system/Contents/registered"
# initializing the save folders
dir_prep "$rdhome/saves/switch/yuzu/nand" "/var/data/yuzu/nand"
dir_prep "$rdhome/saves/switch/yuzy/sdmc" "/var/data/yuzu/sdmc"
# configuring Yuzu
dir_prep "$rdhome/.logs/yuzu" "/var/data/yuzu/log"
mkdir -pv /var/config/yuzu/
@ -144,6 +147,7 @@ standalones_init() {
mkdir -pv /var/config/citra-emu/
mkdir -pv "$rdhome/saves/n3ds/citra/nand/"
mkdir -pv "$rdhome/saves/n3ds/citra/sdmc/"
dir_prep "$rdhome/bios/citra/sysdata" "/var/data/citra-emu/sysdata"
dir_prep "$rdhome/.logs/citra" "/var/data/citra-emu/log"
cp -fv $emuconfigs/citra-qt-config.ini /var/config/citra-emu/qt-config.ini
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/citra-emu/qt-config.ini
@ -170,7 +174,7 @@ standalones_init() {
if [ ! -f $rdhome/bios/xbox_hdd.qcow2 ]
then
wget "https://github.com/mborgerson/xemu-hdd-image/releases/latest/download/xbox_hdd.qcow2.zip" -P $rdhome/bios/
unzip $rdhome/bios/xbox_hdd.qcow2.zip $rdhome/bios/
unzip -q $rdhome/bios/xbox_hdd.qcow2.zip $rdhome/bios/
rm -rfv $rdhome/bios/xbox_hdd.qcow2.zip
fi
@ -199,10 +203,14 @@ standalones_init() {
ra_init() {
dir_prep "$rdhome/bios" "/var/config/retroarch/system"
dir_prep "$rdhome/.logs/retroarch" "/var/config/retroarch/logs"
mkdir -pv /var/config/retroarch/shaders/
cp -rfv /app/share/libretro/shaders /var/config/retroarch/
dir_prep "$rdhome/shaders/retroarch" "/var/config/retroarch/shaders"
mkdir -pv /var/config/retroarch/cores/
cp /app/share/libretro/cores/* /var/config/retroarch/cores/
cp -fv $emuconfigs/retroarch.cfg /var/config/retroarch/
cp -fv $emuconfigs/retroarch-core-options.cfg /var/config/retroarch/
cp -rfv $emuconfigs/retroarch-core-overrides/* /var/config/retroarch/config
#rm -rf $rdhome/bios/bios # in some situations a double bios symlink is created
sed -i 's#~/retrodeck#'$rdhome'#g' /var/config/retroarch/retroarch.cfg
@ -218,7 +226,7 @@ ra_init() {
#if [ ! -f "$rdhome/bios/PPSSPP/ppge_atlas.zim" ]
#then
wget "https://github.com/hrydgard/ppsspp/archive/refs/heads/master.zip" -P $rdhome/bios/PPSSPP
unzip "$rdhome/bios/PPSSPP/master.zip" -d $rdhome/bios/PPSSPP/
unzip -q "$rdhome/bios/PPSSPP/master.zip" -d $rdhome/bios/PPSSPP/
mv "$rdhome/bios/PPSSPP/ppsspp-master/assets/"* "$rdhome/bios/PPSSPP/"
rm -rfv "$rdhome/bios/PPSSPP/master.zip"
rm -rfv "$rdhome/bios/PPSSPP/ppsspp-master"
@ -234,7 +242,7 @@ ra_init() {
echo "Initializing MSX / SVI / ColecoVision / SG-1000 LIBRETRO"
echo "-----------------------------------------------------------"
wget "http://bluemsx.msxblue.com/rel_download/blueMSXv282full.zip" -P $rdhome/bios/MSX
unzip "$rdhome/bios/MSX/blueMSXv282full.zip" $rdhome/bios/MSX
unzip -q "$rdhome/bios/MSX/blueMSXv282full.zip" $rdhome/bios/MSX
mv -rfv $rdhome/bios/MSX/Databases $rdhome/bios/Databases
mv -rfv $rdhome/bios/MSX/Machines $rdhome/bios/Machines
rm -rfv $rdhome/bios/MSX
@ -249,182 +257,191 @@ create_lock() {
}
post_update() {
# post update script
echo "Executing post-update script"
# post update script
echo "Executing post-update script"
# Finding existing ROMs folder
if [ -d "$default_sd/retrodeck" ]
then
# ROMs on SD card
roms_folder="$default_sd/retrodeck/roms"
else
# ROMs on Internal
roms_folder="$HOME/retrodeck/roms"
# Finding existing ROMs folder
if [ -d "$default_sd/retrodeck" ]
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
fi
echo "ROMs folder found at $roms_folder"
else
# ROMs on Internal
roms_folder="$HOME/retrodeck/roms"
fi
echo "ROMs folder found at $roms_folder"
# Unhiding downloaded media from the previous versions
if [ -d "$rdhome/.downloaded_media" ]
then
mv -fv "$rdhome/.downloaded_media" "$media_folder"
fi
# Unhiding downloaded media from the previous versions
if [ -d "$rdhome/.downloaded_media" ]
then
mv -fv "$rdhome/.downloaded_media" "$media_folder"
fi
# Unhiding themes folder from the previous versions
if [ -d "$rdhome/.themes" ]
then
mv -fv "$rdhome/.themes" "$themes_folder"
fi
# Unhiding themes folder from the previous versions
if [ -d "$rdhome/.themes" ]
then
mv -fv "$rdhome/.themes" "$themes_folder"
fi
# Doing the dir prep as we don't know from which version we came
dir_prep "$media_folder" "/var/config/emulationstation/.emulationstation/downloaded_media"
dir_prep "$themes_folder" "/var/config/emulationstation/.emulationstation/themes"
mkdir -pv $rdhome/.logs #this was added later, maybe safe to remove in a few versions
# Doing the dir prep as we don't know from which version we came
dir_prep "$media_folder" "/var/config/emulationstation/.emulationstation/downloaded_media"
dir_prep "$themes_folder" "/var/config/emulationstation/.emulationstation/themes"
mkdir -pv $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/emulationstation/.emulationstation/es_settings.xml
# 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/emulationstation/.emulationstation/es_settings.xml
# 0.4 -> 0.5
# Perform save and state migration if needed
# 0.4 -> 0.5
# 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
# Moving PCSX2 Saves
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
# 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
versionwheresaveschanged="0.4.5b" # Hardcoded break point between unsorted and sorted saves
if [[ $(sed -e "s/\.//g" <<< $hard_version) > $(sed -e "s/\.//g" <<< $versionwheresaveschanged) ]] && [[ ! $(sed -e "s/\.//g" <<< $hard_version) == $(sed -e "s/\.//g" <<< $version) ]]; then # Check if user is upgrading from the version where save organization was changed. Try not to reuse this, it things 0.4.5b is newer than 0.4.5
migration_logfile=$rdhome/.logs/savemove_"$(date +"%Y_%m_%d_%I_%M_%p").log"
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"
if [[ $(sed -e "s/\.//g" <<< $hard_version) > $(sed -e "s/\.//g" <<< $versionwheresaveschanged) ]] && [[ ! $(sed -e "s/\.//g" <<< $version) > $(sed -e "s/\.//g" <<< $versionwheresaveschanged) ]]; then # Check if user is upgrading from the version where save organization was changed. Try not to reuse this, it things 0.4.5b is newer than 0.4.5
migration_logfile=$rdhome/.logs/savemove_"$(date +"%Y_%m_%d_%I_%M_%p").log"
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 \
--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."
allgames=($(find "$roms_folder" -maxdepth 2 -mindepth 2 ! -name "systeminfo.txt" ! -name "systems.txt" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" ! -name "*^*" | sed -e "s/ /\^/g")) # Build an array of all games and multi-disc-game-containing folders, adding whitespace placeholder
allsaves=($(find "$saves_folder" -mindepth 1 -maxdepth 1 -name "*.*" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" | sed -e "s/ /\^/g")) # Build an array of all save files, ignoring standalone emulator sub-folders, adding whitespace placeholder
allstates=($(find "$states_folder" -mindepth 1 -maxdepth 1 -name "*.*" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" | sed -e "s/ /\^/g")) # Build an array of all state files, ignoring standalone emulator sub-folders, adding whitespace placeholder
totalsaves=${#allsaves[@]}
totalstates=${#allstates[@]}
filesleft=
current_dest_folder=
gamestoskip=
tar -C $rdhome -czf $save_backup_file saves # Backup save directory for safety
echo "Saves backed up to" $save_backup_file >> $migration_logfile
tar -C $rdhome -czf $state_backup_file states # Backup state directory for safety
echo "States backed up to" $state_backup_file >> $migration_logfile
(
movefile() { # Take matching save and rom files and sort save into appropriate system folder
echo "# $filesleft $currentlybeingmoved remaining..." # These lines update the Zenity progress bar
progress=$(( 100 - (( 100 / "$totalfiles" ) * "$filesleft" )))
echo $progress
filesleft=$((filesleft-1))
if [[ ! " ${gamestoskip[*]} " =~ " ${1} " ]]; then # If the current game name exists multiple times in array ie. /roms/snes/Mortal Kombat 3.zip and /roms/genesis/Mortal Kombat 3.zip, skip and alert user to sort manually
game=$(sed -e "s/\^/ /g" <<< "$1") # Remove whitespace placeholder
gamebasename=$(basename "$game" | sed -e 's/\..*//') # Extract pure file name ie. /roms/snes/game1.zip becomes game1
systemdir="$(basename "$(dirname "$1")")" # Extract parent directory identifying system ROM belongs to
matches=($(find "$roms_folder" -maxdepth 2 -mindepth 2 -name "$gamebasename"".*" | sed -e 's/ /^/g' | sed -e 's/\..*//')) # Search for multiple instances of pure game name, adding to skip list if found
if [[ ${#matches[@]} -gt 1 ]]; then
echo "ERROR: Multiple ROMS found with name:" $gamebasename "Please sort saves and states for these ROMS manually" >> $migration_logfile
gamestoskip+=("$1")
return
fi
echo "INFO: Examining ROM file:" "$game" >> $migration_logfile
echo "INFO: System detected as" $systemdir >> $migration_logfile
sosfile=$(sed -e "s/\^/ /g" <<< "$2") # Remove whitespace placeholder from s-ave o-r s-tate file
sospurebasename="$(basename "$sosfile")" # Extract pure file name ie. /saves/game1.sav becomes game1
echo "INFO: Current save or state being examined for match:" $sosfile >> $migration_logfile
echo "INFO: Matching save or state" $sosfile "and game" $game "found." >> $migration_logfile
echo "INFO: Moving save or state to" $current_dest_folder"/"$systemdir"/"$sosbasename >> $migration_logfile
if [[ ! -d $current_dest_folder"/"$systemdir ]]; then # If system directory doesn't exist for save yet, create it
echo "WARNING: Creating missing system directory" $current_dest_folder"/"$systemdir
mkdir $current_dest_folder/$systemdir
fi
mv "$sosfile" -t $current_dest_folder/$systemdir # Move save to appropriate system directory
return
else
echo "WARNING: Game with name" "$(basename "$1" | sed -e "s/\^/ /g")" "already found. Skipping to next game..." >> $migration_logfile # Inform user of game being skipped due to duplicate ROM names
fi
}
find "$roms_folder" -mindepth 2 -maxdepth 2 -name "*\^*" -exec echo "ERROR: Game named" {} "found, please move save manually" \; >> $migration_logfile # Warn user if any of their files have the whitespace replacement character used by the script
totalfiles=$totalsaves #set variables for save file migration
filesleft=$totalsaves
currentlybeingmoved="saves"
current_dest_folder=$saves_folder
for i in "${allsaves[@]}"; do # For each save file, compare to every ROM file name looking for a match
found=
currentsave=($(basename "$i" | sed -e 's/\..*//')) # Extract pure file name ie. /saves/game1.sav becomes game1
for j in "${allgames[@]}"; do
currentgame=($(basename "$j" | sed -e 's/\..*//')) # Extract pure file name ie. /roms/snes/game1.zip becomes game1
[[ $currentgame == $currentsave ]] && { found=1; break; } # If names match move to next stage, otherwise skip
done
[[ -n $found ]] && movefile $j $i || echo "ERROR: No ROM match found for save file" $i | sed -e 's/\^/ /g' >> $migration_logfile # If a match is found, run movefile() otherwise warn user of stranded save file
done
totalfiles=$totalstates #set variables for state file migration
filesleft=$totalstates
currentlybeingmoved="states"
current_dest_folder=$states_folder
for i in "${allstates[@]}"; do # For each state file, compare to every ROM file name looking for a match
found=
currentstate=($(basename "$i" | sed -e 's/\..*//')) # Extract pure file name ie. /states/game1.sav becomes game1
for j in "${allgames[@]}"; do
currentgame=($(basename "$j" | sed -e 's/\..*//')) # Extract pure file name ie. /roms/snes/game1.zip becomes game1
[[ $currentgame == $currentstate ]] && { found=1; break; } # If names match move to next stage, otherwise skip
done
[[ -n $found ]] && movefile $j $i || echo "ERROR: No ROM match found for state file" $i | sed -e 's/\^/ /g' >> $migration_logfile # If a match is found, run movefile() otherwise warn user of stranded state file
done
) |
zenity --progress \
--icon-name=net.retrodeck.retrodeck \
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title="Processing Files" \
--text="# files remaining..." \
--percentage=0 \
--no-cancel \
--auto-close
--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."
if [[ $(cat $migration_logfile | grep "ERROR" | wc -l) -eq 0 ]]; then
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."
allgames=($(find "$roms_folder" -maxdepth 2 -mindepth 2 ! -name "systeminfo.txt" ! -name "systems.txt" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" ! -name "*^*" | sed -e "s/ /\^/g")) # Build an array of all games and multi-disc-game-containing folders, adding whitespace placeholder
allsaves=($(find "$saves_folder" -mindepth 1 -maxdepth 1 -name "*.*" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" | sed -e "s/ /\^/g")) # Build an array of all save files, ignoring standalone emulator sub-folders, adding whitespace placeholder
allstates=($(find "$states_folder" -mindepth 1 -maxdepth 1 -name "*.*" ! -name "gc" ! -name "n3ds" ! -name "nds" ! -name "wii" ! -name "xbox" | sed -e "s/ /\^/g")) # Build an array of all state files, ignoring standalone emulator sub-folders, adding whitespace placeholder
totalsaves=${#allsaves[@]}
totalstates=${#allstates[@]}
filesleft=
current_dest_folder=
gamestoskip=
tar -C $rdhome -czf $save_backup_file saves # Backup save directory for safety
echo "Saves backed up to" $save_backup_file >> $migration_logfile
tar -C $rdhome -czf $state_backup_file states # Backup state directory for safety
echo "States backed up to" $state_backup_file >> $migration_logfile
(
movefile() { # Take matching save and rom files and sort save into appropriate system folder
echo "# $filesleft $currentlybeingmoved remaining..." # These lines update the Zenity progress bar
progress=$(( 100 - (( 100 / "$totalfiles" ) * "$filesleft" )))
echo $progress
filesleft=$((filesleft-1))
if [[ ! " ${gamestoskip[*]} " =~ " ${1} " ]]; then # If the current game name exists multiple times in array ie. /roms/snes/Mortal Kombat 3.zip and /roms/genesis/Mortal Kombat 3.zip, skip and alert user to sort manually
game=$(sed -e "s/\^/ /g" <<< "$1") # Remove whitespace placeholder
gamebasename=$(basename "$game" | sed -e 's/\..*//') # Extract pure file name ie. /roms/snes/game1.zip becomes game1
systemdir="$(basename "$(dirname "$1")")" # Extract parent directory identifying system ROM belongs to
matches=($(find "$roms_folder" -maxdepth 2 -mindepth 2 -name "$gamebasename"".*" | sed -e 's/ /^/g' | sed -e 's/\..*//')) # Search for multiple instances of pure game name, adding to skip list if found
if [[ ${#matches[@]} -gt 1 ]]; then
echo "ERROR: Multiple ROMS found with name:" $gamebasename "Please sort saves and states for these ROMS manually" >> $migration_logfile
gamestoskip+=("$1")
return
fi
echo "INFO: Examining ROM file:" "$game" >> $migration_logfile
echo "INFO: System detected as" $systemdir >> $migration_logfile
sosfile=$(sed -e "s/\^/ /g" <<< "$2") # Remove whitespace placeholder from s-ave o-r s-tate file
sospurebasename="$(basename "$sosfile")" # Extract pure file name ie. /saves/game1.sav becomes game1
echo "INFO: Current save or state being examined for match:" $sosfile >> $migration_logfile
echo "INFO: Matching save or state" $sosfile "and game" $game "found." >> $migration_logfile
echo "INFO: Moving save or state to" $current_dest_folder"/"$systemdir"/"$sosbasename >> $migration_logfile
if [[ ! -d $current_dest_folder"/"$systemdir ]]; then # If system directory doesn't exist for save yet, create it
echo "WARNING: Creating missing system directory" $current_dest_folder"/"$systemdir
mkdir $current_dest_folder/$systemdir
fi
mv "$sosfile" -t $current_dest_folder/$systemdir # Move save to appropriate system directory
return
else
cat $migration_logfile | grep "ERROR" > "$rdhome/manual_sort_needed.log"
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"
echo "WARNING: Game with name" "$(basename "$1" | sed -e "s/\^/ /g")" "already found. Skipping to next game..." >> $migration_logfile # Inform user of game being skipped due to duplicate ROM names
fi
}
find "$roms_folder" -mindepth 2 -maxdepth 2 -name "*\^*" -exec echo "ERROR: Game named" {} "found, please move save manually" \; >> $migration_logfile # Warn user if any of their files have the whitespace replacement character used by the script
totalfiles=$totalsaves #set variables for save file migration
filesleft=$totalsaves
currentlybeingmoved="saves"
current_dest_folder=$saves_folder
for i in "${allsaves[@]}"; do # For each save file, compare to every ROM file name looking for a match
found=
currentsave=($(basename "$i" | sed -e 's/\..*//')) # Extract pure file name ie. /saves/game1.sav becomes game1
for j in "${allgames[@]}"; do
currentgame=($(basename "$j" | sed -e 's/\..*//')) # Extract pure file name ie. /roms/snes/game1.zip becomes game1
[[ $currentgame == $currentsave ]] && { found=1; break; } # If names match move to next stage, otherwise skip
done
[[ -n $found ]] && movefile $j $i || echo "ERROR: No ROM match found for save file" $i | sed -e 's/\^/ /g' >> $migration_logfile # If a match is found, run movefile() otherwise warn user of stranded save file
done
totalfiles=$totalstates #set variables for state file migration
filesleft=$totalstates
currentlybeingmoved="states"
current_dest_folder=$states_folder
for i in "${allstates[@]}"; do # For each state file, compare to every ROM file name looking for a match
found=
currentstate=($(basename "$i" | sed -e 's/\..*//')) # Extract pure file name ie. /states/game1.sav becomes game1
for j in "${allgames[@]}"; do
currentgame=($(basename "$j" | sed -e 's/\..*//')) # Extract pure file name ie. /roms/snes/game1.zip becomes game1
[[ $currentgame == $currentstate ]] && { found=1; break; } # If names match move to next stage, otherwise skip
done
[[ -n $found ]] && movefile $j $i || echo "ERROR: No ROM match found for state file" $i | sed -e 's/\^/ /g' >> $migration_logfile # If a match is found, run movefile() otherwise warn user of stranded state file
done
) |
zenity --progress \
--icon-name=net.retrodeck.retrodeck \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title="Processing Files" \
--text="# files remaining..." \
--percentage=0 \
--no-cancel \
--auto-close
if [[ $(cat $migration_logfile | grep "ERROR" | wc -l) -eq 0 ]]; then
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
echo "Version" $version "is after the save and state organization was changed, no need to sort again"
cat $migration_logfile | grep "ERROR" > "$rdhome/manual_sort_needed.log"
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"
fi
ra_init
standalones_init
tools_init
else
echo "Version" $version "is after the save and state organization was changed, no need to sort again"
fi
create_lock
(
ra_init
standalones_init
tools_init
) |
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 Upgrade" \
--text="RetroDECK is finishing the upgrade process, please wait."
create_lock
}
start_retrodeck() {
@ -582,9 +599,15 @@ finit() {
# PICO-8
dir_prep "$roms_folder/pico8" "$rdhome/bios/pico8/bbs/carts" #this is the folder where pico-8 is saving the carts
(
ra_init
standalones_init
tools_init
) |
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 Upgrade" \
--text="RetroDECK is finishing the upgrade process, please wait."
create_lock
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \

@ -1 +1 @@
Subproject commit 81b7b525dbd79258a7e9fb3df57461977806fe69
Subproject commit a9112b9c62e2b84db4c2f6c55c9531fd7e8d03c1