diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs index f149ee1909..ffd4b5302b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Drawing; - +using System.Linq; +using System.Windows.Forms; using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Nintendo.SNES; using BizHawk.Emulation.Cores.Nintendo.SNES9X; +using BizHawk.Emulation.Cores.Waterbox; namespace BizHawk.Client.EmuHawk { @@ -18,6 +20,11 @@ namespace BizHawk.Client.EmuHawk return GetBsnesPadSchemas(bsnes); } + if (core is NymaCore nyma) + { + return GetFaustSchemas(nyma); + } + return GetSnes9xPadSchemas((Snes9x)core); } private IEnumerable GetSnes9xPadSchemas(Snes9x core) @@ -108,6 +115,25 @@ namespace BizHawk.Client.EmuHawk yield return ConsoleButtons(); } + private static IEnumerable GetFaustSchemas(NymaCore nyma) + { + foreach (NymaCore.PortResult result in nyma.ActualPortData) + { + var num = int.Parse(result.Port.ShortName.Last().ToString()); + var device = result.Device.ShortName; + if (device == "gamepad") + { + yield return StandardController(num); + } + else if (device != "none") + { + MessageBox.Show($"Controller type {device} not supported yet."); + } + } + + yield return ConsoleButtons(); + } + private static PadSchema StandardController(int controller) { return new PadSchema @@ -249,4 +275,4 @@ namespace BizHawk.Client.EmuHawk }; } } -} +} \ No newline at end of file