Tighten up the sequence associated with changing pin levels + fix persistent HALT/PC bug

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2019-09-06 22:50:21 +01:00
parent bc491884b0
commit f01e3e0430
7 changed files with 229 additions and 138 deletions
+12 -6
View File
@@ -28,16 +28,22 @@ namespace EightBit
public virtual void RaisePOWER()
{
this.OnRaisingPOWER();
this.POWER.Raise();
this.OnRaisedPOWER();
if (this.POWER.Lowered())
{
this.OnRaisingPOWER();
this.POWER.Raise();
this.OnRaisedPOWER();
}
}
public virtual void LowerPOWER()
{
this.OnLoweringPOWER();
this.POWER.Lower();
this.OnLoweredPOWER();
if (this.POWER.Raised())
{
this.OnLoweringPOWER();
this.POWER.Lower();
this.OnLoweredPOWER();
}
}
protected virtual void OnRaisingPOWER() => this.RaisingPOWER?.Invoke(this, EventArgs.Empty);