gameboy: support setting RTC initial time for TAS, and support chaining the RTC to the real clock for non-TAS.
This commit is contained in:
parent
93b710e4ab
commit
490a3dc3cf
|
@ -258,7 +258,8 @@ namespace BizHawk.Client.Common
|
||||||
right,
|
right,
|
||||||
xmlGame.Assets["RightRom"],
|
xmlGame.Assets["RightRom"],
|
||||||
GetCoreSettings<GambatteLink>(),
|
GetCoreSettings<GambatteLink>(),
|
||||||
GetCoreSyncSettings<GambatteLink>());
|
GetCoreSyncSettings<GambatteLink>(),
|
||||||
|
Deterministic);
|
||||||
|
|
||||||
// other stuff todo
|
// other stuff todo
|
||||||
break;
|
break;
|
||||||
|
@ -363,7 +364,8 @@ namespace BizHawk.Client.Common
|
||||||
game,
|
game,
|
||||||
rom.FileData,
|
rom.FileData,
|
||||||
GetCoreSettings<Gameboy>(),
|
GetCoreSettings<Gameboy>(),
|
||||||
GetCoreSyncSettings<Gameboy>());
|
GetCoreSyncSettings<Gameboy>(),
|
||||||
|
Deterministic);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -260,6 +260,12 @@
|
||||||
<Compile Include="config\GB\GBPrefControl.Designer.cs">
|
<Compile Include="config\GB\GBPrefControl.Designer.cs">
|
||||||
<DependentUpon>GBPrefControl.cs</DependentUpon>
|
<DependentUpon>GBPrefControl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="config\GB\GBPrefs.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="config\GB\GBPrefs.Designer.cs">
|
||||||
|
<DependentUpon>GBPrefs.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="config\GenericCoreConfig.cs">
|
<Compile Include="config\GenericCoreConfig.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -1015,6 +1021,9 @@
|
||||||
<EmbeddedResource Include="config\GB\GBPrefControl.resx">
|
<EmbeddedResource Include="config\GB\GBPrefControl.resx">
|
||||||
<DependentUpon>GBPrefControl.cs</DependentUpon>
|
<DependentUpon>GBPrefControl.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="config\GB\GBPrefs.resx">
|
||||||
|
<DependentUpon>GBPrefs.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="config\GenericCoreConfig.resx">
|
<EmbeddedResource Include="config\GenericCoreConfig.resx">
|
||||||
<DependentUpon>GenericCoreConfig.cs</DependentUpon>
|
<DependentUpon>GenericCoreConfig.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1437,12 +1437,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void GBSubMenu_DropDownOpened(object sender, EventArgs e)
|
private void GBSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
|
|
||||||
|
|
||||||
GBForceDMGMenuItem.Checked = s.ForceDMG;
|
|
||||||
GBAInCGBModeMenuItem.Checked = s.GBACGB;
|
|
||||||
GBMulticartCompatibilityMenuItem.Checked = s.MulticartCompat;
|
|
||||||
LoadGBInSGBMenuItem.Checked = Global.Config.GB_AsSGB;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GBForceDMGMenuItem_Click(object sender, EventArgs e)
|
private void GBForceDMGMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -3206,5 +3206,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
private void GBcoreSettingsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
BizHawk.Client.EmuHawk.config.GB.GBPrefs.DoGBPrefsDialog(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
namespace BizHawk.Client.EmuHawk.config.GB
|
||||||
|
{
|
||||||
|
partial class GBPrefs
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.buttonOK = new System.Windows.Forms.Button();
|
||||||
|
this.buttonCancel = new System.Windows.Forms.Button();
|
||||||
|
this.gbPrefControl1 = new BizHawk.Client.EmuHawk.config.GB.GBPrefControl();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// buttonOK
|
||||||
|
//
|
||||||
|
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||||
|
this.buttonOK.Location = new System.Drawing.Point(280, 363);
|
||||||
|
this.buttonOK.Name = "buttonOK";
|
||||||
|
this.buttonOK.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.buttonOK.TabIndex = 1;
|
||||||
|
this.buttonOK.Text = "OK";
|
||||||
|
this.buttonOK.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.buttonCancel.Location = new System.Drawing.Point(361, 363);
|
||||||
|
this.buttonCancel.Name = "buttonCancel";
|
||||||
|
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.buttonCancel.TabIndex = 2;
|
||||||
|
this.buttonCancel.Text = "Cancel";
|
||||||
|
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// gbPrefControl1
|
||||||
|
//
|
||||||
|
this.gbPrefControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.gbPrefControl1.ColorGameBoy = false;
|
||||||
|
this.gbPrefControl1.Location = new System.Drawing.Point(12, 12);
|
||||||
|
this.gbPrefControl1.Name = "gbPrefControl1";
|
||||||
|
this.gbPrefControl1.Size = new System.Drawing.Size(424, 345);
|
||||||
|
this.gbPrefControl1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// GBPrefs
|
||||||
|
//
|
||||||
|
this.AcceptButton = this.buttonOK;
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(448, 398);
|
||||||
|
this.Controls.Add(this.buttonCancel);
|
||||||
|
this.Controls.Add(this.buttonOK);
|
||||||
|
this.Controls.Add(this.gbPrefControl1);
|
||||||
|
this.Name = "GBPrefs";
|
||||||
|
this.Text = "Gameboy Settings";
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private GBPrefControl gbPrefControl1;
|
||||||
|
private System.Windows.Forms.Button buttonOK;
|
||||||
|
private System.Windows.Forms.Button buttonCancel;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
||||||
|
using BizHawk.Client.Common;
|
||||||
|
|
||||||
|
namespace BizHawk.Client.EmuHawk.config.GB
|
||||||
|
{
|
||||||
|
public partial class GBPrefs : Form
|
||||||
|
{
|
||||||
|
public GBPrefs()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DoGBPrefsDialog(IWin32Window owner)
|
||||||
|
{
|
||||||
|
var s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings();
|
||||||
|
var ss = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
|
||||||
|
|
||||||
|
using (var dlg = new GBPrefs())
|
||||||
|
{
|
||||||
|
dlg.gbPrefControl1.PutSettings(s, ss);
|
||||||
|
dlg.gbPrefControl1.ColorGameBoy = ((Gameboy)Global.Emulator).IsCGBMode();
|
||||||
|
if (dlg.ShowDialog(owner) == DialogResult.OK)
|
||||||
|
{
|
||||||
|
dlg.gbPrefControl1.GetSettings(out s, out ss);
|
||||||
|
Global.Emulator.PutSettings(s);
|
||||||
|
GlobalWin.MainForm.PutCoreSyncSettings(ss);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,120 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
|
@ -35,24 +35,57 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LibGambatte.Buttons CurrentButtons = 0;
|
LibGambatte.Buttons CurrentButtons = 0;
|
||||||
|
|
||||||
|
#region RTC
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// RTC time when emulation begins.
|
/// RTC time when emulation begins.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
uint zerotime = 0;
|
uint zerotime = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// if true, RTC will run off of real elapsed time
|
||||||
|
/// </summary>
|
||||||
|
bool real_rtc_time = false;
|
||||||
|
|
||||||
LibGambatte.RTCCallback TimeCallback;
|
LibGambatte.RTCCallback TimeCallback;
|
||||||
|
|
||||||
|
static long GetUnixNow()
|
||||||
|
{
|
||||||
|
// because internally the RTC works off of relative time, we don't need to base
|
||||||
|
// this off of any particular canonical epoch.
|
||||||
|
return DateTime.UtcNow.Ticks / 10000000L - 60000000000L;
|
||||||
|
}
|
||||||
|
|
||||||
uint GetCurrentTime()
|
uint GetCurrentTime()
|
||||||
{
|
{
|
||||||
ulong fn = (ulong)Frame;
|
if (real_rtc_time)
|
||||||
// as we're exactly tracking cpu cycles, this can be pretty accurate
|
{
|
||||||
fn *= 4389;
|
return (uint)GetUnixNow();
|
||||||
fn /= 262144;
|
}
|
||||||
fn += zerotime;
|
else
|
||||||
return (uint)fn;
|
{
|
||||||
|
ulong fn = (ulong)Frame;
|
||||||
|
// as we're exactly tracking cpu cycles, this can be pretty accurate
|
||||||
|
fn *= 4389;
|
||||||
|
fn /= 262144;
|
||||||
|
fn += zerotime;
|
||||||
|
return (uint)fn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Gameboy(CoreComm comm, GameInfo game, byte[] romdata, object Settings, object SyncSettings)
|
uint GetInitialTime()
|
||||||
|
{
|
||||||
|
if (real_rtc_time)
|
||||||
|
return (uint)GetUnixNow();
|
||||||
|
else
|
||||||
|
// setting the initial boot time to 0 will cause our zerotime
|
||||||
|
// to function as an initial offset, which is what we want
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public Gameboy(CoreComm comm, GameInfo game, byte[] romdata, object Settings, object SyncSettings, bool deterministic)
|
||||||
{
|
{
|
||||||
CoreComm = comm;
|
CoreComm = comm;
|
||||||
|
|
||||||
|
@ -67,6 +100,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
ThrowExceptionForBadRom(romdata);
|
ThrowExceptionForBadRom(romdata);
|
||||||
BoardName = MapperName(romdata);
|
BoardName = MapperName(romdata);
|
||||||
|
|
||||||
|
DeterministicEmulation = deterministic;
|
||||||
|
|
||||||
GambatteState = LibGambatte.gambatte_create();
|
GambatteState = LibGambatte.gambatte_create();
|
||||||
|
|
||||||
if (GambatteState == IntPtr.Zero)
|
if (GambatteState == IntPtr.Zero)
|
||||||
|
@ -75,6 +110,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.SyncSettings = (GambatteSyncSettings)SyncSettings ?? GambatteSyncSettings.GetDefaults();
|
this.SyncSettings = (GambatteSyncSettings)SyncSettings ?? GambatteSyncSettings.GetDefaults();
|
||||||
|
// copy over non-loadflag syncsettings now; they won't take effect if changed later
|
||||||
|
zerotime = (uint)this.SyncSettings.RTCInitialTime;
|
||||||
|
real_rtc_time = DeterministicEmulation ? false : this.SyncSettings.RealTimeRTC;
|
||||||
|
|
||||||
LibGambatte.LoadFlags flags = 0;
|
LibGambatte.LoadFlags flags = 0;
|
||||||
|
|
||||||
|
@ -357,7 +395,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
|
|
||||||
public string BoardName { get; private set; }
|
public string BoardName { get; private set; }
|
||||||
|
|
||||||
public bool DeterministicEmulation { get { return true; } }
|
public bool DeterministicEmulation { get; private set; }
|
||||||
|
|
||||||
#region saveram
|
#region saveram
|
||||||
|
|
||||||
|
@ -932,7 +970,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
bool ret;
|
bool ret;
|
||||||
if (s.ForceDMG != SyncSettings.ForceDMG ||
|
if (s.ForceDMG != SyncSettings.ForceDMG ||
|
||||||
s.GBACGB != SyncSettings.GBACGB ||
|
s.GBACGB != SyncSettings.GBACGB ||
|
||||||
s.MulticartCompat != SyncSettings.MulticartCompat)
|
s.MulticartCompat != SyncSettings.MulticartCompat ||
|
||||||
|
s.RealTimeRTC != SyncSettings.RealTimeRTC ||
|
||||||
|
s.RTCInitialTime != SyncSettings.RTCInitialTime)
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
ret = false;
|
ret = false;
|
||||||
|
@ -970,11 +1010,26 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
public class GambatteSyncSettings
|
public class GambatteSyncSettings
|
||||||
{
|
{
|
||||||
[Description("Force the game to run on DMG hardware, even if it's detected as a CGB game. Relevant for games that are \"CGB Enhanced\" but do not require CGB.")]
|
[Description("Force the game to run on DMG hardware, even if it's detected as a CGB game. Relevant for games that are \"CGB Enhanced\" but do not require CGB.")]
|
||||||
|
[DefaultValue(false)]
|
||||||
public bool ForceDMG { get; set; }
|
public bool ForceDMG { get; set; }
|
||||||
[Description("Emulate GBA hardware running a CGB game, instead of CGB hardware. Relevant only for titles that detect the presense of a GBA, such as Shantae.")]
|
[Description("Emulate GBA hardware running a CGB game, instead of CGB hardware. Relevant only for titles that detect the presense of a GBA, such as Shantae.")]
|
||||||
|
[DefaultValue(false)]
|
||||||
public bool GBACGB { get; set; }
|
public bool GBACGB { get; set; }
|
||||||
[Description("Use special compatibility hacks for certain multicart games. Relevant only for specific multicarts.")]
|
[Description("Use special compatibility hacks for certain multicart games. Relevant only for specific multicarts.")]
|
||||||
|
[DefaultValue(false)]
|
||||||
public bool MulticartCompat { get; set; }
|
public bool MulticartCompat { get; set; }
|
||||||
|
[Description("If true, the real time clock in MBC3 games will reflect real time, instead of emulated time. Ignored (treated as false) when a movie is recording.")]
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool RealTimeRTC { get; set; }
|
||||||
|
[Description("Set the initial RTC time in terms of elapsed seconds. Only used when RealTimeRTC is false.")]
|
||||||
|
[DefaultValue(0)]
|
||||||
|
public int RTCInitialTime
|
||||||
|
{
|
||||||
|
get { return _RTCInitialTime; }
|
||||||
|
set { _RTCInitialTime = Math.Max(0, Math.Min(1024 * 24 * 60 * 60, value)); }
|
||||||
|
}
|
||||||
|
[JsonIgnore]
|
||||||
|
int _RTCInitialTime;
|
||||||
|
|
||||||
public static GambatteSyncSettings GetDefaults()
|
public static GambatteSyncSettings GetDefaults()
|
||||||
{
|
{
|
||||||
|
@ -982,7 +1037,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
{
|
{
|
||||||
ForceDMG = false,
|
ForceDMG = false,
|
||||||
GBACGB = false,
|
GBACGB = false,
|
||||||
MulticartCompat = false
|
MulticartCompat = false,
|
||||||
|
RealTimeRTC = false,
|
||||||
|
_RTCInitialTime = 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,14 +46,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
return right ? R.IsCGBMode() : L.IsCGBMode();
|
return right ? R.IsCGBMode() : L.IsCGBMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public GambatteLink(CoreComm comm, GameInfo leftinfo, byte[] leftrom, GameInfo rightinfo, byte[] rightrom, object Settings, object SyncSettings)
|
public GambatteLink(CoreComm comm, GameInfo leftinfo, byte[] leftrom, GameInfo rightinfo, byte[] rightrom, object Settings, object SyncSettings, bool deterministic)
|
||||||
{
|
{
|
||||||
GambatteLinkSettings _Settings = (GambatteLinkSettings)Settings ?? GambatteLinkSettings.GetDefaults();
|
GambatteLinkSettings _Settings = (GambatteLinkSettings)Settings ?? GambatteLinkSettings.GetDefaults();
|
||||||
GambatteLinkSyncSettings _SyncSettings = (GambatteLinkSyncSettings)SyncSettings ?? GambatteLinkSyncSettings.GetDefaults();
|
GambatteLinkSyncSettings _SyncSettings = (GambatteLinkSyncSettings)SyncSettings ?? GambatteLinkSyncSettings.GetDefaults();
|
||||||
|
|
||||||
CoreComm = comm;
|
CoreComm = comm;
|
||||||
L = new Gameboy(new CoreComm(comm.ShowMessage, comm.Notify), leftinfo, leftrom, _Settings.L, _SyncSettings.L);
|
L = new Gameboy(new CoreComm(comm.ShowMessage, comm.Notify), leftinfo, leftrom, _Settings.L, _SyncSettings.L, deterministic);
|
||||||
R = new Gameboy(new CoreComm(comm.ShowMessage, comm.Notify), rightinfo, rightrom, _Settings.R, _SyncSettings.R);
|
R = new Gameboy(new CoreComm(comm.ShowMessage, comm.Notify), rightinfo, rightrom, _Settings.R, _SyncSettings.R, deterministic);
|
||||||
|
|
||||||
// connect link cable
|
// connect link cable
|
||||||
LibGambatte.gambatte_linkstatus(L.GambatteState, 259);
|
LibGambatte.gambatte_linkstatus(L.GambatteState, 259);
|
||||||
|
@ -213,7 +213,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
public int LagCount { get; set; }
|
public int LagCount { get; set; }
|
||||||
public bool IsLagFrame { get; private set; }
|
public bool IsLagFrame { get; private set; }
|
||||||
public string SystemId { get { return "DGB"; } }
|
public string SystemId { get { return "DGB"; } }
|
||||||
public bool DeterministicEmulation { get { return true; } }
|
public bool DeterministicEmulation { get { return L.DeterministicEmulation && R.DeterministicEmulation; } }
|
||||||
|
|
||||||
public string BoardName { get { return L.BoardName + '|' + R.BoardName; } }
|
public string BoardName { get { return L.BoardName + '|' + R.BoardName; } }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue