diff --git a/BizHawk.Emulation/Computers/Commodore64/C64.cs b/BizHawk.Emulation/Computers/Commodore64/C64.cs index ab6f32c666..76e8dd50f5 100644 --- a/BizHawk.Emulation/Computers/Commodore64/C64.cs +++ b/BizHawk.Emulation/Computers/Commodore64/C64.cs @@ -21,6 +21,8 @@ namespace BizHawk.Emulation.Computers.Commodore64 public GameInfo game; public string SystemId { get { return "C64"; } } + public string BoardName { get { return null; } } + // memory domains public MemoryDomain MainMemory { get { return memoryDomains[0]; } } private IList memoryDomains; diff --git a/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.cs b/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.cs index 2193394e60..7fab21ba72 100644 --- a/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.cs +++ b/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.cs @@ -9,6 +9,8 @@ namespace BizHawk public string SystemId { get { return "A26"; } } public GameInfo game; + public string BoardName { get { return mapper.GetType().Name; } } + public CoreComm CoreComm { get; private set; } public IVideoProvider VideoProvider { get { return tia; } } public ISoundProvider SoundProvider { get { return dcfilter; } } diff --git a/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.cs b/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.cs index 3ac0e8f4bb..c171a97e5b 100644 --- a/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.cs +++ b/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.cs @@ -22,6 +22,8 @@ namespace BizHawk.Emulation public string SystemId { get { return "A78"; } } // TODO 2600? public GameInfo game; + public string BoardName { get { return null; } } + public void FrameAdvance(bool render, bool rendersound) { _frame++; diff --git a/BizHawk.Emulation/Consoles/Calculator/TI83.cs b/BizHawk.Emulation/Consoles/Calculator/TI83.cs index e0466768ff..4cb27f4250 100644 --- a/BizHawk.Emulation/Consoles/Calculator/TI83.cs +++ b/BizHawk.Emulation/Consoles/Calculator/TI83.cs @@ -592,6 +592,8 @@ namespace BizHawk.Emulation.Consoles.Calculator public string SystemId { get { return "TI83"; } } + public string BoardName { get { return null; } } + private IList memoryDomains; private const ushort RamSizeMask = 0x7FFF; diff --git a/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs index 74ca72a927..a4a98f91d4 100644 --- a/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs @@ -244,6 +244,8 @@ namespace BizHawk.Emulation.Consoles.Coleco public IVideoProvider VideoProvider { get { return VDP; } } public ISoundProvider SoundProvider { get { return PSG; } } + public string BoardName { get { return null; } } + public ISyncSoundProvider SyncSoundProvider { get { return null; } } public bool StartAsyncSound() { return true; } public void EndAsyncSound() { } diff --git a/BizHawk.Emulation/Consoles/Intellivision/Intellivision.cs b/BizHawk.Emulation/Consoles/Intellivision/Intellivision.cs index 191668b7a3..31b354b66c 100644 --- a/BizHawk.Emulation/Consoles/Intellivision/Intellivision.cs +++ b/BizHawk.Emulation/Consoles/Intellivision/Intellivision.cs @@ -135,6 +135,8 @@ namespace BizHawk.Emulation.Consoles.Intellivision get { return "INTV"; } } + public string BoardName { get { return null; } } + public bool DeterministicEmulation { get { return true; } } diff --git a/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs b/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs index ffa8b9fe88..0926d2740e 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs @@ -67,6 +67,9 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA public string SystemId { get { return "GBA"; } } public bool DeterministicEmulation { get { return true; } } + // todo: information about the saveram type would be useful here. + public string BoardName { get { return null; } } + public void ResetFrameCounter() { Frame = 0; diff --git a/BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs b/BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs index b819c85a39..30ea61310b 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -52,6 +52,7 @@ namespace BizHawk.Emulation.Consoles.GB comm.NominalHeight = 144; ThrowExceptionForBadRom(romdata); + BoardName = MapperName(romdata); GambatteState = LibGambatte.gambatte_create(); @@ -200,6 +201,34 @@ namespace BizHawk.Emulation.Consoles.GB FrameAdvancePost(); } + static string MapperName(byte[] romdata) + { + switch (romdata[0x147]) + { + case 0x00: return "Plain ROM"; // = PLAIN; break; + case 0x01: return "MBC1 ROM"; // = MBC1; break; + case 0x02: return "MBC1 ROM+RAM"; // = MBC1; break; + case 0x03: return "MBC1 ROM+RAM+BATTERY"; // = MBC1; break; + case 0x05: return "MBC2 ROM"; // = MBC2; break; + case 0x06: return "MBC2 ROM+BATTERY"; // = MBC2; break; + case 0x08: return "Plain ROM+RAM"; // = PLAIN; break; + case 0x09: return "Plain ROM+RAM+BATTERY"; // = PLAIN; break; + case 0x0F: return "MBC3 ROM+TIMER+BATTERY"; // = MBC3; break; + case 0x10: return "MBC3 ROM+TIMER+RAM+BATTERY"; // = MBC3; break; + case 0x11: return "MBC3 ROM"; // = MBC3; break; + case 0x12: return "MBC3 ROM+RAM"; // = MBC3; break; + case 0x13: return "MBC3 ROM+RAM+BATTERY"; // = MBC3; break; + case 0x19: return "MBC5 ROM"; // = MBC5; break; + case 0x1A: return "MBC5 ROM+RAM"; // = MBC5; break; + case 0x1B: return "MBC5 ROM+RAM+BATTERY"; // = MBC5; break; + case 0x1C: return "MBC5 ROM+RUMBLE"; // = MBC5; break; + case 0x1D: return "MBC5 ROM+RUMBLE+RAM"; // = MBC5; break; + case 0x1E: return "MBC5 ROM+RUMBLE+RAM+BATTERY"; // = MBC5; break; + case 0xFF: return "HuC1 ROM+RAM+BATTERY"; // = HUC1; break; + default: return "UNKNOWN"; + } + } + /// /// throw exception with intelligible message on some kinds of bad rom /// @@ -264,6 +293,8 @@ namespace BizHawk.Emulation.Consoles.GB get { return "GB"; } } + public string BoardName { get; private set; } + public bool DeterministicEmulation { get { return true; } } #region saveram diff --git a/BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs b/BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs index 37fb9c28d5..5803cd24a3 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs @@ -192,6 +192,8 @@ namespace BizHawk.Emulation.Consoles.GB public string SystemId { get { return "DGB"; } } public bool DeterministicEmulation { get { return true; } } + public string BoardName { get { return L.BoardName + '|' + R.BoardName; } } + #region saveram public byte[] ReadSaveRam() diff --git a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs index 14d1ec9c7c..266033cf92 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs @@ -10,6 +10,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64 { public string SystemId { get { return "N64"; } } + public string BoardName { get { return null; } } + public CoreComm CoreComm { get; private set; } public byte[] rom; public GameInfo game; diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs index 84390ad7a8..69f5c7e075 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs @@ -324,6 +324,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo return board; } + public string BoardName { get { return board.GetType().Name; } } + void BoardSystemHardReset() { INESBoard newboard; diff --git a/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs b/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs index d6d98d94fe..4d96d132a5 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -531,6 +531,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES public bool IsLagFrame { get; private set; } public string SystemId { get; private set; } + public string BoardName { get { return null; } } + public bool DeterministicEmulation { get; diff --git a/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs b/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs index 0114e74d59..c134e78772 100644 --- a/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs +++ b/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs @@ -70,6 +70,8 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx Init(game, rom); } + public string BoardName { get { return null; } } + public PCEngine(CoreComm comm, GameInfo game, Disc disc, byte[] rom) { CoreComm = comm; diff --git a/BizHawk.Emulation/Consoles/PSX/Octoshock.cs b/BizHawk.Emulation/Consoles/PSX/Octoshock.cs index b3999537a5..30bb41185b 100644 --- a/BizHawk.Emulation/Consoles/PSX/Octoshock.cs +++ b/BizHawk.Emulation/Consoles/PSX/Octoshock.cs @@ -10,6 +10,8 @@ namespace BizHawk.Emulation.Consoles.PSX public string SystemId { get { return "NULL"; } } public static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" }; + 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/Consoles/Sega/Genesis/Genesis.cs b/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs index ad0b23e6b2..7b17030a03 100644 --- a/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs +++ b/BizHawk.Emulation/Consoles/Sega/Genesis/Genesis.cs @@ -271,7 +271,7 @@ namespace BizHawk.Emulation.Consoles.Sega public bool DeterministicEmulation { get { return true; } } public string SystemId { get { return "GEN"; } } - + public string BoardName { get { return null; } } public void SaveStateText(TextWriter writer) { diff --git a/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs b/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs index 68de3bcfdb..c1e11ff49d 100644 --- a/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs +++ b/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs @@ -374,6 +374,8 @@ namespace BizHawk.Emulation.Consoles.Sega public string SystemId { get { return "SMS"; } } + public string BoardName { get { return null; } } + string region = "Export"; public string Region { diff --git a/BizHawk.Emulation/Consoles/Sega/Saturn/Yabause.cs b/BizHawk.Emulation/Consoles/Sega/Saturn/Yabause.cs index e79e63891e..89225527c7 100644 --- a/BizHawk.Emulation/Consoles/Sega/Saturn/Yabause.cs +++ b/BizHawk.Emulation/Consoles/Sega/Saturn/Yabause.cs @@ -219,6 +219,8 @@ namespace BizHawk.Emulation.Consoles.Sega.Saturn public string SystemId { get { return "SAT"; } } public bool DeterministicEmulation { get { return true; } } + public string BoardName { get { return null; } } + #region saveram public byte[] ReadSaveRam() diff --git a/BizHawk.Emulation/Consoles/Sony/PSP/PSP.cs b/BizHawk.Emulation/Consoles/Sony/PSP/PSP.cs index ecbaeccbd8..2d060da991 100644 --- a/BizHawk.Emulation/Consoles/Sony/PSP/PSP.cs +++ b/BizHawk.Emulation/Consoles/Sony/PSP/PSP.cs @@ -38,6 +38,7 @@ namespace BizHawk.Emulation.Consoles.Sony.PSP public bool BinarySaveStatesPreferred { get { return true; } } public CoreComm CoreComm { get; private set; } + public string BoardName { get { return null; } } PPSSPPDll.LogCB logcallback = null; Queue debugmsgs = new Queue(); diff --git a/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs b/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs index 869760312e..e1a031a681 100644 --- a/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs +++ b/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs @@ -9,6 +9,8 @@ namespace BizHawk public string SystemId { get { return "NULL"; } } public static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" }; + public string BoardName { get { return null; } } + private int[] frameBuffer = new int[256 * 192]; private Random rand = new Random(); public CoreComm CoreComm { get; private set; } diff --git a/BizHawk.Emulation/Interfaces/IEmulator.cs b/BizHawk.Emulation/Interfaces/IEmulator.cs index 768980e6d1..df8ac833b3 100644 --- a/BizHawk.Emulation/Interfaces/IEmulator.cs +++ b/BizHawk.Emulation/Interfaces/IEmulator.cs @@ -37,6 +37,11 @@ namespace BizHawk /// if you want to set this, look in the emulator's constructor or Load() method bool DeterministicEmulation { get; } + /// + /// identifying information about a "mapper" or similar capability. null if no such useful distinction can be drawn + /// + string BoardName { get; } + /// /// return a copy of the saveram. editing it won't do you any good unless you later call StoreSaveRam() /// diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index ba69c7c001..4267e8f34c 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -1526,6 +1526,11 @@ namespace BizHawk.MultiClient Util.BytesToHexString(System.Security.Cryptography.MD5.Create().ComputeHash(rom.RomData))); } + if (Global.Emulator.BoardName != null) + { + Console.WriteLine("Core reported BoardID: \"{0}\"", Global.Emulator.BoardName); + } + //restarts the lua console if a different rom is loaded. //im not really a fan of how this is done.. if (Global.Config.RecentRoms.Empty || Global.Config.RecentRoms.GetRecentFileByPosition(0) != file.CanonicalFullPath)