Picked up fixes from the gh-pages rollout

This commit is contained in:
Jeff 2016-10-06 10:09:41 -07:00 committed by Jeff Parsons
commit 4e8d4e95d8
6 changed files with 397 additions and 366 deletions

View file

@ -183,7 +183,7 @@ function ComputerPDP11(parmsComputer, parmsMachine, fSuspended) {
}
}
this.println(PDP11.APPNAME + " v" + (XMLVERSION || PDP11.APPVERSION) + "\n" + COPYRIGHT + "\n" + LICENSE);
this.println(PDP11.APPNAME + " v" + PDP11.APPVERSION + "\n" + COPYRIGHT + "\n" + LICENSE);
this.println("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");
@ -1458,7 +1458,7 @@ ComputerPDP11.init = function()
/*
* In non-COMPILED builds, embedMachine() may have set XMLVERSION.
*/
if (!COMPILED && PDP11.XMLVERSION) PDP11.APPVERSION = PDP11.XMLVERSION;
if (!COMPILED && XMLVERSION) PDP11.APPVERSION = XMLVERSION;
var aeMachines = Component.getElementsByClass(document, PDP11.APPCLASS + "-machine");

View file

@ -205,9 +205,7 @@ CPUStatePDP11.prototype.resetRegs = function()
this.mmuMask = [ // mask to control I&D access for each mode
0x7, 0x7, 0x7, 0x7
];
/**
* @type {Array.<InterruptEvent>}
*/
/** @type {Array.<InterruptEvent>} */
this.interruptQueue = [];
this.opFlags |= PDP11.OPFLAG.INTQ;
this.initMemoryAccess();
@ -617,12 +615,30 @@ CPUStatePDP11.prototype.interrupt = function(delay, priority, vector, callback)
}
delay -= this.interruptQueue[i].delay;
}
this.interruptQueue.splice(i + 1, 0, {
"delay": delay,
"priority": (priority << 5) & 0xe0,
"vector": vector,
"callback": callback
});
/*
* NOTE regarding a Google Closure Compiler "bug": if an InterruptEvent is inserted into the
* interruptQueue with the named properties below, they will never be seen by the rest of the
* code, because the compiler renames all other property references EXCEPT these.
*
* this.interruptQueue.splice(i + 1, 0, {
* "delay": delay,
* "priority": (priority << 5) & 0xe0,
* "vector": vector,
* "callback": callback
* });
*
* Perhaps if the inlined object had been explicitly @typed, that wouldn't have happened, but
* I'm playing it safe now: I've taken the object out-of-line, removed the quoted property names,
* and explicitly typed it. The compiler re-inlines the object with correctly renamed properties.
*/
/** @type {InterruptEvent} */
var interruptEvent = {
delay: delay,
priority: (priority << 5) & 0xe0,
vector: vector,
callback: callback
};
this.interruptQueue.splice(i + 1, 0, interruptEvent);
}
this.opFlags |= PDP11.OPFLAG.INTQ;
};