From 4eda12a8b0dddfc922b251f6f8f4c055a5bad5ff Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 1 Feb 2015 14:02:01 +0000 Subject: [PATCH] PSX - Virtualpad - pay attention to the number of conntected controllers - still todo: schema for Gamepad and DualAnalog --- .../tools/VirtualPads/schema/PSXSchema.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs index 84548bcef4..034381029f 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs @@ -12,8 +12,17 @@ namespace BizHawk.Client.EmuHawk public IEnumerable GetPadSchemas() { var psx = ((Octoshock)Global.Emulator); - yield return DualShockController(1); - yield return DualShockController(2); + var settings = (Octoshock.SyncSettings)psx.GetSyncSettings(); + + // TODO: support other types + for (int i = 0; i < settings.Controllers.Length; i++) + { + if (settings.Controllers[i].IsConnected) + { + yield return DualShockController(i + 1); + } + } + yield return ConsoleButtons(psx); }