diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs index 79703900a1..37ad535e2e 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs @@ -1,5 +1,6 @@ using System; using LuaInterface; + using BizHawk.Emulation.Common; namespace BizHawk.Client.Common @@ -9,6 +10,9 @@ namespace BizHawk.Client.Common [RequiredService] public IEmulator Emulator { get; set; } + [OptionalService] + public IBoardInfo BoardInfo { get; set; } + public GameInfoLuaLibrary(Lua lua) : base(lua) { } @@ -93,7 +97,7 @@ namespace BizHawk.Client.Common )] public string GetBoardType() { - return Emulator.BoardName ?? string.Empty; + return BoardInfo?.BoardName ?? string.Empty; } [LuaMethodAttributes( diff --git a/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs b/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs index c671b41f0f..5cf0cf5510 100644 --- a/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs +++ b/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs @@ -285,9 +285,9 @@ namespace BizHawk.Client.Common.MovieConversionExtensions movie.GameName = "NULL"; } - if (Global.Emulator.BoardName != null) + if (Global.Emulator.HasBoardInfo()) { - movie.BoardName = Global.Emulator.BoardName; + movie.BoardName = Global.Emulator.AsBoardInfo().BoardName; } if (Global.Emulator.HasRegions()) diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index dec8b5ee61..7fa16390ed 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1495,7 +1495,8 @@ namespace BizHawk.Client.EmuHawk private void NESSubMenu_DropDownOpened(object sender, EventArgs e) { - FDSControlsMenuItem.Enabled = Emulator.BoardName == "FDS"; + var boardName = Emulator.HasBoardInfo() ? Emulator.AsBoardInfo().BoardName : null; + FDSControlsMenuItem.Enabled = boardName == "FDS"; VSControlsMenuItem.Enabled = VSSettingsMenuItem.Enabled = @@ -1514,7 +1515,8 @@ namespace BizHawk.Client.EmuHawk private void FdsControlsMenuItem_DropDownOpened(object sender, EventArgs e) { - FdsEjectDiskMenuItem.Enabled = Emulator.BoardName == "FDS"; + var boardName = Emulator.HasBoardInfo() ? Emulator.AsBoardInfo().BoardName : null; + FdsEjectDiskMenuItem.Enabled = boardName == "FDS"; while (FDSControlsMenuItem.DropDownItems.Count > 1) { diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 016512b73c..52a07a3fbf 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -3517,9 +3517,9 @@ namespace BizHawk.Client.EmuHawk loader.Rom.RomData.HashMD5()); } - if (Emulator.BoardName != null) + if (Emulator.HasBoardInfo()) { - Console.WriteLine("Core reported BoardID: \"{0}\"", Emulator.BoardName); + Console.WriteLine("Core reported BoardID: \"{0}\"", Emulator.AsBoardInfo().BoardName); } // restarts the lua console if a different rom is loaded. diff --git a/BizHawk.Client.EmuHawk/tools/BatchRunner.cs b/BizHawk.Client.EmuHawk/tools/BatchRunner.cs index 4d9b080c73..0f96036f2c 100644 --- a/BizHawk.Client.EmuHawk/tools/BatchRunner.cs +++ b/BizHawk.Client.EmuHawk/tools/BatchRunner.cs @@ -163,7 +163,7 @@ namespace BizHawk.Client.EmuHawk current.GI = ldr.Game; current.CoreType = emu.GetType(); emu.Controller = new Controller(emu.ControllerDefinition); - current.BoardName = emu.BoardName; + current.BoardName = emu.HasBoardInfo() ? emu.AsBoardInfo().BoardName : null; // hack if (emu is Emulation.Cores.Nintendo.GBA.VBANext) { diff --git a/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj b/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj index d85240645c..abd21a58ef 100644 --- a/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj +++ b/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj @@ -125,6 +125,7 @@ + diff --git a/BizHawk.Emulation.Common/Extensions.cs b/BizHawk.Emulation.Common/Extensions.cs index fd839d334e..a1bbd28375 100644 --- a/BizHawk.Emulation.Common/Extensions.cs +++ b/BizHawk.Emulation.Common/Extensions.cs @@ -327,6 +327,21 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions return core.ServiceProvider.GetService(); } + public static bool HasBoardInfo(this IEmulator core) + { + if (core == null) + { + return false; + } + + return core.ServiceProvider.HasService(); + } + + public static IBoardInfo AsBoardInfo(this IEmulator core) + { + return core.ServiceProvider.GetService(); + } + // TODO: a better place for these public static bool IsImplemented(this MethodInfo info) { diff --git a/BizHawk.Emulation.Common/Interfaces/IEmulator.cs b/BizHawk.Emulation.Common/Interfaces/IEmulator.cs index 08577fd7ce..05194aceb5 100644 --- a/BizHawk.Emulation.Common/Interfaces/IEmulator.cs +++ b/BizHawk.Emulation.Common/Interfaces/IEmulator.cs @@ -61,11 +61,6 @@ namespace BizHawk.Emulation.Common /// bool DeterministicEmulation { get; } - /// - /// Gets the identifying information about a "mapper" or similar capability. null if no such useful distinction can be drawn - /// - string BoardName { get; } - /// /// Resets the Frame and Lag counters, and any other similar counters a core might implement /// @@ -77,4 +72,5 @@ namespace BizHawk.Emulation.Common /// CoreComm CoreComm { get; } } + } diff --git a/BizHawk.Emulation.Common/Interfaces/Services/IBoardInfo.cs b/BizHawk.Emulation.Common/Interfaces/Services/IBoardInfo.cs new file mode 100644 index 0000000000..67a83a0ff4 --- /dev/null +++ b/BizHawk.Emulation.Common/Interfaces/Services/IBoardInfo.cs @@ -0,0 +1,16 @@ +namespace BizHawk.Emulation.Common +{ + /// + /// An that returns cart/mapper/board information about the Game hardware itself, if available + /// Currently the board name is the only property but this could be expanded to support more detail informations + /// + /// + /// + public interface IBoardInfo : IEmulatorService + { + /// + /// Gets the identifying information about a "mapper", cart, board or similar capability. + /// + string BoardName { get; } + } +} diff --git a/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs b/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs index 758c324e63..b51018078b 100644 --- a/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs @@ -52,8 +52,6 @@ namespace BizHawk.Emulation.Cores.Calculators public bool DeterministicEmulation { get { return true; } } - public string BoardName { get { return null; } } - public void ResetCounters() { Frame = 0; diff --git a/BizHawk.Emulation.Cores/Calculator/TI83.cs b/BizHawk.Emulation.Cores/Calculator/TI83.cs index 5ba4a7ad72..837be34fb5 100644 --- a/BizHawk.Emulation.Cores/Calculator/TI83.cs +++ b/BizHawk.Emulation.Cores/Calculator/TI83.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Calculators "zeromus", isPorted: false, isReleased: true)] - [ServiceNotApplicable(typeof(ISoundProvider), typeof(ISaveRam), typeof(IRegionable), typeof(IDriveLight))] + [ServiceNotApplicable(typeof(ISoundProvider), typeof(ISaveRam), typeof(IRegionable), typeof(IDriveLight), typeof(IBoardInfo))] public partial class TI83 : IEmulator, IVideoProvider, IStatable, IDebuggable, IInputPollable, ISettable { [CoreConstructor("TI83")] diff --git a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IEmulator.cs b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IEmulator.cs index ba98f582fb..33a5fe7961 100644 --- a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IEmulator.cs @@ -21,8 +21,6 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII FrameAdv(render, rendersound); } - public string BoardName => null; - public void ResetCounters() { Frame = 0; diff --git a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs index 2606287c37..63abe8d7b5 100644 --- a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs +++ b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII "fool", isPorted: true, isReleased: true)] - [ServiceNotApplicable(typeof(ISaveRam), typeof(IRegionable))] + [ServiceNotApplicable(typeof(ISaveRam), typeof(IRegionable), typeof(IBoardInfo))] public partial class AppleII : IEmulator, ISoundProvider, IVideoProvider, IStatable, IDriveLight { static AppleII() diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs index 766b00e627..03e4aff476 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs @@ -132,8 +132,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 public CoreComm CoreComm { get; private set; } [SaveState.DoNotSave] public string SystemId { get { return "C64"; } } - [SaveState.DoNotSave] - public string BoardName { get { return null; } } [SaveState.SaveWithName("DeterministicEmulation")] public bool DeterministicEmulation { get; set; } [SaveState.SaveWithName("Frame")] diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs index a80cc735a7..a223301e40 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs @@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 isPorted: false, isReleased: true)] [ServiceNotApplicable(typeof(ISaveRam), typeof(IDriveLight))] - public partial class Atari2600 : IEmulator, IStatable, IDebuggable, IInputPollable, + public partial class Atari2600 : IEmulator, IStatable, IDebuggable, IInputPollable, IBoardInfo, IRegionable, ICreateGameDBEntries, ISettable { private readonly GameInfo _game; @@ -69,8 +69,6 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public string SystemId => "A26"; - public string BoardName => _mapper.GetType().Name; - public CoreComm CoreComm { get; } public ControllerDefinition ControllerDefinition { get { return Atari2600ControllerDefinition; } } @@ -106,6 +104,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 }; } + // IBoardInfo + public string BoardName => _mapper.GetType().Name; + public void ResetCounters() { _frame = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs b/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs index b5d8220b05..3d818e62c4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs @@ -99,8 +99,6 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800 public GameInfo game; - public string BoardName => null; - public void FrameAdvance(bool render, bool rendersound) { _frame++; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs b/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs index 5d5561d2d7..d16b09983d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs @@ -153,8 +153,6 @@ namespace BizHawk.Emulation.Cores.Atari.Lynx IsLagFrame = false; } - public string BoardName => null; - public CoreComm CoreComm { get; } public void Dispose() diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index 1d8e382027..51831218c7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -204,6 +204,5 @@ namespace BizHawk.Emulation.Cores.ColecoVision private GameInfo _game; public CoreComm CoreComm { get; } - public string BoardName => null; } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs index fa0bd5ae59..5d5beefd5f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Intellivision { - public sealed partial class Intellivision : IEmulator + public sealed partial class Intellivision : IEmulator, IBoardInfo { public IEmulatorServiceProvider ServiceProvider { get; } @@ -134,8 +134,6 @@ namespace BizHawk.Emulation.Cores.Intellivision public bool DeterministicEmulation => true; - public string BoardName => _cart.BoardName; - public void ResetCounters() { _frame = 0; @@ -147,5 +145,8 @@ namespace BizHawk.Emulation.Cores.Intellivision public void Dispose() { } + + // IBoardInfo + public string BoardName => _cart.BoardName; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs index 8fdc309cd2..c88e2e2744 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Intellivision isReleased: true)] [ServiceNotApplicable(typeof(ISaveRam), typeof(IDriveLight), typeof(IRegionable))] public sealed partial class Intellivision : IEmulator, IStatable, IInputPollable, IDisassemblable, - IDebuggable, ISettable + IBoardInfo, IDebuggable, ISettable { [CoreConstructor("INTV")] public Intellivision(CoreComm comm, GameInfo game, byte[] rom, object Settings, object SyncSettings) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs index 36b67dc7c5..d6d0196889 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs @@ -110,8 +110,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA public bool DeterministicEmulation { get; } - public string BoardName => null; - public void ResetCounters() { Frame = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/VBANext.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/VBANext.cs index 1037c121e4..3629e5dafa 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/VBANext.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/VBANext.cs @@ -129,7 +129,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA IsLagFrame = false; } - public string BoardName { get { return null; } } /// /// set in the ROM internal header /// diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IEmulator.cs index 25ea29a6c9..2013e33324 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IEmulator.cs @@ -5,7 +5,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Nintendo.Gameboy { - public partial class Gameboy : IEmulator + public partial class Gameboy : IEmulator, IBoardInfo { public IEmulatorServiceProvider ServiceProvider { get; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index 46faa1b150..10c012ad73 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy portedUrl: "http://gambatte.sourceforge.net/")] [ServiceNotApplicable(typeof(IDriveLight), typeof(IDriveLight))] public partial class Gameboy : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable, ICodeDataLogger, - IDebuggable, ISettable + IBoardInfo, IDebuggable, ISettable { /// /// the nominal length of one frame diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs index 817505e0ae..bc4757f97e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs @@ -3,7 +3,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Nintendo.Gameboy { - public partial class GambatteLink : IEmulator + public partial class GambatteLink : IEmulator, IBoardInfo { public IEmulatorServiceProvider ServiceProvider { get; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs index 6c585cd6a4..27068b460d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy isReleased: true)] [ServiceNotApplicable(typeof(IDriveLight))] public partial class GambatteLink : IEmulator, IVideoProvider, ISoundProvider, IInputPollable, ISaveRam, IStatable, ILinkable, - IDebuggable, ISettable, ICodeDataLogger + IBoardInfo, IDebuggable, ISettable, ICodeDataLogger { public GambatteLink(CoreComm comm, GameInfo leftinfo, byte[] leftrom, GameInfo rightinfo, byte[] rightrom, object Settings, object SyncSettings, bool deterministic) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs index 38244648b9..0153d90070 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs @@ -265,8 +265,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 public string SystemId { get { return "N64"; } } - public string BoardName { get { return null; } } - public CoreComm CoreComm { get; private set; } public DisplayType Region { get { return _display_type; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs index 4584035153..df41d5a016 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES isReleased: true )] public partial class NES : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable, - ISettable + IBoardInfo, ISettable { static readonly bool USE_DATABASE = true; public RomStatus RomStatus; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs index b3432100ae..db5faa21fb 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs @@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES portedUrl: "https://github.com/kode54/QuickNES" )] [ServiceNotApplicable(typeof(IDriveLight))] - public partial class QuickNES : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, + public partial class QuickNES : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, IBoardInfo, IStatable, IDebuggable, ISettable, Cores.Nintendo.NES.INESPPUViewable { static readonly LibQuickNES QN; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs index eb9446cac4..b7e415577d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IEmulator.cs @@ -108,8 +108,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES _settings.ForceDeterminism && (CurrentProfile == "Compatibility" || CurrentProfile == "Accuracy"); - public string BoardName { get; } - public void ResetCounters() { _timeFrameCounter = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index 9d8d18d815..bc270de070 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -103,7 +103,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES { IsSGB = true; SystemId = "SNES"; - BoardName = "SGB"; + ser.Register(new SGBBoardInfo()); _currLoadParams = new LoadParams() { @@ -198,6 +198,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES public bool IsSGB { get; } + private class SGBBoardInfo : IBoardInfo + { + public string BoardName => "SGB"; + } + public string CurrentProfile { get diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9x.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9x.cs index 2e0d9e110b..85d0f588a9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9x.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9x.cs @@ -55,7 +55,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES9X public string SystemId { get { return "SNES"; } } public bool DeterministicEmulation { get { return true; } } - public string BoardName { get { return null; } } public CoreComm CoreComm { get; private set; } #region IVideoProvider diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.IEmulator.cs index d8c15137ad..b8ed72cb9b 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.IEmulator.cs @@ -52,8 +52,6 @@ namespace BizHawk.Emulation.Cores.PCEngine public bool DeterministicEmulation => true; - public string BoardName => null; - public void ResetCounters() { // this should just be a public setter instead of a new method. diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Genesis/Genesis.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Genesis/Genesis.cs index d445405db2..f20a97b41c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/Genesis/Genesis.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/Genesis/Genesis.cs @@ -317,8 +317,6 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis public bool DeterministicEmulation { get { return true; } } public string SystemId { get { return "GEN"; } } - public string BoardName { get { return null; } } - public void SaveStateText(TextWriter writer) { var buf = new byte[141501 + SaveRAM.Length]; diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IEmulator.cs index f9f036fa4f..1caf482386 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IEmulator.cs @@ -67,8 +67,6 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem public bool DeterministicEmulation { get { return true; } } - public string BoardName { get { return null; } } - public void ResetCounters() { Frame = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.cs index 3a1bc3d4c4..5da1aca69b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.cs @@ -302,8 +302,6 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn public string SystemId { get { return "SAT"; } } public bool DeterministicEmulation { get { return true; } } - public string BoardName { get { return null; } } - public void ResetCounters() { Frame = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.IEmulator.cs index 03f6b0824b..8181b04f79 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.IEmulator.cs @@ -62,11 +62,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx get { return true; } } - public string BoardName - { - get { return null; } - } - public void ResetCounters() { Frame = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs index 96d1e37944..382a0935d2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs @@ -57,11 +57,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx64 get { return true; } } - public string BoardName - { - get { return null; } - } - public void ResetCounters() { Frame = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Sony/PSP/PSP.cs b/BizHawk.Emulation.Cores/Consoles/Sony/PSP/PSP.cs index 18b39b5eb3..a3fa094cf8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sony/PSP/PSP.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sony/PSP/PSP.cs @@ -44,8 +44,6 @@ namespace BizHawk.Emulation.Cores.Sony.PSP public string SystemId { get { return "PSP"; } } public CoreComm CoreComm { get; private set; } - public string BoardName { get { return null; } } - PPSSPPDll.LogCB logcallback = null; Queue debugmsgs = new Queue(); PPSSPPDll.Input input = new PPSSPPDll.Input(); diff --git a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs index 2708aa98e8..b9fd849359 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs @@ -141,8 +141,6 @@ namespace BizHawk.Emulation.Cores.Sony.PSX ControllerDefinition = CreateControllerDefinition(_SyncSettings); } - public string BoardName { get { return null; } } - private int[] frameBuffer = new int[0]; private Random rand = new Random(); public CoreComm CoreComm { get; private set; } diff --git a/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs b/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs index 709c368159..a79a40f107 100644 --- a/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs +++ b/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs @@ -105,7 +105,6 @@ namespace BizHawk.Emulation.Cores.WonderSwan public string SystemId { get { return "WSWAN"; } } public bool DeterministicEmulation { get; private set; } - public string BoardName { get { return null; } } #region Debugging