init rtc before calling nyma init functions
mainly needed for saturnus
This commit is contained in:
parent
0cc61c3744
commit
17434f78cf
|
@ -26,9 +26,16 @@ namespace BizHawk.Emulation.Cores.Waterbox
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Do this before calling anything, even settings queries
|
/// Do this before calling anything, even settings queries
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[BizImport(CC, Compatibility = true)]
|
[BizImport(CC)]
|
||||||
public abstract void PreInit();
|
public abstract void PreInit();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the initial frontend time, this needs to be done before InitRom/InitCd
|
||||||
|
/// As init process might query the frontend time
|
||||||
|
/// </summary>
|
||||||
|
[BizImport(CC)]
|
||||||
|
public abstract void SetInitialTime(long initialTime);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load a ROM
|
/// Load a ROM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -98,6 +98,21 @@ namespace BizHawk.Emulation.Cores.Waterbox
|
||||||
InitAllSettingsInfo(portData);
|
InitAllSettingsInfo(portData);
|
||||||
_nyma.SetFrontendSettingQuery(_settingsQueryDelegate);
|
_nyma.SetFrontendSettingQuery(_settingsQueryDelegate);
|
||||||
|
|
||||||
|
var rtcStart = DateTime.Parse("2010-01-01", DateTimeFormatInfo.InvariantInfo);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
rtcStart = DateTime.Parse(SettingsQuery("nyma.rtcinitialtime"), DateTimeFormatInfo.InvariantInfo);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Console.Error.WriteLine($"Couldn't parse DateTime \"{SettingsQuery("nyma.rtcinitialtime")}\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't optimistically set deterministic, as some cores like faust can change this
|
||||||
|
DeterministicEmulation = deterministic; // || SettingsQuery("nyma.rtcrealtime") == "0";
|
||||||
|
InitializeRtc(rtcStart);
|
||||||
|
_nyma.SetInitialTime(GetRtcTime(SettingsQuery("nyma.rtcrealtime") != "0"));
|
||||||
|
|
||||||
if (discs?.Length > 0)
|
if (discs?.Length > 0)
|
||||||
{
|
{
|
||||||
_disks = discs;
|
_disks = discs;
|
||||||
|
@ -167,18 +182,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
|
||||||
if (_disks != null)
|
if (_disks != null)
|
||||||
_nyma.SetCDCallbacks(_cdTocCallback, _cdSectorCallback);
|
_nyma.SetCDCallbacks(_cdTocCallback, _cdSectorCallback);
|
||||||
PutSettings(_settings);
|
PutSettings(_settings);
|
||||||
DateTime RtcStart = DateTime.Parse("2010-01-01", DateTimeFormatInfo.InvariantInfo);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
RtcStart = DateTime.Parse(SettingsQuery("nyma.rtcinitialtime"), DateTimeFormatInfo.InvariantInfo);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Console.Error.WriteLine($"Couldn't parse DateTime \"{SettingsQuery("nyma.rtcinitialtime")}\"");
|
|
||||||
}
|
|
||||||
// Don't optimistically set deterministic, as some cores like faust can change this
|
|
||||||
DeterministicEmulation = deterministic; // || SettingsQuery("nyma.rtcrealtime") == "0";
|
|
||||||
InitializeRtc(RtcStart);
|
|
||||||
_frameThreadPtr = _nyma.GetFrameThreadProc();
|
_frameThreadPtr = _nyma.GetFrameThreadProc();
|
||||||
if (_frameThreadPtr != IntPtr.Zero)
|
if (_frameThreadPtr != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue