Fix a number of write timing issues

This commit is contained in:
Adrian Conlon
2025-05-02 17:46:33 +01:00
parent fda52af260
commit 3617608e8c
+10 -3
View File
@@ -480,16 +480,21 @@ namespace Z80
#endregion
protected override void MemoryWrite()
protected void MemoryUpdate(int ticks)
{
this.LowerMREQ();
this.LowerWR();
this.Tick(3);
this.Tick(ticks);
base.MemoryWrite();
this.RaiseWR();
this.RaiseMREQ();
}
protected override void MemoryWrite()
{
this.MemoryUpdate(3);
}
protected override byte MemoryRead()
{
this.Tick();
@@ -760,6 +765,7 @@ namespace Z80
{
_ = this.MemoryRead();
}
this.Tick();
// Will need a post-MemoryWrite
return ref this.Bus.Data;
case 7:
@@ -774,7 +780,8 @@ namespace Z80
this.R(r, AccessLevel.WriteOnly) = value;
if (r == 6)
{
this.MemoryWrite();
this.MemoryUpdate(1);
this.Tick();
}
}