mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-03-15 16:16:27 +00:00
Fix HALT instruction
This commit is contained in:
16
Z80/Z80.cs
16
Z80/Z80.cs
@@ -13,8 +13,6 @@ namespace Z80
|
||||
{
|
||||
this._ports = ports;
|
||||
this.RaisedPOWER += this.Z80_RaisedPOWER;
|
||||
this.LoweredHALT += this.Z80_LoweredHALT;
|
||||
this.RaisedHALT += this.Z80_RaisedHALT;
|
||||
}
|
||||
|
||||
private readonly InputOutput _ports;
|
||||
@@ -194,16 +192,6 @@ namespace Z80
|
||||
this.ResetPrefixes();
|
||||
}
|
||||
|
||||
private void Z80_RaisedHALT(object? sender, EventArgs e)
|
||||
{
|
||||
++this.PC.Word; // Release the PC from HALT instruction
|
||||
}
|
||||
|
||||
private void Z80_LoweredHALT(object? sender, EventArgs e)
|
||||
{
|
||||
--this.PC.Word; // Keep the PC on the HALT instruction (i.e. executing NOP)
|
||||
}
|
||||
|
||||
private void ResetPrefixes()
|
||||
{
|
||||
this._prefixCB = this._prefixDD = this._prefixED = this._prefixFD = false;
|
||||
@@ -494,11 +482,14 @@ namespace Z80
|
||||
|
||||
protected override void MemoryWrite()
|
||||
{
|
||||
this.OnWritingMemory();
|
||||
this.MemoryUpdate(3);
|
||||
this.OnWroteMemory();
|
||||
}
|
||||
|
||||
protected override byte MemoryRead()
|
||||
{
|
||||
this.OnReadingMemory();
|
||||
this.Tick();
|
||||
this.LowerMREQ();
|
||||
this.LowerRD();
|
||||
@@ -516,6 +507,7 @@ namespace Z80
|
||||
this.RaiseRFSH();
|
||||
}
|
||||
this.Tick();
|
||||
this.OnReadMemory();
|
||||
return returned;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user