mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-11-25 21:17:35 +00:00
Simplify switching processor pin handling
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user