BizHawk/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs

67 lines
1.3 KiB
C#
Raw Normal View History

using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Calculators
{
public partial class TI83 : IEmulator
{
2017-05-01 14:10:07 +00:00
public IEmulatorServiceProvider ServiceProvider { get; }
2017-05-01 14:10:07 +00:00
public ControllerDefinition ControllerDefinition => TI83Controller;
public void FrameAdvance(IController controller, bool render, bool rendersound)
{
_controller = controller;
_lagged = true;
2017-05-01 14:10:07 +00:00
_cpu.Debug = _tracer.Enabled;
2016-02-28 13:07:22 +00:00
2017-05-01 14:10:07 +00:00
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);
}
2016-02-28 13:07:22 +00:00
2017-05-01 14:10:07 +00:00
// I eyeballed this speed
for (int i = 0; i < 5; i++)
{
_onPressed = controller.IsPressed("ON");
2017-05-01 14:10:07 +00:00
// and this was derived from other emus
_cpu.ExecuteCycles(10000);
_cpu.Interrupt = true;
}
Frame++;
if (_lagged)
{
_lagCount++;
}
_isLag = _lagged;
}
public int Frame
{
get { return _frame; }
2017-05-01 14:10:07 +00:00
private set { _frame = value; }
}
2017-05-01 14:10:07 +00:00
public string SystemId => "TI83";
2017-05-01 14:10:07 +00:00
public bool DeterministicEmulation => true;
2017-05-01 14:10:07 +00:00
public void ResetCounters()
{
Frame = 0;
_lagCount = 0;
_isLag = false;
}
2017-05-01 14:10:07 +00:00
public CoreComm CoreComm { get; }
2017-05-01 14:10:07 +00:00
public void Dispose()
{
}
}
}