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

View File

@@ -78,30 +78,42 @@ namespace EightBit
public virtual void RaiseRESET()
{
this.OnRaisingRESET();
this.RESET.Raise();
this.OnRaisedRESET();
if (this.RESET.Lowered())
{
this.OnRaisingRESET();
this.RESET.Raise();
this.OnRaisedRESET();
}
}
public virtual void LowerRESET()
{
this.OnLoweringRESET();
this.RESET.Lower();
this.OnLoweredRESET();
if (this.RESET.Raised())
{
this.OnLoweringRESET();
this.RESET.Lower();
this.OnLoweredRESET();
}
}
public virtual void RaiseINT()
{
this.OnRaisingINT();
this.INT.Raise();
this.OnRaisedINT();
if (this.INT.Lowered())
{
this.OnRaisingINT();
this.INT.Raise();
this.OnRaisedINT();
}
}
public virtual void LowerINT()
{
this.OnLoweringINT();
this.INT.Lower();
this.OnLoweredINT();
if (this.INT.Raised())
{
this.OnLoweringINT();
this.INT.Lower();
this.OnLoweredINT();
}
}
protected virtual void OnRaisingRESET() => this.RaisingRESET?.Invoke(this, EventArgs.Empty);