Hack to allow single step tests to completely work: disable IO area triggers.

This commit is contained in:
Adrian Conlon
2025-08-01 22:59:00 +01:00
parent bb63211f17
commit 6143a9d285
3 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -37,9 +37,9 @@ namespace LR35902
private int allowed = 0;
protected Bus()
protected Bus(bool ioTriggers = true)
{
this.IO = new IoRegisters(this);
this.IO = new IoRegisters(this, ioTriggers);
this.CPU = new LR35902(this);
this.CPU.MachineTicked += this.CPU_MachineTicked;
this.WrittenByte += this.Bus_WrittenByte;
+6 -3
View File
@@ -90,12 +90,15 @@ namespace LR35902
private bool p11 = true; // left/b
private bool p10 = true; // right/a
public IoRegisters(Bus bus)
public IoRegisters(Bus bus, bool triggered = true)
: base(0x80)
{
this.bus = bus;
this.bus.ReadingByte += this.Bus_ReadingByte;
this.bus.WrittenByte += this.Bus_WrittenByte;
if (triggered)
{
this.bus.ReadingByte += this.Bus_ReadingByte;
this.bus.WrittenByte += this.Bus_WrittenByte;
}
}
public event EventHandler<LcdStatusModeEventArgs>? DisplayStatusModeUpdated;
+1
View File
@@ -9,6 +9,7 @@
public Ram RAM { get; } = new(0x10000);
public TestRunner()
: base(false)
{
this._mapping = new(this.RAM, 0x0000, (ushort)Mask.Sixteen, AccessLevel.ReadWrite);
}