Cleanup SMS.IEmulator.cs

This commit is contained in:
adelikat 2017-05-08 11:42:22 -05:00
parent 01eb150b3d
commit b6fc3006e9
3 changed files with 14 additions and 12 deletions

View File

@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
{
public sealed partial class SMS : IEmulator
{
public IEmulatorServiceProvider ServiceProvider { get; private set; }
public IEmulatorServiceProvider ServiceProvider { get; }
public ControllerDefinition ControllerDefinition
{
@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
{
_controller = controller;
_lagged = true;
Frame++;
_frame++;
PSG.BeginFrame(Cpu.TotalExecutedCycles);
Cpu.Debug = Tracer.Enabled;
if (!IsGameGear)
@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
if (Cpu.Debug && Cpu.Logger == null) // TODO, lets not do this on each frame. But lets refactor CoreComm/CoreComm first
{
Cpu.Logger = (s) => Tracer.Put(s);
Cpu.Logger = s => Tracer.Put(s);
}
if (IsGameGear == false)
@ -62,19 +62,23 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
}
}
public string SystemId { get { return "SMS"; } }
public int Frame => _frame;
public bool DeterministicEmulation { get { return true; } }
public string SystemId => "SMS";
public bool DeterministicEmulation => true;
public void ResetCounters()
{
Frame = 0;
_frame = 0;
_lagCount = 0;
_isLag = false;
}
public CoreComm CoreComm { get; private set; }
public CoreComm CoreComm { get; }
public void Dispose() { }
public void Dispose()
{
}
}
}

View File

@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
YM2413.SyncState(ser);
}
ser.Sync("Frame", ref frame);
ser.Sync("Frame", ref _frame);
ser.Sync("LagCount", ref _lagCount);
ser.Sync("IsLag", ref _isLag);

View File

@ -193,9 +193,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
private bool HasYM2413 = false;
private IController _controller;
private int frame = 0;
public int Frame { get { return frame; } set { frame = value; } }
private int _frame = 0;
private byte Port01 = 0xFF;
private byte Port02 = 0xFF;