diff --git a/src/BizHawk.Emulation.Cores/CPUs/Z80A/IZ80ALink.cs b/src/BizHawk.Emulation.Cores/CPUs/Z80A/IZ80ALink.cs index d2ab559813..5e6a03b862 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Z80A/IZ80ALink.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Z80A/IZ80ALink.cs @@ -23,5 +23,12 @@ // This is only called when the first byte of an instruction is fetched. void OnExecFetch(ushort address); + + void IRQCallback(); + void NMICallback(); + + // This will be a few cycles off for now + // It should suffice for now until Alyosha returns from hiatus + void IRQACKCallback(); } } diff --git a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs index 4682e7d727..0ac66eec22 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs @@ -242,8 +242,6 @@ namespace BizHawk.Emulation.Cores.Components.Z80A } } - public IMemoryCallbackSystem MemoryCallbacks { get; set; } - public void SetCpuLink(TLink link) => _link = link; diff --git a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.CpuLink.cs b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.CpuLink.cs index 59c7a22e97..55faeb7edd 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.CpuLink.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.CpuLink.cs @@ -27,6 +27,16 @@ namespace BizHawk.Emulation.Cores.Calculators.TI83 public void OnExecFetch(ushort address) { } + + public void IRQCallback() + => ti83.IRQCallback(); + + public void NMICallback() + => ti83.NMICallback(); + + public void IRQACKCallback() + { + } } } } \ No newline at end of file diff --git a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs index 3eb02412e3..af0da3a1f1 100644 --- a/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs +++ b/src/BizHawk.Emulation.Cores/Calculators/TI83/TI83.cs @@ -16,12 +16,7 @@ namespace BizHawk.Emulation.Cores.Calculators.TI83 ServiceProvider = ser; PutSettings(lp.Settings ?? new TI83CommonSettings()); - _cpu = new Z80A(new CpuLink(this)) - { - IRQCallback = IRQCallback, - NMICallback = NMICallback, - MemoryCallbacks = MemoryCallbacks - }; + _cpu = new Z80A(new CpuLink(this)); _rom = lp.Comm.CoreFileProvider.GetFirmwareOrThrow(new("TI83", "Rom")); LinkPort = new TI83LinkPort(this); diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.CpuLink.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.CpuLink.cs index 3788f40521..e5c1c52e3f 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.CpuLink.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.CpuLink.cs @@ -27,6 +27,17 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public void OnExecFetch(ushort address) { } + + public void IRQCallback() + { + } + + public void NMICallback() + { + } + + public void IRQACKCallback() + => machine.GateArray.IORQA(); } } } diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs index 36b879d964..abf68689bc 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs @@ -23,12 +23,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC ServiceProvider = ser; CoreComm = lp.Comm; _gameInfo = lp.Roms.Select(r => r.Game).ToList(); - - _cpu = new Z80A(default) - { - MemoryCallbacks = MemoryCallbacks - }; - + _cpu = new Z80A(default); _tracer = new TraceBuffer(_cpu.TraceHeader); _files = lp.Roms.Select(r => r.RomData).ToList(); @@ -59,7 +54,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC SoftReset = _machine.SoftReset; _cpu.SetCpuLink(new CpuLink(_machine)); - _cpu.IRQACKCallback = _machine.GateArray.IORQA; ser.Register(_tracer); ser.Register(_cpu); diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.CpuLink.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.CpuLink.cs index f9855341a1..392b29f3f3 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.CpuLink.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.CpuLink.cs @@ -28,6 +28,18 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public void OnExecFetch(ushort address) => machine.CPUMon.OnExecFetch(address); + + public void IRQCallback() + { + } + + public void NMICallback() + { + } + + public void IRQACKCallback() + { + } } } } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs index e87ed33fea..5ada524537 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs @@ -27,11 +27,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum _gameInfo = lp.Roms.Select(r => r.Game).ToList(); - _cpu = new Z80A(default) - { - MemoryCallbacks = MemoryCallbacks - }; - + _cpu = new Z80A(default); _tracer = new TraceBuffer(_cpu.TraceHeader); _files = lp.Roms.Select(r => r.RomData).ToList(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.CpuLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.CpuLink.cs index feeda298e0..d8352dae71 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.CpuLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.CpuLink.cs @@ -27,6 +27,18 @@ namespace BizHawk.Emulation.Cores.ColecoVision public void OnExecFetch(ushort address) { } + + public void IRQCallback() + { + } + + public void NMICallback() + { + } + + public void IRQACKCallback() + { + } } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index b7426df12f..f5dc114f63 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -17,10 +17,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision _syncSettings = syncSettings ?? new ColecoSyncSettings(); bool skipBios = _syncSettings.SkipBiosIntro; - _cpu = new Z80A(new CpuLink(this)) - { - MemoryCallbacks = MemoryCallbacks - }; + _cpu = new Z80A(new CpuLink(this)); PSG = new SN76489col(); SGM_sound = new AY_3_8910_SGM(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.CpuLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.CpuLink.cs index e9faf30b0d..648dd2b92c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.CpuLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.CpuLink.cs @@ -30,6 +30,18 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem public void OnExecFetch(ushort address) => sms.OnExecMemory(address); + + public void IRQCallback() + { + } + + public void NMICallback() + { + } + + public void IRQACKCallback() + { + } } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs index ef0960e74a..197e55fb6c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs @@ -77,10 +77,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem HasYM2413 = true; } - Cpu = new Z80A(new CpuLink(this)) - { - MemoryCallbacks = MemoryCallbacks - }; + Cpu = new Z80A(new CpuLink(this)); // set this before turning off GG system for GG_in_SMS games bool sms_reg_compat = !IsGameGear && (_region == SmsSyncSettings.Regions.Japan);