2015-02-07 15:02:52 +00:00
|
|
|
|
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; }
|
2015-02-07 15:02:52 +00:00
|
|
|
|
|
2017-05-01 14:10:07 +00:00
|
|
|
|
public ControllerDefinition ControllerDefinition => TI83Controller;
|
2015-02-07 15:02:52 +00:00
|
|
|
|
|
2017-05-02 01:09:11 +00:00
|
|
|
|
public void FrameAdvance(IController controller, bool render, bool rendersound)
|
2015-02-07 15:02:52 +00:00
|
|
|
|
{
|
2017-05-02 01:09:11 +00:00
|
|
|
|
_controller = controller;
|
2015-02-07 15:02:52 +00:00
|
|
|
|
_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
|
2015-02-07 15:02:52 +00:00
|
|
|
|
for (int i = 0; i < 5; i++)
|
|
|
|
|
{
|
2017-05-02 01:09:11 +00:00
|
|
|
|
_onPressed = controller.IsPressed("ON");
|
2015-02-07 15:02:52 +00:00
|
|
|
|
|
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;
|
2015-02-07 15:02:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Frame++;
|
|
|
|
|
|
|
|
|
|
if (_lagged)
|
|
|
|
|
{
|
|
|
|
|
_lagCount++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_isLag = _lagged;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int Frame
|
|
|
|
|
{
|
|
|
|
|
get { return _frame; }
|
2017-05-01 14:10:07 +00:00
|
|
|
|
private set { _frame = value; }
|
2015-02-07 15:02:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-05-01 14:10:07 +00:00
|
|
|
|
public string SystemId => "TI83";
|
2015-02-07 15:02:52 +00:00
|
|
|
|
|
2017-05-01 14:10:07 +00:00
|
|
|
|
public bool DeterministicEmulation => true;
|
2015-02-07 15:02:52 +00:00
|
|
|
|
|
2017-05-01 14:10:07 +00:00
|
|
|
|
public void ResetCounters()
|
2015-02-07 15:02:52 +00:00
|
|
|
|
{
|
|
|
|
|
Frame = 0;
|
|
|
|
|
_lagCount = 0;
|
|
|
|
|
_isLag = false;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-01 14:10:07 +00:00
|
|
|
|
public CoreComm CoreComm { get; }
|
2015-02-07 15:02:52 +00:00
|
|
|
|
|
2017-05-01 14:10:07 +00:00
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
}
|
2015-02-07 15:02:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|