From 0acce010038e2289a0283a48df739074c1e05db7 Mon Sep 17 00:00:00 2001
From: Leon Styhre <leon@leonstyhre.com>
Date: Sun, 1 May 2022 18:40:10 +0200
Subject: [PATCH] Added Play! standalone as an alternative emulator for the ps2
 system.

---
 resources/systems/macos/es_find_rules.xml           | 12 +++++++++---
 resources/systems/macos/es_systems.xml              |  1 +
 resources/systems/unix/es_find_rules.xml            |  9 +++++++++
 resources/systems/unix/es_systems.xml               |  1 +
 resources/systems/windows/es_find_rules.xml         | 13 +++++++++++++
 .../systems/windows/es_find_rules_portable.xml      |  8 ++++++++
 resources/systems/windows/es_systems.xml            |  1 +
 7 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/resources/systems/macos/es_find_rules.xml b/resources/systems/macos/es_find_rules.xml
index 561adb41c..a113c78bc 100644
--- a/resources/systems/macos/es_find_rules.xml
+++ b/resources/systems/macos/es_find_rules.xml
@@ -83,10 +83,10 @@
             <entry>/Applications/PCSX2.app/Contents/MacOS/PCSX2</entry>
         </rule>
     </emulator>
-    <emulator name="RPCS3">
-        <!-- Sony PlayStation 3 emulator RPCS3 -->
+    <emulator name="PLAY!">
+        <!-- Sony PlayStation 2 emulator Play! -->
         <rule type="staticpath">
-            <entry>/Applications/RPCS3.app/Contents/MacOS/rpcs3</entry>
+            <entry>/Applications/Play.app/Contents/MacOS/Play</entry>
         </rule>
     </emulator>
     <emulator name="PPSSPP">
@@ -103,6 +103,12 @@
             <entry>/Applications/redream.app/Contents/MacOS/redream</entry>
         </rule>
     </emulator>
+    <emulator name="RPCS3">
+        <!-- Sony PlayStation 3 emulator RPCS3 -->
+        <rule type="staticpath">
+            <entry>/Applications/RPCS3.app/Contents/MacOS/rpcs3</entry>
+        </rule>
+    </emulator>
     <emulator name="SIXTYFORCE">
         <!-- Nintendo 64 emulator sixtyforce -->
         <rule type="staticpath">
diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml
index f1bba4470..3c2e543ed 100644
--- a/resources/systems/macos/es_systems.xml
+++ b/resources/systems/macos/es_systems.xml
@@ -964,6 +964,7 @@
         <path>%ROMPATH%/ps2</path>
         <extension>.bin .BIN .chd .CHD .cso .CSO .elf .ELF .iso .ISO .isz .ISZ</extension>
         <command label="PCSX2 (Standalone)">%EMULATOR_PCSX2% --nogui %ROM%</command>
+        <command label="Play! (Standalone)">%EMULATOR_PLAY!% --disc %ROM%</command>
         <platform>ps2</platform>
         <theme>ps2</theme>
     </system>
diff --git a/resources/systems/unix/es_find_rules.xml b/resources/systems/unix/es_find_rules.xml
index afa927a33..f28e3036b 100644
--- a/resources/systems/unix/es_find_rules.xml
+++ b/resources/systems/unix/es_find_rules.xml
@@ -167,6 +167,15 @@
             <entry>~/.local/share/flatpak/exports/bin/net.pcsx2.PCSX2</entry>
         </rule>
     </emulator>
+    <emulator name="PLAY!">
+        <!-- Sony PlayStation 2 emulator Play! -->
+        <rule type="staticpath">
+            <entry>/var/lib/flatpak/exports/bin/org.purei.Play</entry>
+            <entry>~/Applications/Play!*.AppImage</entry>
+            <entry>~/.local/bin/Play!*.AppImage</entry>
+            <entry>~/bin/Play!*.AppImage</entry>
+        </rule>
+    </emulator>
     <emulator name="PPSSPP">
         <!-- Sony PlayStation Portable emulator PPSSPP -->
         <rule type="systempath">
diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml
index dec0eb60b..a3803a3d6 100644
--- a/resources/systems/unix/es_systems.xml
+++ b/resources/systems/unix/es_systems.xml
@@ -970,6 +970,7 @@
         <extension>.bin .BIN .chd .CHD .cso .CSO .elf .ELF .iso .ISO .isz .ISZ</extension>
         <command label="PCSX2">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/pcsx2_libretro.so %ROM%</command>
         <command label="PCSX2 (Standalone)">%EMULATOR_PCSX2% --nogui %ROM%</command>
+        <command label="Play! (Standalone)">%EMULATOR_PLAY!% --disc %ROM%</command>
         <platform>ps2</platform>
         <theme>ps2</theme>
     </system>
diff --git a/resources/systems/windows/es_find_rules.xml b/resources/systems/windows/es_find_rules.xml
index d90347475..1f5bf3fef 100644
--- a/resources/systems/windows/es_find_rules.xml
+++ b/resources/systems/windows/es_find_rules.xml
@@ -189,6 +189,19 @@
             <entry>%ESPATH%\..\PCSX2\pcsx2.exe</entry>
         </rule>
     </emulator>
+    <emulator name="PLAY!">
+        <!-- Sony PlayStation 2 emulator Play! -->
+        <rule type="systempath">
+            <entry>Play.exe</entry>
+        </rule>
+        <rule type="staticpath">
+            <entry>C:\Program Files\Play\Play.exe</entry>
+            <entry>D:\Program Files\Play\Play.exe</entry>
+            <entry>%ESPATH%\Play\Play.exe</entry>
+            <entry>%ESPATH%\Emulators\Play\Play.exe</entry>
+            <entry>%ESPATH%\..\Play\Play.exe</entry>
+        </rule>
+    </emulator>
     <emulator name="PPSSPP">
         <!-- Sony PlayStation Portable emulator PPSSPP -->
         <rule type="winregistryvalue">
diff --git a/resources/systems/windows/es_find_rules_portable.xml b/resources/systems/windows/es_find_rules_portable.xml
index de69fb4d5..eb4c833fe 100644
--- a/resources/systems/windows/es_find_rules_portable.xml
+++ b/resources/systems/windows/es_find_rules_portable.xml
@@ -119,6 +119,14 @@
             <entry>%ESPATH%\..\PCSX2\pcsx2.exe</entry>
         </rule>
     </emulator>
+    <emulator name="PLAY!">
+        <!-- Sony PlayStation 2 emulator Play! -->
+        <rule type="staticpath">
+            <entry>%ESPATH%\Play\Play.exe</entry>
+            <entry>%ESPATH%\Emulators\Play\Play.exe</entry>
+            <entry>%ESPATH%\..\Play\Play.exe</entry>
+        </rule>
+    </emulator>
     <emulator name="PPSSPP">
         <!-- Sony PlayStation Portable emulator PPSSPP -->
         <rule type="staticpath">
diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml
index 6905f3450..e8bf303af 100644
--- a/resources/systems/windows/es_systems.xml
+++ b/resources/systems/windows/es_systems.xml
@@ -969,6 +969,7 @@
         <extension>.bin .BIN .chd .CHD .cso .CSO .elf .ELF .iso .ISO .isz .ISZ</extension>
         <command label="PCSX2">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%\pcsx2_libretro.dll %ROM%</command>
         <command label="PCSX2 (Standalone)">%EMULATOR_PCSX2% --nogui %ROM%</command>
+        <command label="Play! (Standalone)">%EMULATOR_PLAY!% --disc %ROM%</command>
         <platform>ps2</platform>
         <theme>ps2</theme>
     </system>