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

73 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-10-13 20:26:32 +00:00
if (_tracer.Enabled)
{
_cpu.TraceCallback = s => _tracer.Put(s);
}
else
2017-05-01 14:10:07 +00:00
{
2017-10-13 20:26:32 +00:00
_cpu.TraceCallback = null;
2017-05-01 14:10:07 +00:00
}
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
2017-10-13 20:26:32 +00:00
for (int j = 0; j < 10000; j++)
{
_cpu.ExecuteOne();
}
_cpu.FlagI = 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()
{
}
}
}