diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index eb4f1136e75..443504bce1d 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -482,12 +482,6 @@ private void LoadOther( ); return; } - static bool IsPreferredCoreSGB(Config config) - => config.PreferredCores[VSystemID.Raw.GB] is CoreNames.Bsnes or CoreNames.Bsnes115 or CoreNames.SubBsnes115; - if (IsPreferredCoreSGB(_config)) - { - game.System = VSystemID.Raw.SGB; - } break; case VSystemID.Raw.PSX when ext is ".bin": const string FILE_EXT_CUE = ".cue"; @@ -853,11 +847,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.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs index d7b35ed2a49..eb00397ff9e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs @@ -17,8 +17,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES [ServiceNotApplicable(new[] { typeof(IDriveLight) })] 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) @@ -29,8 +30,8 @@ public BsnesCore(CoreLoadParameters loadParamete this._romPath = Path.ChangeExtension(loadParameters.Roms[0].RomPath, 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 f84cf5c905e..a66178219ca 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/SubBsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/SubBsnesCore.cs @@ -8,8 +8,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES [ServiceNotApplicable(new[] { typeof(IDriveLight) })] 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/SNES/LibsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index 50a9eb2a338..bcee0d0cb01 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -23,7 +23,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) @@ -45,8 +46,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) { @@ -110,9 +112,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());