Skip to content

Commit

Permalink
Update emuDeckRPCS3.sh (#863)
Browse files Browse the repository at this point in the history
* Update emuDeckRPCS3.sh
* Updated migrationFlag location to "$HOME/.config/EmuDeck/.${emu}MigrationCompleted"
* Updated RPCS3_install to use installEmuAI and removed desktop creation function
    * Simplifies RPCS3 emuScript
* Updated RPCS3_emuName to lowercase
    * Matches ES-DE find rules

* Updated to changes implemented in #864

* InstallEmuAI/InstallEmuBI Tweaks

* altName -> fileName
* fileName is used for the AppImage file name only, use the "real" name for the shortcut
* adapt emu scripts - only PCSX2 makes use of this
* small changes in other scripts to use emuName variable instead of hardcoded strings

* better comment

* Remove : from comment

* Add echo "true" to RPCS3_migrate to reflect migrate button in the GUI

---------

Co-authored-by: SilentException <[email protected]>
  • Loading branch information
rawdatafeel and SilentException authored Oct 4, 2023
1 parent 13edffb commit ef28cb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 34 deletions.
42 changes: 10 additions & 32 deletions functions/EmuScripts/emuDeckRPCS3.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#variables
RPCS3_remuName="RPCS3"
RPCS3_emuName="RPCS3"
RPCS3_emuType="AppImage"
RPCS3_releaseURL="https://rpcs3.net/latest-appimage"
RPCS3_emuPath="$HOME/Applications/rpcs3.AppImage"
Expand All @@ -19,26 +19,11 @@ RPCS3_install(){
# Migrates configurations to RPCS3 AppImage
RPCS3_migrate

# RPCS3 does not have a "latest" tag on their GitHub repo. Open issue said to use the below URL instead. Modified from ES-DE script
RPCS3_releaseMD5="$(curl -sL https://rpcs3.net/latest-appimage | md5sum | cut -d ' ' -f 1)"

local showProgress="$1"

if [[ $RPCS3_releaseURL = "https://rpcs3.net/latest-appimage"* ]]; then

if safeDownload "$RPCS3_remuName" "$RPCS3_releaseURL" "$RPCS3_emuPath" "$showProgress"; then
RPCS3_md5sum=($(md5sum $RPCS3_emuPath)) # get first element
if [ "$RPCS3_md5sum" == "$RPCS3_releaseMD5" ]; then
echo "RPCS3 PASSED HASH CHECK."
chmod +x "$RPCS3_emuPath"
else
echo "RPCS3 FAILED HASH CHECK. Expected $RPCS3_releaseMD5, got $RPCS3_md5sum"
fi
else
return 1
fi
if installEmuAI "$RPCS3_emuName" "$RPCS3_releaseURL" "rpcs3" "$showProgress"; then # rpcs3.AppImage - needs to be lowercase yuzu for EsDE to find it
:
else
setMSG "$RPCS3_remuName not found"
return 1
fi

Expand All @@ -54,7 +39,6 @@ RPCS3_init(){
RPCS3_setupStorage
RPCS3_setEmulationFolder
RPCS3_setupSaves
RPCS3_createDesktopShortcut
}

#update
Expand Down Expand Up @@ -106,15 +90,6 @@ RPCS3_setupStorage(){
fi
}

# Create desktop shortcut
RPCS3_createDesktopShortcut(){

createDesktopShortcut "$HOME/.local/share/applications/$RPCS3_remuName.desktop" \
"$RPCS3_remuName AppImage" \
"${toolsPath}/launchers/rpcs3.sh" \
"false"
}

#WipeSettings
RPCS3_wipe(){
setMSG "Wiping $RPCS3_emuName settings."
Expand All @@ -138,19 +113,22 @@ RPCS3_setABXYstyle(){

#Migrate
RPCS3_migrate(){
echo "Begin RPCS3 Migration"
emu="RPCS3"
migrationFlag="$HOME/emudeck/.${emu}MigrationCompleted"
echo "Begin RPCS3 Migration"

# Migration
migrationFlag="$HOME/.config/EmuDeck/.${RPCS3_emuName}MigrationCompleted"
#check if we have a nomigrateflag for $emu
if [ ! -f "$migrationFlag" ]; then
#RPCS3 flatpak to appimage
#From -- > to
migrationTable=()
migrationTable+=("$HOME/.var/app/net.rpcs3.RPCS3/config/rpcs3" "$HOME/.config/rpcs3")

migrateAndLinkConfig "$emu" "$migrationTable"
migrateAndLinkConfig "$RPCS3_emuName" "$migrationTable"
fi

echo "true"

}

#WideScreenOn
Expand Down
4 changes: 2 additions & 2 deletions tools/launchers/rpcs3.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
source $HOME/.config/EmuDeck/backend/functions/all.sh
cloud_sync_downloadEmu "rpcs3" && cloud_sync_startService
emuName="rpcs3" #parameterize me
emuName="rpcs3"
emufolder="$HOME/Applications" # has to be applications for ES-DE to find it

#find full path to emu executable
Expand All @@ -10,7 +10,7 @@ exe=$(find $emufolder -iname "${emuName}*.AppImage" | sort -n | cut -d' ' -f 2-
#if appimage doesn't exist fall back to flatpak.
if [[ $exe == '' ]]; then
#flatpak
flatpakApp=$(flatpak list --app --columns=application | grep $emuName)
flatpakApp=$(flatpak list --app --columns=application | grep $RPCS3_emuName)
exe="/usr/bin/flatpak run "$flatpakApp
else
#make sure that file is executable
Expand Down

0 comments on commit ef28cb9

Please sign in to comment.