Intellivision - wire up trace logger to the core. Currently does nothing since the TraceCallback in CP1610 needs to be wired up in the object in the right places

This commit is contained in:
adelikat 2016-11-11 16:17:35 -06:00
parent 9cb9941fb2
commit e44493d9fb
3 changed files with 22 additions and 0 deletions

View File

@ -1,6 +1,8 @@
using System;
using System.IO;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Components.CP1610
{
public sealed partial class CP1610
@ -14,6 +16,16 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
private ushort RegisterSP { get { return Register[6]; } set { Register[6] = value; } }
private ushort RegisterPC { get { return Register[7]; } set { Register[7] = value; } }
public string TraceHeader
{
get
{
return "TODO";
}
}
public Action<TraceInfo> TraceCallback;
public int TotalExecutedCycles;
public int PendingCycles;

View File

@ -38,6 +38,11 @@ namespace BizHawk.Emulation.Cores.Intellivision
public void FrameAdvance(bool render, bool rendersound)
{
if (Tracer.Enabled)
_cpu.TraceCallback = (s) => Tracer.Put(s);
else
_cpu.TraceCallback = null;
Frame++;
// read the controller state here for now
get_controller_state();

View File

@ -52,8 +52,13 @@ namespace BizHawk.Emulation.Cores.Intellivision
LoadExecutiveRom(CoreComm.CoreFileProvider.GetFirmware("INTV", "EROM", true, "Executive ROM is required."));
LoadGraphicsRom(CoreComm.CoreFileProvider.GetFirmware("INTV", "GROM", true, "Graphics ROM is required."));
Tracer = new TraceBuffer { Header = _cpu.TraceHeader };
(ServiceProvider as BasicServiceProvider).Register<ITraceable>(Tracer);
}
private ITraceable Tracer { get; set; }
private byte[] _rom;
private GameInfo _gameInfo;