From 8551efa9cbf684e45b1861bd920c89bd31a588f4 Mon Sep 17 00:00:00 2001 From: retropassdev Date: Mon, 19 Sep 2022 15:48:52 +0200 Subject: [PATCH] resolve #19, Add support for XBSX2 --- RetroPass/Platform.cs | 10 +++++++++- RetroPass/UrlSchemeGenerator.cs | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/RetroPass/Platform.cs b/RetroPass/Platform.cs index 0483297..9f814d5 100644 --- a/RetroPass/Platform.cs +++ b/RetroPass/Platform.cs @@ -9,6 +9,7 @@ public enum EEmulatorType { retroarch, rgx, + xbsx2, } public string Name { get; set; } public string SourceName { get; set; } @@ -29,7 +30,14 @@ public void SetEmulatorType(string emulatorPath) EmulatorType = EEmulatorType.retroarch; } else */ - if (string.IsNullOrEmpty(emulatorPath) == false && emulatorPath.Contains("retrix", System.StringComparison.CurrentCultureIgnoreCase)) + if (string.IsNullOrEmpty(emulatorPath) == false && + (emulatorPath.Contains("pcsx2", System.StringComparison.CurrentCultureIgnoreCase) || + emulatorPath.Contains("xbsx2", System.StringComparison.CurrentCultureIgnoreCase)) + ) + { + EmulatorType = EEmulatorType.xbsx2; + } + else if (string.IsNullOrEmpty(emulatorPath) == false && emulatorPath.Contains("retrix", System.StringComparison.CurrentCultureIgnoreCase)) { EmulatorType = EEmulatorType.rgx; } diff --git a/RetroPass/UrlSchemeGenerator.cs b/RetroPass/UrlSchemeGenerator.cs index f013f73..439b9f7 100644 --- a/RetroPass/UrlSchemeGenerator.cs +++ b/RetroPass/UrlSchemeGenerator.cs @@ -16,12 +16,16 @@ public static string GetUrl(Game game) case Platform.EEmulatorType.rgx: url = GetUrlRetrix(game); break; + case Platform.EEmulatorType.xbsx2: + url = GetUrlXBSX2(game); + break; default: break; } return url; } + private static string GetUrlRetroarch(Game game) { string args = "cmd=" + "retroarch"; @@ -42,5 +46,13 @@ private static string GetUrlRetrix(Game game) args += " &launchOnExit=" + "retropass:"; return game.GamePlatform.EmulatorType.ToString() + ":?" + args; } + + private static string GetUrlXBSX2(Game game) + { + string args = "cmd=" + "pcsx2.exe"; + args += " \"" + Uri.EscapeDataString(game.ApplicationPathFull) + "\""; + args += "&launchOnExit=" + "retropass:"; + return game.GamePlatform.EmulatorType.ToString() + ":?" + args; + } } }