First batch of pdp11.js code adapted but totally untested

This commit is contained in:
Jeff Parsons 2016-09-05 11:05:40 -07:00
commit 100779e30a
22 changed files with 2697 additions and 1273 deletions

View file

@ -1037,6 +1037,17 @@ CPUPDP11.prototype.updateTimers = function(nCycles)
}
};
/**
* endBurst()
*
* @this {CPUPDP11}
*/
CPUPDP11.prototype.endBurst = function()
{
this.nBurstCycles -= this.nStepCycles;
this.nStepCycles = 0;
};
/**
* runCPU(fUpdateFocus)
*
@ -1172,8 +1183,7 @@ CPUPDP11.prototype.stepCPU = function(nMinCycles)
CPUPDP11.prototype.stopCPU = function(fComplete)
{
this.isBusy(true);
this.nBurstCycles -= this.nStepCycles;
this.nStepCycles = 0;
this.endBurst();
this.addCycles(this.nRunCycles);
this.nRunCycles = 0;
if (this.flags.fRunning) {
@ -1213,9 +1223,8 @@ CPUPDP11.prototype.updateCPU = function(fForce)
*/
CPUPDP11.prototype.yieldCPU = function()
{
this.endBurst(); // this will break us out of stepCPU()
this.nCyclesNextYield = 0; // this will break us out of runCPU(), once we break out of stepCPU()
this.nBurstCycles -= this.nStepCycles;
this.nStepCycles = 0; // this will break us out of stepCPU()
// if (DEBUG) this.nSnapCycles = this.nBurstCycles;
/*
* The Debugger calls yieldCPU() after every message() to ensure browser responsiveness, but it looks