Move Virtual Pads schemata to Cores
This commit is contained in:
parent
790a09067e
commit
03b4ae18e0
|
@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Type schemaType;
|
||||
try
|
||||
{
|
||||
schemaType = EmuHawk.ReflectionCache.Types.Where(typeof(IVirtualPadSchema).IsAssignableFrom)
|
||||
schemaType = Emulation.Cores.ReflectionCache.Types.Where(typeof(IVirtualPadSchema).IsAssignableFrom)
|
||||
.Select(t => (SchemaType: t, Attr: t.GetCustomAttributes(false).OfType<SchemaAttribute>().FirstOrDefault()))
|
||||
.First(tuple => tuple.Attr?.SystemId == Emulator.SystemId)
|
||||
.SchemaType;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Common
|
||||
{
|
||||
public interface IVirtualPadSchema
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Common
|
||||
{
|
||||
public class PadSchema
|
||||
{
|
|
@ -5,7 +5,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Common
|
||||
{
|
||||
public abstract class PadSchemaControl
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Common
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public sealed class SchemaAttribute : Attribute
|
|
@ -5,7 +5,7 @@ using System.Drawing;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Atari.Atari2600;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("A26")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Common;
|
|||
using BizHawk.Common.ReflectionExtensions;
|
||||
using BizHawk.Emulation.Cores.Atari.A7800Hawk;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("A78")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("AppleII")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("C64")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.ColecoVision;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("Coleco")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
|
@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core, Action<string> showMessageBox)
|
||||
{
|
||||
var deck = ((ColecoVision)core).ControllerDeck;
|
||||
var deck = ((ColecoVision.ColecoVision) core).ControllerDeck;
|
||||
var ports = new[] { deck.Port1.GetType(), deck.Port2.GetType() };
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("DGB")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -5,7 +5,7 @@ using System.Drawing;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Nintendo.GBA;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("GBA")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("GB")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("GGL")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -6,7 +6,7 @@ using System.Linq;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("GEN")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -7,7 +7,7 @@ using BizHawk.Common.ReflectionExtensions;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Intellivision;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("INTV")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
|
@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core, Action<string> showMessageBox)
|
||||
{
|
||||
var intvSyncSettings = ((Intellivision)core).GetSyncSettings().Clone();
|
||||
var intvSyncSettings = ((Intellivision.Intellivision) core).GetSyncSettings().Clone();
|
||||
var port1 = intvSyncSettings.Port1;
|
||||
var port2 = intvSyncSettings.Port2;
|
||||
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("Lynx")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -6,7 +6,7 @@ using BizHawk.Common;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Nintendo.N64;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("N64")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Drawing;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk.tools.VirtualPads.schema
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("NDS")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -8,7 +8,7 @@ using BizHawk.Emulation.Cores.Nintendo.NES;
|
|||
using BizHawk.Emulation.Cores.Nintendo.SubNESHawk;
|
||||
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("NES")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("NGP")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Drawing;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("O2")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -6,7 +6,7 @@ using BizHawk.Common;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Sony.PSX;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("PSX")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -8,7 +8,7 @@ using BizHawk.Emulation.Common;
|
|||
using BizHawk.Emulation.Cores.PCEngine;
|
||||
using BizHawk.Emulation.Cores.Waterbox;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("PCECD")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
|
@ -25,13 +25,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
return core switch
|
||||
{
|
||||
PCEngine pce => PceHawkSchemas(pce, showMessageBox),
|
||||
PCEngine.PCEngine pce => PceHawkSchemas(pce, showMessageBox),
|
||||
NymaCore nyma => NymaSchemas(nyma, showMessageBox),
|
||||
_ => Enumerable.Empty<PadSchema>()
|
||||
};
|
||||
}
|
||||
|
||||
private static IEnumerable<PadSchema> PceHawkSchemas(PCEngine core, Action<string> showMessageBox)
|
||||
private static IEnumerable<PadSchema> PceHawkSchemas(PCEngine.PCEngine core, Action<string> showMessageBox)
|
||||
{
|
||||
var ss = core.GetSyncSettings();
|
||||
|
|
@ -7,7 +7,7 @@ using BizHawk.Common;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Waterbox;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("PCFX")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("SGB")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -7,7 +7,7 @@ using BizHawk.Common;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Waterbox;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("SAT")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("SMS")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Nintendo.SNES;
|
|||
using BizHawk.Emulation.Cores.Nintendo.SNES9X;
|
||||
using BizHawk.Emulation.Cores.Waterbox;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("SNES")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -5,7 +5,7 @@ using System.Drawing;
|
|||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Consoles.Vectrex;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("VEC")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("VB")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("WSWAN")]
|
||||
// ReSharper disable once UnusedMember.Global
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
namespace BizHawk.Emulation.Cores
|
||||
{
|
||||
[Schema("ZXSpectrum")]
|
||||
// ReSharper disable once UnusedMember.Global
|
Loading…
Reference in New Issue