EmuDeck/functions/EmuScripts/emuDeckShadPS4.sh
Dragoon Dorise 00a8f1c19c
New paths (#1381)
* new paths

* /

* EmuDeck/

* mv

* no &

* ESDE new location

* ESDE new path

* no symlink load

* bigpemu new path

* force move

* global vars

* oopsie

* missing $emudeckBackend

* better migration detection

* Keep Appimages in Applications

* Keep Appimages in Applications
2025-01-02 13:42:31 +01:00

130 lines
2.9 KiB
Bash

#!/bin/bash
# Script to install, initialize and configure ShadPS4 on EmuDeck
# Note: No Bios/Keys symlinks necessary
# Variables
ShadPS4_emuName="ShadPS4"
ShadPS4_emuType="$emuDeckEmuTypeAppImage"
ShadPS4_emuPath="$emusFolder"
ShadPS4_dir="$HOME/.local/share/shadPS4"
ShadPS4_configFile="$ShadPS4_dir/config.toml"
ShadPS4_cleanup(){
echo "Begin ShadPS4 Cleanup"
}
# TODO: Install Flatpak from https://github.com/shadps4-emu/shadPS4-flatpak
ShadPS4_install(){
echo "Begin ShadPS4 Install"
local showProgress=$1
if installEmuAI "$ShadPS4_emuName" "" "$(getReleaseURLGH "shadps4-emu/shadPS4" "zip" "linux-qt")" "" "zip" "emulator" "$showProgress"; then
unzip -o "$emusFolder/ShadPS4.zip" -d "$ShadPS4_emuPath" && rm -rf "$emusFolder/ShadPS4.zip"
chmod +x "$ShadPS4_emuPath/publish/Shadps4-qt.AppImage"
else
return 1
fi
}
ShadPS4_init(){
configEmuAI "$ShadPS4_emuName" "config" "$HOME/.local/share/shadPS4" "$emudeckBackend/configs/shadps4" "true"
ShadPS4_setupStorage
ShadPS4_setEmulationFolder
ShadPS4_setupSaves
ShadPS4_flushEmulatorLauncher
ShadPS4_setLanguage
}
ShadPS4_update(){
ShadPS4_init
}
# Configuration Paths
ShadPS4_setEmulationFolder(){
echo "Begin ShadPS4 Path Config"
sed -i "s|/run/media/mmcblk0p1/Emulation|${emulationPath}|g" "$ShadPS4_configFile"
echo "ShadPS4 Path Config Completed"
}
ShadPS4_setLanguage(){
setMSG "Setting ShadPS4 Language"
local language=$(locale | grep LANG | cut -d= -f2 | cut -d_ -f1)
#TODO: call this somewhere, and input the $language from somewhere (args?)
changeLine "emulatorLanguage = " "emulatorLanguage = \"${language}\"" $ShadPS4_configFile
echo "ShadPS4 language '${emulatorLanguage}' configuration completed."
}
# Setup Saves
ShadPS4_setupSaves(){
echo "Begin ShadPS4 save link"
# Create symbolic links
linkToSaveFolder shadps4 saves "${ShadPS4_dir}/savedata"
echo "ShadPS4 save link completed"
}
#SetupStorage
ShadPS4_setupStorage(){
echo "Begin ShadPS4 storage config"
mkdir -p "$storagePath/shadps4/games"
mkdir -p "$storagePath/shadps4/dlc"
}
#WipeSettings
ShadPS4_wipe(){
echo "Begin ShadPS4 delete config directories"
rm -rf "$ShadPS4_dir"
}
#Uninstall
ShadPS4_uninstall(){
echo "Begin ShadPS4 uninstall"
uninstallEmuAI $ShadPS4_emuName "Shadps4-qt" "AppImage" "emulator"
}
#WideScreenOn
ShadPS4_wideScreenOn(){
echo "NYI"
}
#WideScreenOff
ShadPS4_wideScreenOff(){
echo "NYI"
}
#BezelOn
ShadPS4_bezelOn(){
echo "NYI"
}
#BezelOff
ShadPS4_bezelOff(){
echo "NYI"
}
#finalExec - Extra stuff
ShadPS4_finalize(){
echo "Begin ShadPS4 finalize"
}
ShadPS4_IsInstalled(){
if [ -e "$ShadPS4_emuPath/Shadps4-qt.AppImage" ]; then
echo "true"
else
echo "false"
fi
}
ShadPS4_resetConfig(){
ShadPS4_init &>/dev/null && echo "true" || echo "false"
}
ShadPS4_setResolution(){
echo "NYI"
}
ShadPS4_flushEmulatorLauncher(){
flushEmulatorLaunchers "ShadPS4"
}