Bumped version to 1.30 in honor of the PDP11 module that's being integrated, along with my first attempt to use a newer version of the Closure Compiler (ie, the JavaScript version), as well as giving Gulp a try -- although Gulp leaves just as bad a taste in my mouth as Grunt did

This commit is contained in:
Jeff Parsons 2016-09-13 15:33:16 -07:00
commit 3bd02c7e19
298 changed files with 16473 additions and 3885 deletions

View file

@ -96,14 +96,14 @@ function CPU8080(parmsCPU, nCyclesDefault)
/*
* We add a number of flags to the set initialized by Component
*/
this.flags.fRunning = false;
this.flags.fStarting = false;
this.flags.fAutoStart = parmsCPU['autoStart'];
this.flags.running = false;
this.flags.starting = false;
this.flags.autoStart = parmsCPU['autoStart'];
/*
* TODO: Add some UI for fDisplayLiveRegs (either an XML property, or a UI checkbox, or both)
*/
this.flags.fDisplayLiveRegs = false;
this.flags.displayLiveRegs = false;
/*
* Get checksum parameters, if any. runCPU() behavior is not affected until fChecksum
@ -114,7 +114,7 @@ function CPU8080(parmsCPU, nCyclesDefault)
* command ("x"); for example, "x cs int 5000" will set nCyclesChecksumInterval to 5000
* and call resetChecksum().
*/
this.flags.fChecksum = false;
this.flags.checksum = false;
this.nChecksum = this.nCyclesChecksumNext = 0;
this.nCyclesChecksumStart = parmsCPU["csStart"];
this.nCyclesChecksumInterval = parmsCPU["csInterval"];
@ -181,7 +181,7 @@ CPU8080.prototype.initBus = function(cmp, bus, cpu, dbg)
*/
var sAutoStart = cmp.getMachineParm('autoStart');
if (sAutoStart != null) {
this.flags.fAutoStart = (sAutoStart == "true"? true : (sAutoStart == "false"? false : !!sAutoStart));
this.flags.autoStart = (sAutoStart == "true"? true : (sAutoStart == "false"? false : !!sAutoStart));
}
this.setReady();
@ -263,7 +263,7 @@ CPU8080.prototype.powerUp = function(data, fRepower)
* The Computer component (which is responsible for all powerDown and powerUp notifications)
* is now responsible for managing a component's fPowered flag, not us.
*
* this.flags.fPowered = true;
* this.flags.powered = true;
*/
this.updateCPU();
return true;
@ -283,7 +283,7 @@ CPU8080.prototype.powerDown = function(fSave, fShutdown)
* The Computer component (which is responsible for all powerDown and powerUp notifications)
* is now responsible for managing a component's fPowered flag, not us.
*
* this.flags.fPowered = false;
* this.flags.powered = false;
*/
return fSave? this.save() : true;
};
@ -299,7 +299,7 @@ CPU8080.prototype.autoStart = function()
/*
* Start running automatically on power-up, assuming there's no Debugger and no "Run" button
*/
if (this.flags.fAutoStart || (!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined) {
if (this.flags.autoStart || (!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined) {
/*
* Now we ALSO set fUpdateFocus when calling runCPU(), on the assumption that in the "auto-starting" context,
* a machine without focus is like a day without sunshine.
@ -318,7 +318,7 @@ CPU8080.prototype.autoStart = function()
*/
CPU8080.prototype.isPowered = function()
{
if (!this.flags.fPowered) {
if (!this.flags.powered) {
this.println(this.toString() + " not powered");
return false;
}
@ -333,7 +333,7 @@ CPU8080.prototype.isPowered = function()
*/
CPU8080.prototype.isRunning = function()
{
return this.flags.fRunning;
return this.flags.running;
};
/**
@ -364,8 +364,8 @@ CPU8080.prototype.resetChecksum = function()
if (this.nCyclesChecksumStart === undefined) this.nCyclesChecksumStart = 0;
if (this.nCyclesChecksumInterval === undefined) this.nCyclesChecksumInterval = -1;
if (this.nCyclesChecksumStop === undefined) this.nCyclesChecksumStop = -1;
this.flags.fChecksum = (this.nCyclesChecksumStart >= 0 && this.nCyclesChecksumInterval > 0);
if (this.flags.fChecksum) {
this.flags.checksum = (this.nCyclesChecksumStart >= 0 && this.nCyclesChecksumInterval > 0);
if (this.flags.checksum) {
this.nChecksum = 0;
this.nCyclesChecksumNext = this.nCyclesChecksumStart - this.nTotalCycles;
/*
@ -390,7 +390,7 @@ CPU8080.prototype.resetChecksum = function()
*/
CPU8080.prototype.updateChecksum = function(nCycles)
{
if (this.flags.fChecksum) {
if (this.flags.checksum) {
/*
* Get a 32-bit summation of the current CPU state and add it to our running 32-bit checksum
*/
@ -446,7 +446,7 @@ CPU8080.prototype.displayValue = function(sLabel, nValue, cch)
this.stopCPU();
}
var sVal;
if (!this.flags.fRunning || this.flags.fDisplayLiveRegs) {
if (!this.flags.running || this.flags.displayLiveRegs) {
sVal = str.toHex(nValue, cch);
} else {
sVal = "--------".substr(0, cch);
@ -497,7 +497,7 @@ CPU8080.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
* control is visible, then the computer is probably sufficiently visible as well; the problem
* with setting fUpdateFocus to true is that it can jerk the web page around in annoying ways.
*/
if (!cpu.flags.fRunning)
if (!cpu.flags.running)
cpu.runCPU();
else
cpu.stopCPU();
@ -541,7 +541,7 @@ CPU8080.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
*/
CPU8080.prototype.setBurstCycles = function(nCycles)
{
if (this.flags.fRunning) {
if (this.flags.running) {
var nDelta = this.nStepCycles - nCycles;
/*
* NOTE: If nDelta is negative, we will actually be increasing nStepCycles and nBurstCycles.
@ -710,7 +710,7 @@ CPU8080.prototype.getSpeedCurrent = function()
/*
* TODO: Has toFixed() been "fixed" in all browsers (eg, IE) to return a rounded value now?
*/
return ((this.flags.fRunning && this.mhz)? (this.mhz.toFixed(2) + "Mhz") : "Stopped");
return ((this.flags.running && this.mhz)? (this.mhz.toFixed(2) + "Mhz") : "Stopped");
};
/**
@ -1075,7 +1075,7 @@ CPU8080.prototype.runCPU = function(fUpdateFocus)
* be as HIGH as nCyclesPerYield, but it may be significantly less. getBurstCycles() will adjust
* nCyclesPerBurst downward if any CPU timers need to fire during the next burst.
*/
var nCyclesPerBurst = this.getBurstCycles(this.flags.fChecksum? 1 : this.nCyclesPerYield);
var nCyclesPerBurst = this.getBurstCycles(this.flags.checksum? 1 : this.nCyclesPerYield);
/*
* Execute the burst.
@ -1109,7 +1109,7 @@ CPU8080.prototype.runCPU = function(fUpdateFocus)
}
break;
}
} while (this.flags.fRunning);
} while (this.flags.running);
}
catch (e) {
this.stopCPU();
@ -1132,7 +1132,7 @@ CPU8080.prototype.runCPU = function(fUpdateFocus)
*/
CPU8080.prototype.startCPU = function(fUpdateFocus)
{
if (!this.flags.fRunning) {
if (!this.flags.running) {
/*
* setSpeed() without a speed parameter leaves the selected speed in place, but also resets the
* cycle counter and timestamp for the current series of runCPU() calls, calculates the maximum number
@ -1141,8 +1141,8 @@ CPU8080.prototype.startCPU = function(fUpdateFocus)
*/
this.setSpeed();
if (this.cmp) this.cmp.start(this.msStartRun, this.getCycles());
this.flags.fRunning = true;
this.flags.fStarting = true;
this.flags.running = true;
this.flags.starting = true;
if (this.chipset) this.chipset.start();
var controlRun = this.bindings["run"];
if (controlRun) controlRun.textContent = "Halt";
@ -1184,13 +1184,13 @@ CPU8080.prototype.stopCPU = function(fComplete)
this.endBurst();
this.addCycles(this.nRunCycles);
this.nRunCycles = 0;
if (this.flags.fRunning) {
this.flags.fRunning = false;
if (this.flags.running) {
this.flags.running = false;
if (this.chipset) this.chipset.stop();
var controlRun = this.bindings["run"];
if (controlRun) controlRun.textContent = "Run";
}
this.flags.fComplete = fComplete;
this.flags.complete = fComplete;
};
/**