diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs index 2e61ff4818..809b5cfcde 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs @@ -92,7 +92,7 @@ namespace BizHawk.Client.EmuHawk if (schemaType != null) { - var padschemas = (Activator.CreateInstance(schemaType) as IVirtualPadSchema).GetPadSchemas(); + var padschemas = (Activator.CreateInstance(schemaType) as IVirtualPadSchema).GetPadSchemas(Emulator); if (VersionInfo.DeveloperBuild) { CheckPads(padschemas, Emulator.ControllerDefinition); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A26Schema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A26Schema.cs index c66caede87..9c59c827c3 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A26Schema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A26Schema.cs @@ -1,12 +1,14 @@ using System.Collections.Generic; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("A26")] public class A26Schema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(1); yield return StandardController(2); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A78Schema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A78Schema.cs index fd2fab37fa..c2c4aaa71b 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A78Schema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A78Schema.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Drawing; -using BizHawk.Client.Common; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Atari.Atari7800; namespace BizHawk.Client.EmuHawk @@ -9,9 +9,9 @@ namespace BizHawk.Client.EmuHawk [SchemaAttributes("A78")] public class A78Schema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { - switch ((Global.Emulator as Atari7800).ControlAdapter.ControlType.Name) + switch ((core as Atari7800).ControlAdapter.ControlType.Name) { case "Atari 7800 Joystick Controller": yield return JoystickController(1); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/AppleIISchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/AppleIISchema.cs index ec9bf15be8..3c207fe234 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/AppleIISchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/AppleIISchema.cs @@ -1,12 +1,14 @@ using System.Collections.Generic; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("AppleII")] public class AppleIISchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return Keyboard(); yield return DiskSelection(); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/C64Schema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/C64Schema.cs index 7a4accf22e..2da27c4a79 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/C64Schema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/C64Schema.cs @@ -1,12 +1,14 @@ using System.Collections.Generic; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("C64")] public class C64Schema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(1); yield return StandardController(2); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ColecoSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ColecoSchema.cs index 88885edcbe..4afce97b6e 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ColecoSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ColecoSchema.cs @@ -1,12 +1,14 @@ using System.Collections.Generic; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("Coleco")] public class ColecoSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(1); yield return StandardController(2); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/DualGBSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/DualGBSchema.cs index 35eb14e25c..c215fbaa9c 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/DualGBSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/DualGBSchema.cs @@ -1,13 +1,14 @@ using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk.tools.VirtualPads.schema { [SchemaAttributes("DGB")] public class DualGBSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(1); yield return StandardController(2); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBASchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBASchema.cs index a8ce5437b1..e5f39e4574 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBASchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBASchema.cs @@ -1,12 +1,14 @@ using System.Collections.Generic; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("GBA")] public class GBASchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(); yield return ConsoleButtons(); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBSchema.cs index 6811508cec..ebb0905a10 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBSchema.cs @@ -1,14 +1,14 @@ using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { - [SchemaAttributes("GB")] public class GBSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(); yield return ConsoleButtons(); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs index 322fbfa9fb..a9d7222669 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Drawing; -using BizHawk.Client.Common; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Consoles.Sega.gpgx; namespace BizHawk.Client.EmuHawk @@ -9,9 +9,9 @@ namespace BizHawk.Client.EmuHawk [SchemaAttributes("GEN")] public class GenSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { - var devs = ((GPGX)Global.Emulator).GetDevices(); + var devs = ((GPGX)core).GetDevices(); int player = 1; foreach (var dev in devs) { diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/IVirtualPadSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/IVirtualPadSchema.cs index 7f66d2b33c..7c4d5935a1 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/IVirtualPadSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/IVirtualPadSchema.cs @@ -1,9 +1,10 @@ using System.Collections.Generic; +using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { public interface IVirtualPadSchema { - IEnumerable GetPadSchemas(); + IEnumerable GetPadSchemas(IEmulator core); } } diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/LynxSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/LynxSchema.cs index ff06e4ea74..a16dc665d2 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/LynxSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/LynxSchema.cs @@ -1,12 +1,14 @@ using System.Collections.Generic; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("Lynx")] public class LYNXSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(); //yield return ConsoleButtons(); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/N64Schema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/N64Schema.cs index aa3ecbfa1d..0c8432f50f 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/N64Schema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/N64Schema.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Drawing; -using BizHawk.Client.Common; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Nintendo.N64; namespace BizHawk.Client.EmuHawk @@ -9,9 +9,9 @@ namespace BizHawk.Client.EmuHawk [SchemaAttributes("N64")] public class N64Schema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { - var ss = ((N64)Global.Emulator).GetSyncSettings(); + var ss = ((N64)core).GetSyncSettings(); for (var i = 0; i < 4; i++) { if (ss.Controllers[i].IsConnected) diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NesSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NesSchema.cs index 9d2151d83e..560cc98391 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NesSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NesSchema.cs @@ -1,22 +1,23 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Drawing; using System.Linq; -using BizHawk.Client.Common; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Nintendo.NES; using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES; -using System; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("NES")] public class NesSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { - if (Global.Emulator is NES) + if (core is NES) { - var ss = ((NES)Global.Emulator).GetSyncSettings(); - var core = (Global.Emulator as NES); + var ss = (core as NES).GetSyncSettings(); + var isFds = core.BoardName == "FDS"; if (ss.Controls.Famicom) { @@ -124,7 +125,7 @@ namespace BizHawk.Client.EmuHawk else // Quicknes Can support none, one or two controllers. { - var ss = ((QuickNES)Global.Emulator).GetSyncSettings(); + var ss = ((QuickNES)core).GetSyncSettings(); if (ss.LeftPortConnected == true && ss.RightPortConnected == true) { //Set both controllers diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs index d2b0b00819..c7c90806f5 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Drawing; -using BizHawk.Client.Common; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Sony.PSX; namespace BizHawk.Client.EmuHawk @@ -9,9 +9,9 @@ namespace BizHawk.Client.EmuHawk [SchemaAttributes("PSX")] public class PSXSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { - var psx = ((Octoshock)Global.Emulator); + var psx = ((Octoshock)core); var settings = (Octoshock.SyncSettings)psx.GetSyncSettings(); var fioConfig = settings.FIOConfig.ToLogical(); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs index ae7bcca78c..550aa2fc5b 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Drawing; -using BizHawk.Client.Common; +using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { @@ -11,9 +11,9 @@ namespace BizHawk.Client.EmuHawk [SchemaAttributes("PCE")] public class PceSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { - for (var i = 0; i < Global.Emulator.ControllerDefinition.PlayerCount; i++) + for (var i = 0; i < core.ControllerDefinition.PlayerCount; i++) { yield return StandardController(i + 1); } diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SatSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SatSchema.cs index 31e25d2070..f5499dca13 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SatSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SatSchema.cs @@ -1,12 +1,14 @@ using System.Collections.Generic; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("SAT")] public class SaturnSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(1); yield return StandardController(2); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SmsSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SmsSchema.cs index 5b6064b0bc..8c09234813 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SmsSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SmsSchema.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Drawing; -using BizHawk.Client.Common; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Sega.MasterSystem; namespace BizHawk.Client.EmuHawk @@ -9,9 +9,9 @@ namespace BizHawk.Client.EmuHawk [SchemaAttributes("SMS")] public class SmsSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { - if ((Global.Emulator as SMS).IsGameGear) + if ((core as SMS).IsGameGear) { yield return GGController(1); yield return GGConsoleButtons(); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs index b83bd3d1f9..7098b73803 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs @@ -1,16 +1,16 @@ using System.Collections.Generic; using System.Drawing; -using BizHawk.Client.Common; +using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { [SchemaAttributes("SNES")] public class SnesSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { - for (var i = 0; i < Global.Emulator.ControllerDefinition.PlayerCount; i++) + for (var i = 0; i < core.ControllerDefinition.PlayerCount; i++) { yield return StandardController(i + 1); } diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/WonderSwanSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/WonderSwanSchema.cs index c866bc8d24..8c16f87e4c 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/WonderSwanSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/WonderSwanSchema.cs @@ -1,12 +1,14 @@ using System.Collections.Generic; using System.Drawing; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.EmuHawk { [SchemaAttributes("WSWAN")] public class WonderSwanSchema : IVirtualPadSchema { - public IEnumerable GetPadSchemas() + public IEnumerable GetPadSchemas(IEmulator core) { yield return StandardController(1); yield return RotatedController(2);