distribution/packages/emulators/standalone/pcsx2-sa/sources/start_pcsx2.sh

50 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present - Fewtarius
. /etc/profile
2023-10-13 10:48:24 +00:00
GAME=${1//[\\]/}
jslisten set "-9 pcsx2-qt"
2023-10-13 10:48:24 +00:00
FPS=$(get_setting show_fps ps2 "${GAME}")
if [ ! -d "/storage/.config/PCSX2" ]
then
cp -rf /usr/config/PCSX2 /storage/.config
fi
#Create PS2 bios folder
if [ ! -d "/storage/roms/bios/pcsx2/bios" ]
then
mkdir -p "/storage/roms/bios/pcsx2/bios"
fi
#Create PS2 saves & savestates folders
if [ ! -d "/storage/roms/saves/ps2" ]
then
mkdir -p "/storage/roms/saves/ps2"
fi
if [ ! -d "/storage/roms/savestates/ps2" ]
then
mkdir -p "/storage/roms/savestates/ps2"
fi
2023-10-13 10:48:24 +00:00
for OSDPROPERTY in OsdShowSpeed OsdShowFPS OsdShowCPU OsdShowGPU OsdShowResolution OsdShowGSStats OsdShowIndicators
do
case ${FPS} in
true)
sed -i '/'${OSDPROPERTY}'/c\'${OSDPROPERTY}' = true' /storage/.config/PCSX2/inis/PCSX2.ini
;;
*)
sed -i '/'${OSDPROPERTY}'/c\'${OSDPROPERTY}' = false' /storage/.config/PCSX2/inis/PCSX2.ini
;;
esac
done
@APPIMAGE@ -fastboot -nogui -- "${GAME}"
#Workaround until we can learn why it doesn't exit cleanly when asked.
2023-10-13 10:48:24 +00:00
killall -9 pcsx2-qt