PicoDrive: Add core query whether 32X hardware is currently active. Remove code that assumed that the emulator would always activate 32X hardware when _32xPreinit was true, or that it would never activate 32X hardware when _32xPreinit was false. Both assumptions are false.

This commit is contained in:
nattthebear 2017-07-09 12:14:02 -04:00
parent a7766fc4ee
commit dd7389f848
5 changed files with 8 additions and 7 deletions

View File

@ -331,11 +331,6 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
movie.HeaderEntries.Add("IsSegaCDMode", "1");
}
if (Global.Emulator is PicoDrive && (Global.Emulator as PicoDrive).Is32X)
{
movie.HeaderEntries.Add("Is32X", "1");
}
movie.Core = ((CoreAttributes)Attribute
.GetCustomAttribute(Global.Emulator.GetType(), typeof(CoreAttributes)))
.CoreName;

View File

@ -35,5 +35,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive
[BizImport(CC)]
public abstract bool IsPal();
[BizImport(CC)]
public abstract bool Is32xActive();
}
}

View File

@ -110,13 +110,12 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive
DeterministicEmulation = deterministic;
_core.SetCDReadCallback(_cdcallback);
Is32X = game["32X"];
_isPal = _core.IsPal();
VsyncNumerator = _isPal ? 53203424 : 53693175;
VsyncDenominator = _isPal ? 3420 * 313 : 3420 * 262;
}
public bool Is32X { get; }
public bool Is32xActive => _core.Is32xActive();
public static readonly ControllerDefinition PicoDriveController = new ControllerDefinition
{

Binary file not shown.

View File

@ -284,6 +284,10 @@ ECL_EXPORT int IsPal(void)
{
return Pico.m.pal;
}
ECL_EXPORT int Is32xActive(void)
{
return !!(PicoAHW & PAHW_32X);
}
int main(void)
{