Make IsCGBDMGMode actually work for movies

This commit is contained in:
CasualPokePlayer 2025-01-06 13:49:20 -08:00
parent 08e3246ec9
commit e4a4493843
3 changed files with 20 additions and 1 deletions

View File

@ -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();

View File

@ -24,7 +24,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Gameboy
bool IsCGBMode { get; }
/// <value><see langword="true"/> iff the emulator is currently emulating CGB in DMG compatibility mode</value>
/// <remarks>NOTE: this mode does not take affect until the bootrom unmaps itself</remarks>
bool IsCGBDMGMode { get; }
/// <summary>

View File

@ -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;