Prevent new scripts from interrupting scripts in progress

This commit is contained in:
Jeff Parsons 2017-02-08 09:25:09 -08:00 • committed by Jeff Parsons
commit d23ae82679
13 changed files with 1864 additions and 1423 deletions

View file

@ -973,9 +973,7 @@ class DebuggerPDP11 extends Debugger {
if (panel) value = panel.getDR();
break;
case DebuggerPDP11.REG_SR:
if (panel && panel.hasSwitches()) {
value = panel.getSR();
}
if (panel) value = panel.getSR();
break;
}
}
@ -2325,7 +2323,7 @@ class DebuggerPDP11 extends Debugger {
}
break;
case DebuggerPDP11.REG_SR:
if (this.panel && this.panel.hasSwitches()) {
if (this.panel) {
sReg = "SR=" + this.toStrBase(this.panel.getSR(), 3);
}
break;
@ -3471,12 +3469,9 @@ class DebuggerPDP11 extends Debugger {
fMisc = true;
break;
case "SR":
if (this.panel && this.panel.hasSwitches()) {
this.panel.setSR(w);
fMisc = true;
break;
}
/* falls through */
if (this.panel) this.panel.setSR(w);
fMisc = true;
break;
default:
if (sRegMatch.charAt(0) == 'R') {
var iReg = +sRegMatch.charAt(1);

View file

@ -1100,17 +1100,6 @@ class PanelPDP11 extends Component {
}
}
/**
* hasSRSwitches(value)
*
* @this {PanelPDP11}
* @return {boolean}
*/
hasSRSwitches()
{
return this.bindings[PanelPDP11.SWITCH.S0] !== undefined;
}
/**
* setSRSwitches(value)
*
@ -1120,18 +1109,15 @@ class PanelPDP11 extends Component {
*/
setSRSwitches(value)
{
if (this.hasSRSwitches() && !isNaN(value)) {
this.regSwitches = value | 0;
for (var i = 0; i < 22; i++) {
this.switches['S'+i][1] = (this.regSwitches & (1 << i))? 1 : 0;
}
/*
* This (re)displays ALL switches, not merely the SR switches, but that's OK.
*/
this.displaySwitches();
return true;
this.regSwitches = value | 0;
for (var i = 0; i < 22; i++) {
this.switches['S'+i][1] = (this.regSwitches & (1 << i))? 1 : 0;
}
return false;
/*
* This (re)displays ALL switches, not merely the SR switches, but that's OK.
*/
this.displaySwitches();
return true;
}
/**
@ -1326,7 +1312,6 @@ PanelPDP11.ADDRSEL = {
* "step" behavior when pressed more than once in a row). Ditto for the LED table.
*/
PanelPDP11.SWITCH = {
S0: 'S0',
DEP: 'DEP',
ENABLE: 'ENABLE',
EXAM: 'EXAM',