2022-08-06 03:44:31 -04:00
#!/bin/bash
#variables
PCSX2QT_emuName = "PCSX2-QT"
PCSX2QT_emuType = "AppImage"
PCSX2QT_emuPath = " $HOME /Applications/pcsx2-Qt.AppImage "
PCSX2QT_configFile = " $HOME /.config/PCSX2/inis/PCSX2.ini "
#cleanupOlderThings
2023-04-20 00:47:06 -04:00
PCSX2QT_cleanup( ) {
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
echo "NYI"
2022-08-06 03:44:31 -04:00
}
#Install
2023-04-20 00:47:06 -04:00
PCSX2QT_install( ) {
2022-08-06 03:44:31 -04:00
echo "Begin PCSX2-QT Install"
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
local showProgress = " $1 "
2023-10-10 16:20:54 -04:00
2023-09-16 12:35:05 -04:00
if installEmuAI " ${ PCSX2QT_emuName } " "https://github.com/PCSX2/pcsx2/releases/download/v1.7.4749/pcsx2-v1.7.4749-linux-appimage-x64-Qt.AppImage" "pcsx2-Qt" " $showProgress " ; then # pcsx2-Qt.AppImage - filename capitalization matters for ES-DE to find it
2023-09-16 04:07:36 -04:00
#if installEmuAI "${PCSX2QT_emuName}" "$(getReleaseURLGH "PCSX2/pcsx2" "Qt.AppImage")" "pcsx2-Qt" "$showProgress"; then #pcsx2-Qt.AppImage
2023-10-10 16:20:54 -04:00
rm -rf $HOME /.local/share/applications/pcsx2-Qt.desktop & >/dev/null # delete old shortcut
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
else
return 1
fi
2022-08-06 03:44:31 -04:00
}
#ApplyInitialSettings
2023-04-20 00:47:06 -04:00
PCSX2QT_init( ) {
setMSG " Initializing $PCSX2QT_emuName settings. "
if [ -e " $PCSX2QT_configFile " ] ; then
mv -f " $PCSX2QT_configFile " " $PCSX2QT_configFile .bak "
fi
if ! " $PCSX2QT_emuPath " -testconfig; then # try to generate the config file. if it fails, insert one as a fallback.
#fallback
configEmuAI " $PCSX2QT_emuName " "config" " $HOME /.config/PCSX2 " " $EMUDECKGIT /configs/pcsx2qt/.config/PCSX2 " "true"
fi
2022-08-06 03:44:31 -04:00
PCSX2QT_setEmulationFolder
PCSX2QT_setupStorage
2023-04-20 00:47:06 -04:00
PCSX2QT_setupSaves
PCSX2QT_setupControllers
2023-09-05 04:51:16 -04:00
PCSX2QT_setCustomizations
PCSX2QT_setRetroAchievements
2023-04-20 00:47:06 -04:00
2022-08-06 03:44:31 -04:00
}
#update
2023-04-20 00:47:06 -04:00
PCSX2QT_update( ) {
2022-08-06 03:44:31 -04:00
setMSG " Updating $PCSX2QT_emuName settings. "
configEmuAI " $PCSX2QT_emuName " "config" " $HOME /.config/PCSX2 " " $EMUDECKGIT /configs/pcsx2qt/.config/PCSX2 "
PCSX2QT_setEmulationFolder
PCSX2QT_setupStorage
PCSX2QT_setupSaves
2023-04-20 00:47:06 -04:00
PCSX2QT_setupControllers
2023-09-05 04:51:16 -04:00
2022-08-06 03:44:31 -04:00
}
#ConfigurePaths
2023-04-20 00:47:06 -04:00
PCSX2QT_setEmulationFolder( ) {
2022-08-06 03:44:31 -04:00
setMSG " Setting $PCSX2QT_emuName Emulation Folder "
2023-04-20 00:47:06 -04:00
iniFieldUpdate " $PCSX2QT_configFile " "Folders" "Bios" " ${ biosPath } "
iniFieldUpdate " $PCSX2QT_configFile " "Folders" "Snapshots" " ${ storagePath } /pcsx2/snaps "
iniFieldUpdate " $PCSX2QT_configFile " "Folders" "Savestates" " ${ savesPath } /pcsx2/states "
iniFieldUpdate " $PCSX2QT_configFile " "Folders" "MemoryCards" " ${ savesPath } /pcsx2/saves "
iniFieldUpdate " $PCSX2QT_configFile " "Folders" "Cache" " ${ storagePath } /pcsx2/cache "
iniFieldUpdate " $PCSX2QT_configFile " "Folders" "Covers" " ${ storagePath } /pcsx2/covers "
iniFieldUpdate " $PCSX2QT_configFile " "Folders" "Textures" " ${ storagePath } /pcsx2/textures "
2022-08-06 03:44:31 -04:00
2023-04-20 00:47:06 -04:00
iniFieldUpdate " $PCSX2QT_configFile " "GameList" "RecursivePaths" " ${ romsPath } /ps2 "
2022-08-06 03:44:31 -04:00
}
#SetupSaves
2023-04-20 00:47:06 -04:00
PCSX2QT_setupSaves( ) {
2022-08-06 03:44:31 -04:00
#link fp and ap saves / states?
moveSaveFolder pcsx2 saves " $HOME /.var/app/net.pcsx2.PCSX2/config/PCSX2/memcards "
moveSaveFolder pcsx2 states " $HOME /.var/app/net.pcsx2.PCSX2/config/PCSX2/sstates "
}
2023-04-20 00:47:06 -04:00
PCSX2QT_setupControllers( ) {
new_pad1_section = "
Type = DualShock2
InvertL = 0
InvertR = 0
Deadzone = 0.000000
AxisScale = 1.330000
TriggerDeadzone = 0
TriggerScale = 1
LargeMotorScale = 1.000000
SmallMotorScale = 1.000000
ButtonDeadzone = 0
PressureModifier = 0.300000
Up = SDL-0/DPadUp
Right = SDL-0/DPadRight
Down = SDL-0/DPadDown
Left = SDL-0/DPadLeft
Triangle = SDL-0/Y
Circle = SDL-0/B
Cross = SDL-0/A
Square = SDL-0/X
Select = SDL-0/Back
Start = SDL-0/Start
L1 = SDL-0/LeftShoulder
L2 = SDL-0/+LeftTrigger
R1 = SDL-0/RightShoulder
R2 = SDL-0/+RightTrigger
L3 = SDL-0/LeftStick
R3 = SDL-0/RightStick
LUp = SDL-0/-LeftY
LRight = SDL-0/+LeftX
LDown = SDL-0/+LeftY
LLeft = SDL-0/-LeftX
RUp = SDL-0/-RightY
RRight = SDL-0/+RightX
RDown = SDL-0/+RightY
RLeft = SDL-0/-RightX
SmallMotor = SDL-0/SmallMotor
LargeMotor = SDL-0/LargeMotor
Analog = Keyboard/F6
Pressure = Keyboard/S"
new_pad2_section = " Type = DualShock2
Deadzone = 0.000000
AxisScale = 1.330000
LargeMotorScale = 1.000000
SmallMotorScale = 1.000000
PressureModifier = 0.300000
Up = SDL-1/DPadUp
Right = SDL-1/DPadRight
Down = SDL-1/DPadDown
Left = SDL-1/DPadLeft
Triangle = SDL-1/Y
Circle = SDL-1/B
Cross = SDL-1/A
Square = SDL-1/X
Select = SDL-1/Back
Start = SDL-1/Start
L1 = SDL-1/LeftShoulder
L2 = SDL-1/+LeftTrigger
R1 = SDL-1/RightShoulder
R2 = SDL-1/+RightTrigger
L3 = SDL-1/LeftStick
R3 = SDL-1/RightStick
Analog = SDL-1/Guide
LUp = SDL-1/-LeftY
LRight = SDL-1/+LeftX
LDown = SDL-1/+LeftY
LLeft = SDL-1/-LeftX
RUp = SDL-1/-RightY
RRight = SDL-1/+RightX
RDown = SDL-1/+RightY
RLeft = SDL-1/-RightX
LargeMotor = SDL-1/LargeMotor
SmallMotor = SDL-1/SmallMotor"
new_hotkey_section = " CycleAspectRatio = SDL-0/Start & SDL-0/DPadRight
CycleAspectRatio = Keyboard/F6
CycleInterlaceMode = Keyboard/F5
CycleMipmapMode = Keyboard/Insert
2023-11-11 12:24:23 -05:00
DecreaseUpscalemultiplier = SDL-0/Start & SDL-0/DPadDown
2023-04-20 00:47:06 -04:00
GSDumpMultiFrame = Keyboard/Control & Keyboard/Shift & Keyboard/F8
GSDumpSingleFrame = Keyboard/Shift & Keyboard/F8
HoldTurbo = Keyboard/Period
2023-11-11 12:24:23 -05:00
IncreaseUpscalemultiplier = SDL-0/Start & SDL-0/DPadUp
2023-04-20 00:47:06 -04:00
InputRecToggleMode = Keyboard/Shift & Keyboard/R
LoadStateFromSlot = Keyboard/F3
LoadStateFromSlot = SDL-0/Back & SDL-0/LeftShoulder
NextSaveStateSlot = Keyboard/F2
NextSaveStateSlot = SDL-0/Start & SDL-0/RightShoulder
OpenPauseMenu = Keyboard/Escape
OpenPauseMenu = SDL-0/Start & SDL-0/LeftStick
PreviousSaveStateSlot = Keyboard/Shift & Keyboard/F2
PreviousSaveStateSlot = SDL-0/Start & SDL-0/LeftShoulder
ResetVM = SDL-0/Back & SDL-0/B
SaveStateToSlot = Keyboard/F1
SaveStateToSlot = SDL-0/Back & SDL-0/RightShoulder
Screenshot = Keyboard/F8
ShutdownVM = SDL-0/Back & SDL-0/Start
ToggleFrameLimit = Keyboard/F4
ToggleFrameLimit = SDL-0/Start & SDL-0/DPadRight
ToggleFullscreen = Keyboard/Alt & Keyboard/Return
ToggleFullscreen = SDL-0/Back & SDL-0/RightStick
TogglePause = Keyboard/Space
TogglePause = SDL-0/Back & SDL-0/A
ToggleSlowMotion = Keyboard/Shift & Keyboard/Backtab
ToggleSlowMotion = SDL-0/Back & SDL-0/+LeftTrigger
ToggleSoftwareRendering = Keyboard/F9
ToggleSoftwareRendering = SDL-0/Start & SDL-0/DPadLeft
ToggleTurbo = Keyboard/Tab
ToggleTurbo = SDL-0/Back & SDL-0/+RightTrigger
ZoomIn = Keyboard/Control & Keyboard/Plus
ZoomOut = Keyboard/Control & Keyboard/Minus"
iniSectionUpdate " ${ PCSX2QT_configFile } " "Hotkeys" " ${ new_hotkey_section } "
iniSectionUpdate " ${ PCSX2QT_configFile } " "Pad1" " ${ new_pad1_section } "
iniSectionUpdate " ${ PCSX2QT_configFile } " "Pad2" " ${ new_pad2_section } "
}
2022-08-06 03:44:31 -04:00
#SetupStorage
2023-04-20 00:47:06 -04:00
PCSX2QT_setupStorage( ) {
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
echo "Begin PCSX2-QT storage config"
mkdir -p " ${ storagePath } /pcsx2/snaps "
mkdir -p " ${ storagePath } /pcsx2/cache "
mkdir -p " ${ storagePath } /pcsx2/textures "
mkdir -p " ${ storagePath } /pcsx2/covers "
2022-08-06 03:44:31 -04:00
}
#WipeSettings
2023-04-20 00:47:06 -04:00
PCSX2QT_wipe( ) {
2022-08-06 03:44:31 -04:00
setMSG " Wiping $PCSX2QT_emuName settings. "
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
rm -rf " $HOME /.config/PCSX2 "
# prob not cause roms are here
2022-08-06 03:44:31 -04:00
}
#Uninstall
2023-04-20 00:47:06 -04:00
PCSX2QT_uninstall( ) {
2022-08-06 03:44:31 -04:00
setMSG " Uninstalling $PCSX2QT_emuName . "
2023-04-20 00:47:06 -04:00
rm -rf " $PCSX2QT_emuPath "
PCSX2QT_wipe
2022-08-06 03:44:31 -04:00
}
#setABXYstyle
2023-04-20 00:47:06 -04:00
PCSX2QT_setABXYstyle( ) {
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
echo "NYI"
2022-08-06 03:44:31 -04:00
}
#Migrate
2023-04-20 00:47:06 -04:00
PCSX2QT_migrate( ) {
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
echo "NYI"
2022-08-06 03:44:31 -04:00
}
#WideScreenOn
2023-04-20 00:47:06 -04:00
PCSX2QT_wideScreenOn( ) {
2023-04-19 02:19:57 -04:00
iniFieldUpdate " $PCSX2QT_configFile " "EmuCore" "EnableWideScreenPatches" "True"
iniFieldUpdate " $PCSX2QT_configFile " "EmuCore/GS" "AspectRatio" "16:9"
2022-08-06 03:44:31 -04:00
}
#WideScreenOff
2023-04-20 00:47:06 -04:00
PCSX2QT_wideScreenOff( ) {
2023-04-19 02:19:57 -04:00
iniFieldUpdate " $PCSX2QT_configFile " "EmuCore" "EnableWideScreenPatches" "false"
iniFieldUpdate " $PCSX2QT_configFile " "EmuCore/GS" "AspectRatio" "Auto 4:3/3:2"
2022-08-06 03:44:31 -04:00
}
#BezelOn
2023-04-20 00:47:06 -04:00
PCSX2QT_bezelOn( ) {
echo "NYI"
2022-08-06 03:44:31 -04:00
}
#BezelOff
2023-04-20 00:47:06 -04:00
PCSX2QT_bezelOff( ) {
echo "NYI"
2022-08-06 03:44:31 -04:00
}
#finalExec - Extra stuff
2023-04-20 00:47:06 -04:00
PCSX2QT_finalize( ) {
2022-08-06 03:44:31 -04:00
echo "NYI"
}
2023-04-20 00:47:06 -04:00
PCSX2QT_IsInstalled( ) {
2022-10-05 02:02:02 -04:00
if [ -e " $PCSX2QT_emuPath " ] ; then
echo "true"
else
echo "false"
fi
}
2023-04-20 00:47:06 -04:00
PCSX2QT_resetConfig( ) {
2022-10-05 02:02:02 -04:00
PCSX2QT_init & >/dev/null && echo "true" || echo "false"
}
2023-04-20 00:47:06 -04:00
PCSX2QT_addSteamInputProfile( ) {
2023-03-06 01:00:58 -05:00
echo "NYI"
2023-01-30 05:35:21 -05:00
}
2023-04-20 00:47:06 -04:00
PCSX2QT_retroAchievementsOn( ) {
2023-02-01 05:08:26 -05:00
iniFieldUpdate " $PCSX2QT_configFile " "Achievements" "Enabled" "True"
}
2023-04-20 00:47:06 -04:00
PCSX2QT_retroAchievementsOff( ) {
2023-02-01 05:08:26 -05:00
iniFieldUpdate " $PCSX2QT_configFile " "Achievements" "Enabled" "False"
}
2023-04-20 00:47:06 -04:00
PCSX2QT_retroAchievementsHardCoreOn( ) {
2023-02-01 05:08:26 -05:00
iniFieldUpdate " $PCSX2QT_configFile " "Achievements" "ChallengeMode" "True"
2023-04-20 00:47:06 -04:00
2023-02-01 05:08:26 -05:00
}
2023-04-20 00:47:06 -04:00
PCSX2QT_retroAchievementsHardCoreOff( ) {
2023-02-01 05:08:26 -05:00
iniFieldUpdate " $PCSX2QT_configFile " "Achievements" "ChallengeMode" "False"
}
2023-04-20 00:47:06 -04:00
PCSX2QT_retroAchievementsSetLogin( ) {
2023-01-30 05:35:21 -05:00
rau = $( cat " $HOME /.config/EmuDeck/.rau " )
2023-02-01 05:08:26 -05:00
rat = $( cat " $HOME /.config/EmuDeck/.rat " )
echo "Evaluate RetroAchievements Login."
if [ ${# rat } -lt 1 ] ; then
echo "--No token."
elif [ ${# rau } -lt 1 ] ; then
echo "--No username."
else
echo "Valid Retroachievements Username and Password length"
iniFieldUpdate " $PCSX2QT_configFile " "Achievements" "Username" " $rau "
iniFieldUpdate " $PCSX2QT_configFile " "Achievements" "Token" " $rat "
2023-04-14 12:46:56 -04:00
iniFieldUpdate " $PCSX2QT_configFile " "Achievements" "LoginTimestamp" " $( date +%s) "
2023-02-01 05:08:26 -05:00
PCSX2QT_retroAchievementsOn
fi
2023-04-20 00:47:06 -04:00
}
2023-09-05 04:51:16 -04:00
PCSX2QT_setRetroAchievements( ) {
PCSX2QT_retroAchievementsSetLogin
2023-11-30 16:39:36 -05:00
if [ " $achievementsHardcore " = = "true" ] ; then
2023-09-05 04:51:16 -04:00
PCSX2QT_retroAchievementsHardCoreOn
else
PCSX2QT_retroAchievementsHardCoreOff
fi
}
PCSX2QT_setCustomizations( ) {
echo "NYI"
2023-10-10 16:20:54 -04:00
}
2023-11-11 12:24:23 -05:00
PCSX2QT_setResolution( ) {
case $pcsx2Resolution in
"720P" ) multiplier = 2; ;
"1080P" ) multiplier = 3; ;
"1440P" ) multiplier = 4; ;
"4K" ) multiplier = 6; ;
*) echo "Error" ; exit 1; ;
esac
RetroArch_setConfigOverride "upscale_multiplier" $multiplier " $PCSX2QT_configFile "
}