Prefer to use events directly, rather than through "On" methods

This commit is contained in:
Adrian Conlon
2025-03-29 11:31:47 +00:00
parent 87abbaa75e
commit b461eb97d6
9 changed files with 92 additions and 108 deletions
+2 -3
View File
@@ -42,6 +42,7 @@ namespace LR35902
this.IO = new IoRegisters(this);
this.CPU = new LR35902(this);
this.CPU.MachineTicked += this.CPU_MachineTicked;
this.WrittenByte += this.Bus_WrittenByte;
}
public LR35902 CPU { get; }
@@ -173,10 +174,8 @@ namespace LR35902
return new MemoryMapping(this.highInternalRam, 0xff80, 0xffff, AccessLevel.ReadWrite);
}
protected override void OnWrittenByte()
private void Bus_WrittenByte(object? sender, EventArgs e)
{
base.OnWrittenByte();
var address = this.Address.Word;
var value = this.Data;