Skip to content

Commit

Permalink
resolve #19, Add support for XBSX2
Browse files Browse the repository at this point in the history
  • Loading branch information
retropassdev committed Sep 19, 2022
1 parent e4ec205 commit 8551efa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 9 additions & 1 deletion RetroPass/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public enum EEmulatorType
{
retroarch,
rgx,
xbsx2,
}
public string Name { get; set; }
public string SourceName { get; set; }
Expand All @@ -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;
}
Expand Down
12 changes: 12 additions & 0 deletions RetroPass/UrlSchemeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
}
}
}

0 comments on commit 8551efa

Please sign in to comment.