diff --git a/my_modules/pcjs-client/lib/cpu.js b/my_modules/pcjs-client/lib/cpu.js index 5dfbf3f38..8f3cc68e2 100644 --- a/my_modules/pcjs-client/lib/cpu.js +++ b/my_modules/pcjs-client/lib/cpu.js @@ -1016,7 +1016,10 @@ CPU.prototype.setBurstCycles = function(nCycles) var nDelta = this.nStepCycles - nCycles; /* * NOTE: If nDelta is negative, we will actually be increasing nStepCycles and nBurstCycles. + * Which is OK, but if we're also taking snapshots of the cycle counts, to make sure that instruction + * costs are being properly assessed, then we need to update nSnapCycles as well. */ + if (DEBUG) this.nSnapCycles -= nDelta; this.nStepCycles -= nDelta; this.nBurstCycles -= nDelta; return true; diff --git a/my_modules/pcjs-client/lib/x86opxx.js b/my_modules/pcjs-client/lib/x86opxx.js index 7a7730dfd..3462d79b9 100644 --- a/my_modules/pcjs-client/lib/x86opxx.js +++ b/my_modules/pcjs-client/lib/x86opxx.js @@ -2823,7 +2823,9 @@ var X86OpXX = { var nInt = this.getIPByte(); if (this.checkInterruptNotify(nInt)) { X86Help.opHelpINT.call(this, nInt, null, 0); + return; } + this.nStepCycles--; // we don't need to assess the full cost of nOpCyclesInt, but we need to assess something... }, /** * @this {X86CPU}