GBHawk: set bk2 movie CGB flag properly

This commit is contained in:
alyosha-tas 2021-10-04 16:16:22 -04:00
parent f46ff85287
commit a63b7c262b
3 changed files with 6 additions and 2 deletions

View File

@ -247,7 +247,7 @@ namespace BizHawk.Client.Common
} }
} }
if (emulator is GBHawk gbHawk && gbHawk.IsCGBMode()) if (emulator is GBHawk gbHawk && gbHawk.IsCGBMode() && !gbHawk.IsGBInGBCMode())
{ {
movie.HeaderEntries.Add("IsCGBMode", "1"); movie.HeaderEntries.Add("IsCGBMode", "1");
} }

View File

@ -52,6 +52,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
ser.Sync(nameof(RAM_Bank_ret), ref RAM_Bank_ret); ser.Sync(nameof(RAM_Bank_ret), ref RAM_Bank_ret);
ser.Sync(nameof(VRAM_Bank), ref VRAM_Bank); ser.Sync(nameof(VRAM_Bank), ref VRAM_Bank);
ser.Sync(nameof(is_GBC), ref is_GBC); ser.Sync(nameof(is_GBC), ref is_GBC);
ser.Sync(nameof(is_GB_in_GBC), ref is_GB_in_GBC);
ser.Sync(nameof(GBC_compat), ref GBC_compat); ser.Sync(nameof(GBC_compat), ref GBC_compat);
ser.Sync(nameof(double_speed), ref double_speed); ser.Sync(nameof(double_speed), ref double_speed);
ser.Sync(nameof(speed_switch), ref speed_switch); ser.Sync(nameof(speed_switch), ref speed_switch);

View File

@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
public int RAM_Bank; public int RAM_Bank;
public int RAM_Bank_ret; public int RAM_Bank_ret;
public byte VRAM_Bank; public byte VRAM_Bank;
internal bool is_GBC; internal bool is_GBC, is_GB_in_GBC;
public bool GBC_compat; // compatibility mode for GB games played on GBC public bool GBC_compat; // compatibility mode for GB games played on GBC
public bool double_speed; public bool double_speed;
public bool speed_switch; public bool speed_switch;
@ -158,6 +158,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
if (is_GBC && ((header[0x43] != 0x80) && (header[0x43] != 0xC0))) if (is_GBC && ((header[0x43] != 0x80) && (header[0x43] != 0xC0)))
{ {
ppu = new GBC_GB_PPU(); ppu = new GBC_GB_PPU();
is_GB_in_GBC = true; // for movie files
} }
Console.WriteLine("MD5: " + rom.HashMD5(0, rom.Length)); Console.WriteLine("MD5: " + rom.HashMD5(0, rom.Length));
@ -202,6 +203,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
public bool IsCGBMode() => is_GBC; public bool IsCGBMode() => is_GBC;
public bool IsGBInGBCMode() => is_GB_in_GBC;
/// <summary> /// <summary>
/// Produces a palette in the form that certain frontend inspection tools. /// Produces a palette in the form that certain frontend inspection tools.
/// May or may not return a reference to the core's own palette, so please don't mutate. /// May or may not return a reference to the core's own palette, so please don't mutate.