No need for bus read/write events with cycle accurate cpu read/write events

This commit is contained in:
Adrian Conlon committed 2026-05-29 10:17:40 +01:00
1 parent ee9917bb7f
commit 2d145ec023
9 files changed
+20 -29

No files matched your search

-12
View File
@@ -11,14 +11,6 @@ namespace EightBit
private bool _writing;
private byte _data;
public event EventHandler<EventArgs>? WritingByte;
public event EventHandler<EventArgs>? WrittenByte;
public event EventHandler<EventArgs>? ReadingByte;
public event EventHandler<EventArgs>? ReadByte;
public ref byte Data => ref this._data;
public Register16 Address { get; } = new();
@@ -46,20 +38,16 @@ namespace EightBit
public void Read()
{
Debug.Assert(!this._writing, "Writing flag is in an invalid state");
this.ReadingByte?.Invoke(this, EventArgs.Empty);
this.Data = this.Reference();
this.ReadByte?.Invoke(this, EventArgs.Empty);
Debug.Assert(!this._writing, "Writing flag is in an invalid state");
}
public void Write()
{
Debug.Assert(!this._writing, "Writing flag is in an invalid state");
this.WritingByte?.Invoke(this, EventArgs.Empty);
this._writing = true;
this.Reference() = this.Data;
this._writing = false;
this.WrittenByte?.Invoke(this, EventArgs.Empty);
Debug.Assert(!this._writing, "Writing flag is in an invalid state");
}