diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs index 0361da8dbd..c110565b5c 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs @@ -84,8 +84,11 @@ namespace BizHawk.Client.EmuHawk if (schemaType != null) { - var pads = (Activator.CreateInstance(schemaType) as IVirtualPadSchema).GetPads(); - ControllerBox.Controls.AddRange(pads.Reverse().ToArray()); + var pads = (Activator.CreateInstance(schemaType) as IVirtualPadSchema).GetPads() ?? Enumerable.Empty(); + if (pads.Any()) + { + ControllerBox.Controls.AddRange(pads.Reverse().ToArray()); + } } } diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs index cd888c24f3..aacd30162a 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.Drawing; using BizHawk.Client.Common; +using BizHawk.Emulation.Cores.Consoles.Sega.gpgx; namespace BizHawk.Client.EmuHawk { @@ -11,9 +12,31 @@ namespace BizHawk.Client.EmuHawk { public IEnumerable GetPads() { - yield return new VirtualPad(ThreeButtonController(1)); - - yield return new VirtualPad(SixButtonController(2)); + var ss = (GPGX.GPGXSyncSettings)Global.Emulator.GetSyncSettings(); + if (ss.ControlType == GPGX.ControlType.OnePlayer) + { + if (ss.UseSixButton) + { + yield return new VirtualPad(ThreeButtonController(1)); + } + } + else if (ss.ControlType == GPGX.ControlType.Normal) + { + if (ss.UseSixButton) + { + yield return new VirtualPad(ThreeButtonController(1)); + yield return new VirtualPad(ThreeButtonController(2)); + } + else + { + yield return new VirtualPad(SixButtonController(1)); + yield return new VirtualPad(SixButtonController(2)); + } + } + else + { + yield return null; + } } public static PadSchema ThreeButtonController(int controller)