cleanup virtualpad code
This commit is contained in:
parent
0f33e2b1e7
commit
b390c2829c
|
@ -7,6 +7,7 @@ using BizHawk.Emulation.Cores.Atari.Atari2600;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("A26")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class A26Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -9,6 +9,7 @@ using BizHawk.Emulation.Cores.Atari.A7800Hawk;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("A78")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class A78Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
@ -19,15 +20,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
internal static class Atari7800HawkSchema
|
||||
{
|
||||
private static string UnpluggedControllerName => typeof(UnpluggedController).DisplayName();
|
||||
private static string StandardControllerName => typeof(StandardController).DisplayName();
|
||||
private static string ProLineControllerName => typeof(ProLineController).DisplayName();
|
||||
|
||||
public static IEnumerable<PadSchema> GetPadSchemas(A7800Hawk core)
|
||||
{
|
||||
var A78SyncSettings = core.GetSyncSettings().Clone();
|
||||
var port1 = A78SyncSettings.Port1;
|
||||
var port2 = A78SyncSettings.Port2;
|
||||
var a78SyncSettings = core.GetSyncSettings().Clone();
|
||||
var port1 = a78SyncSettings.Port1;
|
||||
var port2 = a78SyncSettings.Port2;
|
||||
|
||||
if (port1 == StandardControllerName)
|
||||
{
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("AppleII")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class AppleIISchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("C64")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class C64Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -7,6 +7,7 @@ using BizHawk.Emulation.Cores.ColecoVision;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("Coleco")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class ColecoSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("DGB")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class DualGBSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -7,6 +7,7 @@ using BizHawk.Emulation.Cores.Nintendo.GBA;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("GBA")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class GBASchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("GB")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class GBSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("GGL")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class GGLSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -3,24 +3,24 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
|
||||
using BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("GEN")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class GenSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
{
|
||||
if (core is GPGX)
|
||||
if (core is GPGX gpgx)
|
||||
{
|
||||
return GpgxPadSchemas((GPGX)core);
|
||||
return GpgxPadSchemas(gpgx);
|
||||
}
|
||||
|
||||
return PicoPadSchemas((PicoDrive)core);
|
||||
return PicoPadSchemas();
|
||||
}
|
||||
|
||||
private IEnumerable<PadSchema> PicoPadSchemas(PicoDrive core)
|
||||
private IEnumerable<PadSchema> PicoPadSchemas()
|
||||
{
|
||||
yield return SixButtonController(1);
|
||||
yield return SixButtonController(2);
|
||||
|
@ -29,9 +29,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private IEnumerable<PadSchema> GpgxPadSchemas(GPGX core)
|
||||
{
|
||||
var devs = (core).GetDevices();
|
||||
var devices = core.GetDevices();
|
||||
int player = 1;
|
||||
foreach (var dev in devs)
|
||||
foreach (var dev in devices)
|
||||
{
|
||||
switch (dev)
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
yield return Activator(player);
|
||||
break;
|
||||
case LibGPGX.INPUT_DEVICE.DEVICE_XE_A1P:
|
||||
yield return XE1AP(player);
|
||||
yield return Xe1AP(player);
|
||||
break;
|
||||
default:
|
||||
// TO DO
|
||||
|
@ -429,7 +429,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
};
|
||||
}
|
||||
|
||||
private static PadSchema XE1AP(int controller)
|
||||
private static PadSchema Xe1AP(int controller)
|
||||
{
|
||||
return new PadSchema
|
||||
{
|
||||
|
|
|
@ -8,6 +8,7 @@ using BizHawk.Emulation.Cores.Intellivision;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("INTV")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class IntvSchema : IVirtualPadSchema
|
||||
{
|
||||
private string StandardControllerName => typeof(StandardController).DisplayName();
|
||||
|
|
|
@ -6,12 +6,12 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("Lynx")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class LynxSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
{
|
||||
yield return StandardController();
|
||||
//yield return ConsoleButtons();
|
||||
}
|
||||
|
||||
private static PadSchema StandardController()
|
||||
|
|
|
@ -7,6 +7,7 @@ using BizHawk.Emulation.Cores.Nintendo.N64;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("N64")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class N64Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -11,17 +11,29 @@ using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("NES")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class NesSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
{
|
||||
if (core is NES)
|
||||
if (core is NES || core is SubNESHawk)
|
||||
{
|
||||
var nes = (NES)core;
|
||||
NES.NESSyncSettings ss = null;
|
||||
bool isFds = false;
|
||||
int fdsButtonCount = 0;
|
||||
if (core is NES nesHawk)
|
||||
{
|
||||
ss = nesHawk.GetSyncSettings();
|
||||
isFds = nesHawk.IsFDS;
|
||||
fdsButtonCount = nesHawk.ControllerDefinition.BoolButtons.Count(b => b.StartsWith("FDS Insert "));
|
||||
}
|
||||
else if (core is SubNESHawk subNesHawk)
|
||||
{
|
||||
ss = subNesHawk.GetSyncSettings();
|
||||
isFds = subNesHawk.IsFDS;
|
||||
fdsButtonCount = subNesHawk.ControllerDefinition.BoolButtons.Count(b => b.StartsWith("FDS Insert "));
|
||||
}
|
||||
|
||||
var ss = nes.GetSyncSettings();
|
||||
|
||||
var isFds = nes.IsFDS;
|
||||
if (ss.Controls.Famicom)
|
||||
{
|
||||
yield return StandardController(1);
|
||||
|
@ -52,7 +64,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else
|
||||
{
|
||||
var currentControlerNo = 1;
|
||||
var currentControllerNo = 1;
|
||||
switch (ss.Controls.NesLeftPort)
|
||||
{
|
||||
default:
|
||||
|
@ -60,24 +72,24 @@ namespace BizHawk.Client.EmuHawk
|
|||
break;
|
||||
case "ControllerNES":
|
||||
yield return StandardController(1);
|
||||
currentControlerNo++;
|
||||
currentControllerNo++;
|
||||
break;
|
||||
case "Zapper":
|
||||
yield return Zapper(1);
|
||||
currentControlerNo++;
|
||||
currentControllerNo++;
|
||||
break;
|
||||
case "ArkanoidNES":
|
||||
yield return ArkanoidPaddle(1);
|
||||
currentControlerNo++;
|
||||
currentControllerNo++;
|
||||
break;
|
||||
case "FourScore":
|
||||
yield return StandardController(1);
|
||||
yield return StandardController(2);
|
||||
currentControlerNo += 2;
|
||||
currentControllerNo += 2;
|
||||
break;
|
||||
case "PowerPad":
|
||||
yield return PowerPad(1);
|
||||
currentControlerNo++;
|
||||
currentControllerNo++;
|
||||
break;
|
||||
case "ControllerSNES":
|
||||
throw new Exception("TODO");
|
||||
|
@ -89,27 +101,27 @@ namespace BizHawk.Client.EmuHawk
|
|||
case "UnpluggedNES":
|
||||
break;
|
||||
case "ControllerNES":
|
||||
yield return StandardController(currentControlerNo);
|
||||
yield return StandardController(currentControllerNo);
|
||||
break;
|
||||
case "Zapper":
|
||||
yield return Zapper(currentControlerNo);
|
||||
yield return Zapper(currentControllerNo);
|
||||
break;
|
||||
case "ArkanoidNES":
|
||||
yield return ArkanoidPaddle(currentControlerNo);
|
||||
yield return ArkanoidPaddle(currentControllerNo);
|
||||
break;
|
||||
case "FourScore":
|
||||
yield return StandardController(currentControlerNo);
|
||||
yield return StandardController(currentControlerNo + 1);
|
||||
currentControlerNo += 2;
|
||||
yield return StandardController(currentControllerNo);
|
||||
yield return StandardController(currentControllerNo + 1);
|
||||
currentControllerNo += 2;
|
||||
break;
|
||||
case "PowerPad":
|
||||
yield return PowerPad(currentControlerNo);
|
||||
yield return PowerPad(currentControllerNo);
|
||||
break;
|
||||
case "ControllerSNES":
|
||||
throw new Exception("TODO");
|
||||
}
|
||||
|
||||
if (currentControlerNo == 0)
|
||||
if (currentControllerNo == 0)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
@ -117,139 +129,28 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (isFds)
|
||||
{
|
||||
yield return FdsConsoleButtons(core.ControllerDefinition.BoolButtons.Count(b => b.StartsWith("FDS Insert ")));
|
||||
yield return FdsConsoleButtons(fdsButtonCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return NesConsoleButtons();
|
||||
}
|
||||
}
|
||||
else if (core is SubNESHawk)
|
||||
{
|
||||
{
|
||||
var nes = (SubNESHawk)core;
|
||||
|
||||
var ss = nes.GetSyncSettings();
|
||||
|
||||
var isFds = nes.IsFDS;
|
||||
if (ss.Controls.Famicom)
|
||||
{
|
||||
yield return StandardController(1);
|
||||
yield return Famicom2ndController();
|
||||
|
||||
switch (ss.Controls.FamicomExpPort)
|
||||
{
|
||||
default:
|
||||
case "UnpluggedFam":
|
||||
break;
|
||||
case "Zapper":
|
||||
yield return Zapper(3);
|
||||
break;
|
||||
case "ArkanoidFam":
|
||||
yield return ArkanoidPaddle(3);
|
||||
break;
|
||||
case "Famicom4P":
|
||||
yield return StandardController(3);
|
||||
yield return StandardController(4);
|
||||
break;
|
||||
case "FamilyBasicKeyboard":
|
||||
yield return FamicomFamilyKeyboard(3);
|
||||
break;
|
||||
case "OekaKids":
|
||||
yield return OekaKidsTablet(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var currentControlerNo = 1;
|
||||
switch (ss.Controls.NesLeftPort)
|
||||
{
|
||||
default:
|
||||
case "UnpluggedNES":
|
||||
break;
|
||||
case "ControllerNES":
|
||||
yield return StandardController(1);
|
||||
currentControlerNo++;
|
||||
break;
|
||||
case "Zapper":
|
||||
yield return Zapper(1);
|
||||
currentControlerNo++;
|
||||
break;
|
||||
case "ArkanoidNES":
|
||||
yield return ArkanoidPaddle(1);
|
||||
currentControlerNo++;
|
||||
break;
|
||||
case "FourScore":
|
||||
yield return StandardController(1);
|
||||
yield return StandardController(2);
|
||||
currentControlerNo += 2;
|
||||
break;
|
||||
case "PowerPad":
|
||||
yield return PowerPad(1);
|
||||
currentControlerNo++;
|
||||
break;
|
||||
case "ControllerSNES":
|
||||
throw new Exception("TODO");
|
||||
}
|
||||
|
||||
switch (ss.Controls.NesRightPort)
|
||||
{
|
||||
default:
|
||||
case "UnpluggedNES":
|
||||
break;
|
||||
case "ControllerNES":
|
||||
yield return StandardController(currentControlerNo);
|
||||
break;
|
||||
case "Zapper":
|
||||
yield return Zapper(currentControlerNo);
|
||||
break;
|
||||
case "ArkanoidNES":
|
||||
yield return ArkanoidPaddle(currentControlerNo);
|
||||
break;
|
||||
case "FourScore":
|
||||
yield return StandardController(currentControlerNo);
|
||||
yield return StandardController(currentControlerNo + 1);
|
||||
currentControlerNo += 2;
|
||||
break;
|
||||
case "PowerPad":
|
||||
yield return PowerPad(currentControlerNo);
|
||||
break;
|
||||
case "ControllerSNES":
|
||||
throw new Exception("TODO");
|
||||
}
|
||||
|
||||
if (currentControlerNo == 0)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (isFds)
|
||||
{
|
||||
yield return FdsConsoleButtons(core.ControllerDefinition.BoolButtons.Count(b => b.StartsWith("FDS Insert ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return NesConsoleButtons();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
// Quicknes Can support none, one or two controllers.
|
||||
{
|
||||
var ss = ((QuickNES)core).GetSyncSettings();
|
||||
if (ss.LeftPortConnected == true && ss.RightPortConnected == true)
|
||||
if (ss.LeftPortConnected && ss.RightPortConnected)
|
||||
{
|
||||
// Set both controllers
|
||||
yield return StandardController(1);
|
||||
yield return StandardController(2);
|
||||
}
|
||||
else if (ss.LeftPortConnected == true && ss.RightPortConnected == false)
|
||||
else if (ss.LeftPortConnected && !ss.RightPortConnected)
|
||||
{
|
||||
yield return StandardController(1);
|
||||
}
|
||||
else if (ss.LeftPortConnected == false && ss.RightPortConnected == true)
|
||||
else if (!ss.LeftPortConnected && ss.RightPortConnected)
|
||||
{
|
||||
yield return StandardController(1);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("NGP")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class NgpSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -7,6 +7,7 @@ using BizHawk.Emulation.Cores.Consoles.O2Hawk;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("O2")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class O2Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -8,6 +8,7 @@ using BizHawk.Emulation.Cores.Sony.PSX;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("PSX")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class PSXSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
@ -23,20 +24,20 @@ namespace BizHawk.Client.EmuHawk
|
|||
continue;
|
||||
}
|
||||
|
||||
int pnum = i + 1;
|
||||
int pNum = i + 1;
|
||||
if (fioConfig.DevicesPlayer[i] == OctoshockDll.ePeripheralType.DualAnalog || fioConfig.DevicesPlayer[i] == OctoshockDll.ePeripheralType.DualShock)
|
||||
{
|
||||
yield return DualShockController(pnum);
|
||||
yield return DualShockController(pNum);
|
||||
}
|
||||
|
||||
if (fioConfig.DevicesPlayer[i] == OctoshockDll.ePeripheralType.Pad)
|
||||
{
|
||||
yield return GamePadController(pnum);
|
||||
yield return GamePadController(pNum);
|
||||
}
|
||||
|
||||
if (fioConfig.DevicesPlayer[i] == OctoshockDll.ePeripheralType.NegCon)
|
||||
{
|
||||
yield return NeGcon(pnum);
|
||||
yield return NeGcon(pNum);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Boolean, // A single on/off button
|
||||
AnalogStick, // An analog stick X,Y Pair
|
||||
FloatSingle, // A single analog button (pressure sensitive button for instance)
|
||||
TargetedPair, // A X,Y pair intended to be a screen cooridnate (for zappers, mouse, stylus, etc)
|
||||
TargetedPair, // A X,Y pair intended to be a screen coordinate (for zappers, mouse, stylus, etc)
|
||||
DiscManager
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public int MinValueSec { get; set; }
|
||||
public object OwnerEmulator { get; set; }
|
||||
|
||||
public Orientation Orientation { get; set; } // For Single Flaot controls
|
||||
public Orientation Orientation { get; set; } // For Single Float controls
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ using BizHawk.Emulation.Cores.PCEngine;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("PCECD")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class PceCdSchema : PceSchema { }
|
||||
|
||||
[Schema("PCE")]
|
||||
|
|
|
@ -1,29 +1,28 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Consoles.NEC.PCFX;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("PCFX")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class PcfxSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
{
|
||||
var ss = ((Tst)core).GetSyncSettings();
|
||||
|
||||
List<PadSchema> _schemas = new List<PadSchema>();
|
||||
var schemas = new List<PadSchema>();
|
||||
if (ss.Port1 != ControllerType.None || ss.Port2 != ControllerType.None)
|
||||
{
|
||||
switch (ss.Port1)
|
||||
{
|
||||
case ControllerType.Gamepad:
|
||||
_schemas.Add(StandardController(1));
|
||||
schemas.Add(StandardController(1));
|
||||
break;
|
||||
case ControllerType.Mouse:
|
||||
_schemas.Add(Mouse(1));
|
||||
schemas.Add(Mouse(1));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -31,15 +30,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
switch (ss.Port2)
|
||||
{
|
||||
case ControllerType.Gamepad:
|
||||
_schemas.Add(StandardController(controllerNum));
|
||||
schemas.Add(StandardController(controllerNum));
|
||||
break;
|
||||
case ControllerType.Mouse:
|
||||
_schemas.Add(Mouse(controllerNum));
|
||||
schemas.Add(Mouse(controllerNum));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return _schemas;
|
||||
return schemas;
|
||||
}
|
||||
|
||||
private static PadSchema StandardController(int controller)
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("SGB")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class SGBSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -9,6 +9,7 @@ using BizHawk.Emulation.Cores.Consoles.Sega.Saturn;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("SAT")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class SaturnSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
@ -17,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
int totalPorts = (ss.Port1Multitap ? 6 : 1) + (ss.Port2Multitap ? 6 : 1);
|
||||
|
||||
var padSchemas = new SaturnusControllerDeck.Device[]
|
||||
var padSchemas = new[]
|
||||
{
|
||||
ss.Port1,
|
||||
ss.Port2,
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// <summary>
|
||||
/// Gets the system id associated with this schema
|
||||
/// </summary>
|
||||
public string SystemId { get; private set; }
|
||||
public string SystemId { get; }
|
||||
|
||||
public SchemaAttribute(string systemId)
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@ using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("SMS")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class SmsSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -8,23 +8,24 @@ using BizHawk.Emulation.Cores.Nintendo.SNES9X;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("SNES")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class SnesSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
{
|
||||
if (core is LibsnesCore)
|
||||
if (core is LibsnesCore bsnes)
|
||||
{
|
||||
return GetBsnesPadSchemas(core);
|
||||
return GetBsnesPadSchemas(bsnes);
|
||||
}
|
||||
|
||||
return GetSnes9xPadSchemas(core);
|
||||
return GetSnes9xPadSchemas((Snes9x)core);
|
||||
}
|
||||
private IEnumerable<PadSchema> GetSnes9xPadSchemas(IEmulator core)
|
||||
private IEnumerable<PadSchema> GetSnes9xPadSchemas(Snes9x core)
|
||||
{
|
||||
// Only standard controller is supported on the left port
|
||||
yield return StandardController(1);
|
||||
|
||||
Snes9x.SyncSettings syncSettings = ((Snes9x)core).GetSyncSettings();
|
||||
Snes9x.SyncSettings syncSettings = core.GetSyncSettings();
|
||||
LibSnes9x.RightPortDevice rightPort = syncSettings.RightPort;
|
||||
|
||||
switch (rightPort)
|
||||
|
@ -53,14 +54,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
yield return ConsoleButtons();
|
||||
}
|
||||
|
||||
private IEnumerable<PadSchema> GetBsnesPadSchemas(IEmulator core)
|
||||
private IEnumerable<PadSchema> GetBsnesPadSchemas(LibsnesCore core)
|
||||
{
|
||||
var syncsettings = ((LibsnesCore)core).GetSyncSettings();
|
||||
var syncSettings = core.GetSyncSettings();
|
||||
|
||||
var ports = new[]
|
||||
{
|
||||
syncsettings.LeftPort,
|
||||
syncsettings.RightPort
|
||||
syncSettings.LeftPort,
|
||||
syncSettings.RightPort
|
||||
};
|
||||
|
||||
int offset = 0;
|
||||
|
@ -252,7 +253,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
return new PadSchema
|
||||
{
|
||||
DisplayName = "Superscope",
|
||||
DisplayName = "Super Scope",
|
||||
IsConsole = false,
|
||||
DefaultSize = new Size(356, 290),
|
||||
MaxSize = new Size(356, 290),
|
||||
|
|
|
@ -7,13 +7,14 @@ using BizHawk.Emulation.Cores.Consoles.Vectrex;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("VEC")]
|
||||
public class VECSchema : IVirtualPadSchema
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class VecSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
{
|
||||
var VECSyncSettings = ((VectrexHawk)core).GetSyncSettings().Clone();
|
||||
var port1 = VECSyncSettings.Port1;
|
||||
var port2 = VECSyncSettings.Port2;
|
||||
var vecSyncSettings = ((VectrexHawk)core).GetSyncSettings().Clone();
|
||||
var port1 = vecSyncSettings.Port1;
|
||||
var port2 = vecSyncSettings.Port2;
|
||||
|
||||
if (port1 == "Vectrex Digital Controller")
|
||||
{
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("VB")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class VirtualBoySchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,6 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("WSWAN")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class WonderSwanSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
using System.Drawing;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using System.Linq;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Schema("ZXSpectrum")]
|
||||
class ZXSpectrumSchema : IVirtualPadSchema
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
class ZxSpectrumSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
DisplayName = $"Joystick {controller}",
|
||||
IsConsole = false,
|
||||
DefaultSize = new Size(174, 74),
|
||||
MaxSize = new Size(174, 74),
|
||||
MaxSize = new Size(174, 74),
|
||||
Buttons = new[]
|
||||
{
|
||||
new PadSchema.ButtonSchema
|
||||
|
@ -77,12 +77,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
public string DisName { get; set; }
|
||||
public double WidthFactor { get; set; }
|
||||
public int Row { get; set; }
|
||||
public bool IsActive = true;
|
||||
public bool IsActive { get; } = true;
|
||||
}
|
||||
|
||||
private static PadSchema Keyboard()
|
||||
{
|
||||
List<ButtonLayout> bls = new List<ButtonLayout>
|
||||
var bls = new List<ButtonLayout>
|
||||
{
|
||||
new ButtonLayout { Name = "Key True Video", DisName = "TV", Row = 0, WidthFactor = 1 },
|
||||
new ButtonLayout { Name = "Key Inv Video", DisName = "IV", Row = 0, WidthFactor = 1 },
|
||||
|
@ -148,14 +148,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
new ButtonLayout { Name = "Key Symbol Shift", DisName = "SS", Row = 4, WidthFactor = 1 },
|
||||
};
|
||||
|
||||
PadSchema ps = new PadSchema
|
||||
var ps = new PadSchema
|
||||
{
|
||||
DisplayName = "Keyboard",
|
||||
IsConsole = false,
|
||||
DefaultSize = new Size(500, 170)
|
||||
};
|
||||
|
||||
List<PadSchema.ButtonSchema> btns = new List<PadSchema.ButtonSchema>();
|
||||
var btns = new List<PadSchema.ButtonSchema>();
|
||||
|
||||
int rowHeight = 29; //24
|
||||
int stdButtonWidth = 29; //24
|
||||
|
@ -186,18 +186,19 @@ namespace BizHawk.Client.EmuHawk
|
|||
case "I": disp = $" {disp} "; break;
|
||||
case "W": disp = b.DisName; break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (b.IsActive)
|
||||
{
|
||||
PadSchema.ButtonSchema btn = new PadSchema.ButtonSchema();
|
||||
btn.Name = b.Name;
|
||||
btn.DisplayName = disp;
|
||||
btn.Location = new Point(xPos, yPos);
|
||||
btn.Type = PadSchema.PadInputType.Boolean;
|
||||
var btn = new PadSchema.ButtonSchema
|
||||
{
|
||||
Name = b.Name,
|
||||
DisplayName = disp,
|
||||
Location = new Point(xPos, yPos),
|
||||
Type = PadSchema.PadInputType.Boolean
|
||||
};
|
||||
btns.Add(btn);
|
||||
}
|
||||
|
||||
|
||||
xPos += btnSize;
|
||||
}
|
||||
|
||||
|
|
|
@ -182,6 +182,7 @@
|
|||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=addr/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=amstrad/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Arkanoid/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=atten/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Autofire/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=autoflushing/@EntryIndexedValue">True</s:Boolean>
|
||||
|
@ -201,6 +202,7 @@
|
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Bools/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=botting/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=bsnes/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=btns/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Bundler/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Byteswap/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=chromeless/@EntryIndexedValue">True</s:Boolean>
|
||||
|
@ -252,6 +254,7 @@
|
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gameboy/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=gamedb/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=gamepad/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gcon/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=gpgx/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Grafx/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=greenzone/@EntryIndexedValue">True</s:Boolean>
|
||||
|
@ -306,6 +309,7 @@
|
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Numerics/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=nvidia/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Objs/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Oeka/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=opcode/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=opengl/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Overdump/@EntryIndexedValue">True</s:Boolean>
|
||||
|
@ -314,6 +318,7 @@
|
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=PCSX/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=performant/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Phaser/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pico/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=pinvoked/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pollable/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Prefs/@EntryIndexedValue">True</s:Boolean>
|
||||
|
|
Loading…
Reference in New Issue