wire up memory execute callbacks to SMS and TI83

This commit is contained in:
adelikat 2015-01-24 20:36:36 +00:00
parent e4800cb8f3
commit cdd0716420
4 changed files with 13 additions and 0 deletions

View File

@ -46,7 +46,14 @@ namespace BizHawk.Emulation.Cores.Components.Z80
{
if (Debug)
{
Logger(State());
}
if (MemoryCallbacks != null)
{
MemoryCallbacks.CallExecutes(RegPC.Word);
}
++RegR;
switch (ReadMemory(RegPC.Word++))

View File

@ -1,7 +1,9 @@
using System;
using System.Globalization;
using System.IO;
using BizHawk.Common;
using BizHawk.Emulation.Common;
// This Z80 emulator is a modified version of Ben Ryves 'Brazil' emulator.
// It is MIT licensed.
@ -36,6 +38,8 @@ namespace BizHawk.Emulation.Cores.Components.Z80
public Func<ushort, byte> ReadMemory;
public Action<ushort, byte> WriteMemory;
public IMemoryCallbackSystem MemoryCallbacks { get; set; }
// Utility function, not used by core
public ushort ReadWord(ushort addr)
{

View File

@ -64,6 +64,7 @@ namespace BizHawk.Emulation.Cores.Calculators
cpu.WriteHardware = WriteHardware;
cpu.IRQCallback = IRQCallback;
cpu.NMICallback = NMICallback;
cpu.MemoryCallbacks = MemoryCallbacks;
this.rom = rom;
LinkPort = new TI83LinkPort(this);

View File

@ -143,6 +143,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
Cpu.RegisterSP = 0xDFF0;
Cpu.ReadHardware = ReadPort;
Cpu.WriteHardware = WritePort;
Cpu.MemoryCallbacks = MemoryCallbacks;
Vdp = new VDP(this, Cpu, IsGameGear ? VdpMode.GameGear : VdpMode.SMS, DisplayType);
(ServiceProvider as BasicServiceProvider).Register<IVideoProvider>(Vdp);