diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index e6c18eb3c4..4634a0f425 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -401,7 +401,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy #endif public bool IsCGBDMGMode +#if true + { + get + { + var headerCgbCompat = LibGambatte.gambatte_cpuread(GambatteState, 0x143); + return (headerCgbCompat & 0x80) == 0 || (headerCgbCompat & 0x84) == 0x84; + } + } +#else => LibGambatte.gambatte_iscgbdmg(GambatteState); +#endif private InputCallbackSystem _inputCallbacks = new(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/IGameboyCommon.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/IGameboyCommon.cs index 66aa8ae45a..a20c2f7335 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/IGameboyCommon.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/IGameboyCommon.cs @@ -24,7 +24,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Gameboy bool IsCGBMode { get; } /// iff the emulator is currently emulating CGB in DMG compatibility mode - /// NOTE: this mode does not take affect until the bootrom unmaps itself bool IsCGBDMGMode { get; } /// diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.cs index a8224f7ea7..7422996869 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SameBoy/SameBoy.cs @@ -38,7 +38,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.Sameboy => IsCgb; //TODO inline public bool IsCGBDMGMode +#if true + { + get + { + var headerCgbCompat = LibSameboy.sameboy_cpuread(SameboyState, 0x143); + return (headerCgbCompat & 0x80) == 0 || (headerCgbCompat & 0x84) == 0x84; + } + } +#else => LibSameboy.sameboy_iscgbdmg(SameboyState); +#endif private readonly LibSameboy.InputCallback _inputcb;