Tidy register increment/decrement a little.

This commit is contained in:
Adrian Conlon
2025-07-25 16:32:30 +01:00
parent c271b28495
commit 2f338c6c46
10 changed files with 68 additions and 58 deletions

View File

@@ -599,16 +599,19 @@ namespace M6502
protected override byte FetchInstruction()
{
this.LowerSYNC();
System.Diagnostics.Debug.Assert(this.Cycles == 1, "An extra cycle has occurred");
try
{
System.Diagnostics.Debug.Assert(this.Cycles == 1, "An extra cycle has occurred");
// Can't use "FetchByte", since that would add an extra tick.
this.ImmediateAddress();
var returned = this.ReadFromBus();
System.Diagnostics.Debug.Assert(this.Cycles == 1, "BUS read has introduced stray cycles");
this.RaiseSYNC();
return returned;
// Can't use "FetchByte", since that would add an extra tick.
this.ImmediateAddress();
return this.ReadFromBus();
}
finally
{
System.Diagnostics.Debug.Assert(this.Cycles == 1, "BUS read has introduced stray cycles");
this.RaiseSYNC();
}
}
#endregion