wire up memory execute callbacks to SMS and TI83
This commit is contained in:
parent
e4800cb8f3
commit
cdd0716420
|
@ -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++))
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue