Skip to content

Commit c825b7a

Browse files
committed
pcsx2: fix installation and configuration for recent 1.7 packages
* The Ubuntu PPA has 64bit packages for some time, now defaulting to 64bit only for recent 22.04 and newer. Modified the module to take this into account and install the 64bit package when available. * The new PCSX2 versions have a QT UI by default and the PPA installs it automatically. The parameters and commands are different from the previous WXWidgets based versions, so configuration detects the version installed and sets the correct commands for both versions.
1 parent 2830334 commit c825b7a

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

scriptmodules/emulators/pcsx2.sh

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ rp_module_licence="GPL3 https://raw.githubusercontent.com/PCSX2/pcsx2/master/COP
1616
rp_module_section="exp"
1717
rp_module_flags="!all x86"
1818

19+
function _64bit_available_pcsx2() {
20+
# detect if a 64bit version for pcsx2 is available in the Ubuntu PPA
21+
if [[ -n "${__os_ubuntu_ver}" ]] && compareVersions "${__os_ubuntu_ver}" ge 21.04; then
22+
return 0
23+
fi
24+
25+
return 1
26+
}
1927
function depends_pcsx2() {
20-
if isPlatform "64bit"; then
28+
if isPlatform "64bit" && ! _64bit_available_pcsx2 ; then
2129
iniConfig " = " '"' "$configdir/all/retropie.cfg"
2230
iniGet "own_sdl2"
2331
if [[ "$ini_value" != "0" ]]; then
@@ -37,10 +45,12 @@ function depends_pcsx2() {
3745
if [[ "$md_mode" == "install" ]]; then
3846
# On Ubuntu, add the PCSX2 PPA to get the latest version
3947
[[ -n "${__os_ubuntu_ver}" ]] && add-apt-repository -y ppa:pcsx2-team/pcsx2-daily
40-
dpkg --add-architecture i386
48+
if ! _64bit_available_pcsx2 ; then
49+
dpkg --add-architecture i386
50+
fi
4151
else
4252
rm -f /etc/apt/sources.list.d/pcsx2-team-ubuntu-pcsx2-daily-*.list
43-
apt-key del "D7B4 49CF E17E 659E 5A12 EE8E DD6E EEA2 BD74 7717" >/dev/null
53+
apt-key del "D7B4 49CF E17E 659E 5A12 EE8E DD6E EEA2 BD74 7717" >/dev/null
4454
fi
4555
}
4656

@@ -61,9 +71,15 @@ function remove_pcsx2() {
6171

6272
function configure_pcsx2() {
6373
mkRomDir "ps2"
64-
# Windowed option
65-
addEmulator 0 "$md_id" "ps2" "/usr/games/pcsx2 %ROM% --windowed"
66-
# Fullscreen option with no gui (default, because we can close with `Esc` key, easy to map for gamepads)
67-
addEmulator 1 "$md_id-nogui" "ps2" "/usr/games/pcsx2 %ROM% --fullscreen --nogui"
74+
75+
# detect if the new (QT) UI is installed and add the fullscreen/windowed commands
76+
if [[ -f /usr/bin/pcsx2-qt ]]; then
77+
addEmulator 0 "$md_id" "ps2" "pcsx2-qt -nofullscreen %ROM%"
78+
addEmulator 1 "$md_id-nogui" "ps2" "pcsx2-qt -fullscreen -nogui %ROM%"
79+
else
80+
addEmulator 0 "$md_id" "ps2" "/usr/games/pcsx2 --windowed %ROM%"
81+
addEmulator 1 "$md_id-nogui" "ps2" "/usr/games/pcsx2 --fullscreen --nogui %ROM%"
82+
fi
83+
6884
addSystem "ps2"
6985
}

0 commit comments

Comments
 (0)