Explicitly state order of operations in code, rather than relying upon RAII etc. (for speed. Much faster)

This commit is contained in:
Adrian Conlon
2025-08-04 15:47:26 +01:00
parent 319190b7a5
commit 9d208de9bb
8 changed files with 156 additions and 635 deletions
+11 -41
View File
@@ -69,17 +69,11 @@ namespace EightBit
{
this.ResetCycles();
ExecutingInstruction?.Invoke(this, EventArgs.Empty);
try
if (this.Powered)
{
if (this.Powered)
{
this.PoweredStep();
}
}
finally
{
ExecutedInstruction?.Invoke(this, EventArgs.Empty);
this.PoweredStep();
}
ExecutedInstruction?.Invoke(this, EventArgs.Empty);
return this.Cycles;
}
@@ -121,14 +115,8 @@ namespace EightBit
if (this.RESET.Lowered())
{
RaisingRESET?.Invoke(this, EventArgs.Empty);
try
{
this.RESET.Raise();
}
finally
{
RaisedRESET?.Invoke(this, EventArgs.Empty);
}
this.RESET.Raise();
RaisedRESET?.Invoke(this, EventArgs.Empty);
}
}
@@ -137,14 +125,8 @@ namespace EightBit
if (this.RESET.Raised())
{
LoweringRESET?.Invoke(this, EventArgs.Empty);
try
{
this.RESET.Lower();
}
finally
{
LoweredRESET?.Invoke(this, EventArgs.Empty);
}
this.RESET.Lower();
LoweredRESET?.Invoke(this, EventArgs.Empty);
}
}
@@ -154,14 +136,8 @@ namespace EightBit
if (this.INT.Lowered())
{
RaisingINT?.Invoke(this, EventArgs.Empty);
try
{
this.INT.Raise();
}
finally
{
RaisedINT?.Invoke(this, EventArgs.Empty);
}
this.INT.Raise();
RaisedINT?.Invoke(this, EventArgs.Empty);
}
}
@@ -170,14 +146,8 @@ namespace EightBit
if (this.INT.Raised())
{
LoweringINT?.Invoke(this, EventArgs.Empty);
try
{
this.INT.Lower();
}
finally
{
LoweredINT?.Invoke(this, EventArgs.Empty);
}
this.INT.Lower();
LoweredINT?.Invoke(this, EventArgs.Empty);
}
}