Try to bring the Z80 fusetest back to life

This commit is contained in:
Adrian Conlon
2025-05-03 02:09:31 +01:00
parent 946121defb
commit 898a2bc7ea
2 changed files with 20 additions and 4 deletions

View File

@ -13,6 +13,14 @@ namespace EightBit
#endregion
#region Instruction execution events
public event EventHandler<EventArgs>? ReadingMemory;
public event EventHandler<EventArgs>? ReadMemory;
public event EventHandler<EventArgs>? WritingMemory;
public event EventHandler<EventArgs>? WroteMemory;
#endregion
private PinLevel _resetLine;
private PinLevel _intLine;
@ -142,6 +150,14 @@ namespace EightBit
protected virtual void HandleINT() => this.RaiseINT();
protected void OnReadingMemory() => this.ReadingMemory?.Invoke(this, EventArgs.Empty);
protected void OnReadMemory() => this.ReadMemory?.Invoke(this, EventArgs.Empty);
protected void OnWritingMemory() => this.WritingMemory?.Invoke(this, EventArgs.Empty);
protected void OnWroteMemory() => this.WroteMemory?.Invoke(this, EventArgs.Empty);
protected void MemoryWrite(byte low, byte high)
{
this.Bus.Address.Assign(low, high);

View File

@ -98,8 +98,8 @@ namespace Z80.FuseTest
public override void Initialize()
{
this.ReadByte += this.Event_ReadByte;
this.WrittenByte += this.Event_WrittenByte;
this.cpu.ReadMemory += this.Cpu_ReadMemory;
this.cpu.WroteMemory += this.Cpu_WroteMemory;
this.ports.ReadPort += this.Ports_ReadPort;
this.ports.WrittenPort += this.Ports_WrittenPort;
this.cpu.ExecutedInstruction += this.Cpu_ExecutedInstruction;
@ -107,8 +107,8 @@ namespace Z80.FuseTest
private void Ports_ReadPort(object? sender, EventArgs e) => this.AddActualEvent("PR");
private void Ports_WrittenPort(object? sender, EventArgs e) => this.AddActualEvent("PW");
private void Event_ReadByte(object? sender, EventArgs e) => this.AddActualEvent("MR");
private void Event_WrittenByte(object? sender, EventArgs e) => this.AddActualEvent("MW");
private void Cpu_ReadMemory(object? sender, EventArgs e) => this.AddActualEvent("MR");
private void Cpu_WroteMemory(object? sender, EventArgs e) => this.AddActualEvent("MW");
private void AddActualEvent(string specifier)
{