C64 - wire up the trace logger, to the 6502 parts of the 6510 at least. THere might be more things to wire up

This commit is contained in:
adelikat 2017-05-16 18:40:17 -05:00
parent f093ad8606
commit 001091f9a1
3 changed files with 26 additions and 1 deletions

View File

@ -12,6 +12,16 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
{
_board.Controller = controller;
if (_tracer.Enabled)
{
_board.Cpu.TraceCallback = s => _tracer.Put(s);
}
else
{
_board.Cpu.TraceCallback = null;
}
if (controller.IsPressed("Next Disk") && !_nextPressed)
{
_nextPressed = true;

View File

@ -56,6 +56,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
ser.Register<IVideoProvider>(_board.Vic);
ser.Register<IDriveLight>(this);
_tracer = new TraceBuffer { Header = _board.Cpu.TraceHeader };
ser.Register<ITraceable>(_tracer);
}
// Currently we will require at least one rom. If multiple they MUST be all the same media type in the same format
@ -135,7 +138,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
private int _frameCycles;
private int _frame;
private ITraceable _tracer;
// Disk stuff
private bool _nextPressed;

View File

@ -1,6 +1,7 @@
using System;
using BizHawk.Common;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Components.M6502;
namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
@ -46,6 +47,17 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
HardReset();
}
public string TraceHeader
{
get { return "6510: PC, machine code, mnemonic, operands, registers (A, X, Y, P, SP), flags (NVTBDIZCR)"; }
}
public Action<TraceInfo> TraceCallback
{
get { return _cpu.TraceCallback; }
set { _cpu.TraceCallback = value; }
}
public void SetOverflow()
{
}