cleanup PopulateWithDefaultHeaderValues()

This commit is contained in:
adelikat 2020-04-14 17:15:46 -05:00
parent 2b17c6d310
commit ce4037fad8
3 changed files with 22 additions and 17 deletions

View File

@ -331,37 +331,40 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
} }
} }
if (Global.Emulator is GBHawk && ((GBHawk)Global.Emulator).is_GBC) if (Global.Emulator is GBHawk gbHawk && gbHawk.IsCGBMode())
{ {
movie.HeaderEntries.Add("IsCGBMode", "1"); movie.HeaderEntries.Add("IsCGBMode", "1");
} }
if (Global.Emulator is Gameboy && ((Gameboy) Global.Emulator).IsCGBMode()) if (Global.Emulator is Gameboy gb)
{ {
movie.HeaderEntries.Add("IsCGBMode", "1"); if (gb.IsCGBMode())
} {
movie.HeaderEntries.Add("IsCGBMode", "1");
}
if (Global.Emulator is Gameboy)
{
movie.HeaderEntries.Add(HeaderKeys.CycleCount, "0"); movie.HeaderEntries.Add(HeaderKeys.CycleCount, "0");
} }
if (Global.Emulator is SMS && ((SMS) Global.Emulator).IsSG1000) if (Global.Emulator is SMS sms)
{ {
movie.HeaderEntries.Add("IsSGMode", "1"); if (sms.IsSG1000)
{
movie.HeaderEntries.Add("IsSGMode", "1");
}
if (sms.IsGameGear)
{
movie.HeaderEntries.Add("IsGGMode", "1");
}
} }
if (Global.Emulator is SMS && ((SMS) Global.Emulator).IsGameGear) if (Global.Emulator is GPGX gpgx && gpgx.IsMegaCD)
{
movie.HeaderEntries.Add("IsGGMode", "1");
}
if (Global.Emulator is GPGX && ((GPGX) Global.Emulator).IsMegaCD)
{ {
movie.HeaderEntries.Add("IsSegaCDMode", "1"); movie.HeaderEntries.Add("IsSegaCDMode", "1");
} }
if (Global.Emulator is PicoDrive && Global.Game["32X"]) if (Global.Emulator is PicoDrive pico && pico.Is32XActive)
{ {
movie.HeaderEntries.Add("Is32X", "1"); movie.HeaderEntries.Add("Is32X", "1");
} }

View File

@ -49,7 +49,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
public int RAM_Bank; public int RAM_Bank;
public byte VRAM_Bank; public byte VRAM_Bank;
public bool is_GBC; internal bool is_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;

View File

@ -118,9 +118,11 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive
_isPal = _core.IsPal(); _isPal = _core.IsPal();
VsyncNumerator = _isPal ? 53203424 : 53693175; VsyncNumerator = _isPal ? 53203424 : 53693175;
VsyncDenominator = _isPal ? 3420 * 313 : 3420 * 262; VsyncDenominator = _isPal ? 3420 * 313 : 3420 * 262;
Is32XActive = game["32X"];
} }
public bool Is32xActive => _core.Is32xActive(); public bool Is32XActive { get; }
public static readonly ControllerDefinition PicoDriveController = new ControllerDefinition public static readonly ControllerDefinition PicoDriveController = new ControllerDefinition
{ {