Simplify switching processor pin handling

This commit is contained in:
Adrian Conlon
2025-06-22 21:07:02 +01:00
parent 3105930027
commit 3bbf300e05
7 changed files with 500 additions and 122 deletions

View File

@@ -43,9 +43,14 @@ namespace EightBit
public byte Read()
{
this.ReadingByte?.Invoke(this, EventArgs.Empty);
var returned = this.Data = this.Reference();
ReadByte?.Invoke(this, EventArgs.Empty);
return returned;
try
{
return this.Data = this.Reference();
}
finally
{
ReadByte?.Invoke(this, EventArgs.Empty);
}
}
public byte Read(ushort absolute)
@@ -68,8 +73,14 @@ namespace EightBit
public void Write()
{
this.WritingByte?.Invoke(this, EventArgs.Empty);
this.Reference() = this.Data;
this.WrittenByte?.Invoke(this, EventArgs.Empty);
try
{
this.Reference() = this.Data;
}
finally
{
this.WrittenByte?.Invoke(this, EventArgs.Empty);
}
}
public void Write(byte value)