diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index 39b0513e95b..76b3bec64aa 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -507,11 +507,6 @@ private void LoadOther( ); return; } - - if (_config.GbAsSgb) - { - game.System = VSystemID.Raw.SGB; - } break; case VSystemID.Raw.PSX when ext is ".bin": if (TryLoadSiblingCue( @@ -1012,11 +1007,6 @@ private void DispatchErrorMessage(Exception ex, string system, string path) { DoLoadErrorCallback(ex.Message, system, path, Deterministic, LoadErrorType.MissingFirmware); } - else if (ex is CGBNotSupportedException) - { - // failed to load SGB bios or game does not support SGB mode. - DoLoadErrorCallback("Failed to load a GB rom in SGB mode. You might try disabling SGB Mode.", system); - } else if (ex is NoAvailableCoreException) { // handle exceptions thrown by the new detected systems that BizHawk does not have cores for diff --git a/src/BizHawk.Client.Common/config/Config.cs b/src/BizHawk.Client.Common/config/Config.cs index d5fd7cd5700..1e1dd2922cc 100644 --- a/src/BizHawk.Client.Common/config/Config.cs +++ b/src/BizHawk.Client.Common/config/Config.cs @@ -31,11 +31,9 @@ public class Config ([ VSystemID.Raw.Satellaview ], [ CoreNames.Bsnes115, CoreNames.SubBsnes115 ]), ([ VSystemID.Raw.GB, VSystemID.Raw.GBC ], - [ CoreNames.Gambatte, CoreNames.Sameboy, CoreNames.GbHawk, CoreNames.SubGbHawk ]), + [ CoreNames.Gambatte, CoreNames.Sameboy, CoreNames.GbHawk, CoreNames.SubGbHawk, CoreNames.Bsnes, CoreNames.Bsnes115, CoreNames.SubBsnes115 ]), ([ VSystemID.Raw.GBL ], [ CoreNames.GambatteLink, CoreNames.GBHawkLink, CoreNames.GBHawkLink3x, CoreNames.GBHawkLink4x ]), - ([ VSystemID.Raw.SGB ], - [ CoreNames.Gambatte, CoreNames.Bsnes115, CoreNames.SubBsnes115, CoreNames.Bsnes ]), ([ VSystemID.Raw.N64 ], [ CoreNames.Mupen64Plus, CoreNames.Ares64 ]), ([ VSystemID.Raw.NES ], @@ -411,8 +409,6 @@ public void SetWindowScaleFor(string sysID, int windowScale) public Dictionary> AllTrollersAnalog { get; set; } = new Dictionary>(); public Dictionary> AllTrollersFeedbacks { get; set; } = new Dictionary>(); - /// as this setting spans multiple cores and doesn't actually affect the behavior of any core, it hasn't been absorbed into the new system - public bool GbAsSgb { get; set; } public string LibretroCore { get; set; } public Dictionary PreferredCores = GenDefaultCorePreferences(); diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 2fd399af341..39dcf12590b 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -147,17 +147,9 @@ private void MainForm_Load(object sender, EventArgs e) CoresSubMenu.DropDownItems.Add(submenu); } CoresSubMenu.DropDownItems.Add(new ToolStripSeparator { AutoSize = true }); - var GBInSGBMenuItem = new ToolStripMenuItem { Text = "GB in SGB" }; - GBInSGBMenuItem.Click += (_, _) => - { - Config.GbAsSgb = !Config.GbAsSgb; - if (Emulator.SystemId is VSystemID.Raw.GB or VSystemID.Raw.GBC or VSystemID.Raw.SGB) FlagNeedsReboot(); - }; - CoresSubMenu.DropDownItems.Add(GBInSGBMenuItem); var setLibretroCoreToolStripMenuItem = new ToolStripMenuItem { Text = "Set Libretro Core..." }; setLibretroCoreToolStripMenuItem.Click += (_, _) => RunLibretroCoreChooser(); CoresSubMenu.DropDownItems.Add(setLibretroCoreToolStripMenuItem); - CoresSubMenu.DropDownOpened += (_, _) => GBInSGBMenuItem.Checked = Config.GbAsSgb; ToolStripMenuItemEx recentCoreSettingsSubmenu = new() { Text = "Recent" }; recentCoreSettingsSubmenu.DropDownItems.AddRange(CreateCoreSettingsSubmenus().ToArray()); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs index 8f41b4ac70b..88044b74872 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs @@ -16,8 +16,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES [PortedCore(CoreNames.Bsnes115, "bsnes team", "v115+", "https://github.com/bsnes-emu/bsnes")] public partial class BsnesCore : IEmulator, IDebuggable, IVideoProvider, ISaveRam, IStatable, IInputPollable, IRegionable, ISettable, IBSNESForGfxDebugger, IBoardInfo { + [CoreConstructor(VSystemID.Raw.GB)] + [CoreConstructor(VSystemID.Raw.GBC)] [CoreConstructor(VSystemID.Raw.Satellaview)] - [CoreConstructor(VSystemID.Raw.SGB)] [CoreConstructor(VSystemID.Raw.SNES)] public BsnesCore(CoreLoadParameters loadParameters) : this(loadParameters, false) { } public BsnesCore(CoreLoadParameters loadParameters, bool subframe = false) @@ -28,8 +29,8 @@ public BsnesCore(CoreLoadParameters loadParamete this._romPath = Path.ChangeExtension(loadParameters.Roms[0].RomPath.SubstringBefore('|'), null); CoreComm = loadParameters.Comm; _syncSettings = loadParameters.SyncSettings ?? new SnesSyncSettings(); - SystemId = loadParameters.Game.System; - _isSGB = SystemId == VSystemID.Raw.SGB; + _isSGB = loadParameters.Game.System is VSystemID.Raw.GB or VSystemID.Raw.GBC; + SystemId = _isSGB ? VSystemID.Raw.SGB : loadParameters.Game.System; _currentMsuTrack = new ProxiedFile(); byte[] sgbRomData = null; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/SubBsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/SubBsnesCore.cs index 20f8bb4dc8b..e4f14992c39 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/SubBsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/SubBsnesCore.cs @@ -11,8 +11,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES portedUrl: "https://github.com/bsnes-emu/bsnes")] public class SubBsnesCore : IEmulator, ICycleTiming { + [CoreConstructor(VSystemID.Raw.GB)] + [CoreConstructor(VSystemID.Raw.GBC)] [CoreConstructor(VSystemID.Raw.Satellaview)] - [CoreConstructor(VSystemID.Raw.SGB)] [CoreConstructor(VSystemID.Raw.SNES)] public SubBsnesCore(CoreLoadParameters loadParameters) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs index 33b6dc37184..b254388e960 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs @@ -115,7 +115,7 @@ public enum ConsoleModeType } [DisplayName("Console Mode")] - [Description("Picks which console to emulate. 'SGB2' is always in effect when 'GB in SGB' is checked.")] + [Description("Picks which console to emulate.")] [DefaultValue(ConsoleModeType.Auto)] public ConsoleModeType ConsoleMode { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index 87b1ed228b2..7224361192d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -20,8 +20,7 @@ public partial class Gameboy : IInputPollable, IRomInfo, IGameboyCommon, ICycleT [CoreConstructor(VSystemID.Raw.GB)] [CoreConstructor(VSystemID.Raw.GBC)] - [CoreConstructor(VSystemID.Raw.SGB)] - public Gameboy(CoreComm comm, IGameInfo game, byte[] file, GambatteSettings settings, GambatteSyncSettings syncSettings, bool deterministic) + public Gameboy(CoreComm comm, GameInfo game, byte[] file, GambatteSettings settings, GambatteSyncSettings syncSettings, bool deterministic) { _serviceProvider = new(this); _serviceProvider.Register(_disassembler); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index cceb0160d1b..cc7df8f5fca 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -22,7 +22,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES public unsafe partial class LibsnesCore : IEmulator, IVideoProvider, ISaveRam, IStatable, IInputPollable, IRegionable, ICodeDataLogger, IDebuggable, ISettable, IBSNESForGfxDebugger { - [CoreConstructor(VSystemID.Raw.SGB)] + [CoreConstructor(VSystemID.Raw.GB)] + [CoreConstructor(VSystemID.Raw.GBC)] [CoreConstructor(VSystemID.Raw.SNES)] public LibsnesCore(GameInfo game, byte[] rom, CoreComm comm, LibsnesCore.SnesSettings settings, LibsnesCore.SnesSyncSettings syncSettings) @@ -44,8 +45,9 @@ public LibsnesCore(GameInfo game, byte[] romData, byte[] xmlData, string baseRom _game = game; CoreComm = comm; byte[] sgbRomData = null; + IsSGB = game.System is VSystemID.Raw.GB or VSystemID.Raw.GBC; - if (game.System == VSystemID.Raw.SGB) + if (IsSGB) { if ((romData[0x143] & 0xc0) == 0xc0) { @@ -109,9 +111,8 @@ public LibsnesCore(GameInfo game, byte[] romData, byte[] xmlData, string baseRom romData = newData; } - if (game.System == VSystemID.Raw.SGB) + if (IsSGB) { - IsSGB = true; SystemId = VSystemID.Raw.SNES; ser.Register(new SGBBoardInfo());