1
0
mirror of https://github.com/pkimpel/retro-220.git synced 2026-04-14 15:55:30 +00:00

Commit emulator version 0.00c:

1. Initial implementation of integer and floating arithmetics, RND (16), and EXT (17) (not fully tested yet).
2. Implement Console Keyboard, integration with main Console, and KAD (08) instruction.
3. Implement BCS (38).
4. Correct S-to-C and S-to-P stop detection.
5. Improvements to lamp glow computation and management.
6. Implement right-hand clear bars on Console registers.
This commit is contained in:
Paul Kimpel
2017-03-12 12:30:07 -07:00
parent cf932d5c85
commit f891d5198d
10 changed files with 1362 additions and 917 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -30,6 +30,7 @@
<script src="../emulator/B220Processor.js"></script>
<script src="./B220ConsoleKeyboard.js"></script>
<script src="./B220ControlConsole.js"></script>
<!--

View File

@@ -238,19 +238,19 @@ DIV.blueLamp {
height: 24px;
font-size: 4px;
border-radius: 50%;
background-image: radial-gradient(circle, #039, #003)}
background-image: radial-gradient(circle, #009, #003)}
DIV.blueLit1 {
background-image: radial-gradient(circle, #03A, #039, #004)}
background-image: radial-gradient(circle, #11A, #006)}
DIV.blueLit2 {
background-image: radial-gradient(circle, #03B, #03A, #005)}
background-image: radial-gradient(circle, #22B, #009)}
DIV.blueLit3 {
background-image: radial-gradient(circle, #04C, #04C, #006)}
background-image: radial-gradient(circle, #33C, #00A)}
DIV.blueLit4 {
background-image: radial-gradient(circle, #05D, #05D, #007)}
background-image: radial-gradient(circle, #55D, #00C)}
DIV.blueLit5 {
background-image: radial-gradient(circle, #06E, #06E, #008)}
background-image: radial-gradient(circle, #77E, #00D)}
DIV.blueLit {
background-image: radial-gradient(circle, #07F, #07F, #009)}
background-image: radial-gradient(circle, #99F, #00F)}
DIV.coloredLampTopCaption {
position: absolute;
@@ -308,7 +308,7 @@ DIV.blackControlKnobBottomCaption {
DIV.panelSurface {
position: absolute;
background-color: #D8C5BC; /* putty #EDEAE8; */
background-color: #E4DDCD; /* was #D8C5BC; putty #EDEAE8; */
color: black}
DIV.panelRegister {

View File

@@ -0,0 +1,119 @@
/***********************************************************************
* retro-220/webUI B220ConsoleKeyboard.css
************************************************************************
* Copyright (c) 2017, Paul Kimpel.
* Licensed under the MIT License, see
* http://www.opensource.org/licenses/mit-license.php
************************************************************************
* Burroughs 220 emulator Console Keyboard style sheet.
************************************************************************
* 2017-03-08 P.Kimpel
* Original version, from retro-205 D205ControlConsole.css
***********************************************************************/
BUTTON.keyboardBtn {
position: absolute;
width: 40px;
height: 32px;
background-color: black;
color: white;
font-family: DejaVuSansWeb, sans-serif;
font-size: 10pt;
border: 1px solid #666;
box-shadow: 2px 2px 1px #999}
BUTTON.keyboardBtnDown {
background-color: #333;
color: #CCC;
border: 1px solid black;
box-shadow: 2px 2px 1px #000 inset}
#KeyboardCase {
position: relative;
height: 264px;
width: 240px;
margin: 0;
background-color: #FBFBF3;
box-shadow: 3px 3px 2px #999}
#InnerCase {
position: absolute;
left: 16px;
right: 16px;
top: 16px;
bottom: 40px;
border: 1px solid #CCC;
box-shadow: 2px 2px 1px #CCC inset}
#AddBtn {
left: 8px;
top: 8px}
#CBtn {
left: 8px;
top: 48px}
#EBtn {
left: 8px;
top: 88px}
#ExamBtn {
left: 8px;
top: 128px}
#EntBtn {
left: 8px;
top: 168px}
#StepBtn {
width: 136px;
left: 64px;
top: 8px}
#Btn9 {
left: 160px;
top: 48px}
#Btn8 {
left: 112px;
top: 48px}
#Btn7 {
left: 64px;
top: 48px}
#Btn6 {
left: 160px;
top: 88px}
#Btn5 {
left: 112px;
top: 88px}
#Btn4 {
left: 64px;
top: 88px}
#Btn3 {
left: 160px;
top: 128px}
#Btn2 {
left: 112px;
top: 128px}
#Btn1 {
left: 64px;
top: 128px}
#Btn0 {
width: 136px;
left: 64px;
top: 168px}
#EnabledLamp {
position: absolute;
bottom: 8px;
left: calc(50% - 14px);
box-shadow: 3px 3px 2px #999;
border: 2px solid #DDD}

View File

@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>retro-220 Console Keyboard</title>
<!--
/***********************************************************************
* retro-220/webUI B220ConsoleKeyboard.html
************************************************************************
* Copyright (c) 2017, Paul Kimpel.
* Licensed under the MIT License, see
* http://www.opensource.org/licenses/mit-license.php
************************************************************************
* Burroughs 220 Console Keyboard page.
************************************************************************
* 2017-03-08 P.Kimpel
* Original version, from retro-205 D205ControlConsole.html.
***********************************************************************/
-->
<meta name="Author" content="Paul Kimpel">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<link id=defaultStyleSheet rel=stylesheet type="text/css" href="B220Common.css">
<link id=consoleStyleSheet rel=stylesheet type="text/css" href="B220ConsoleKeyboard.css">
</head>
<body class=panelBody>
<div id=KeyboardCase>
<div id=InnerCase>
<button id=AddBtn title="Also + keypress"
class=keyboardBtn>ADD</button>
<button id=CBtn title="Also C keypress"
class=keyboardBtn>C</button>
<button id=EBtn title="Also E keypress"
class=keyboardBtn>E</button>
<button id=ExamBtn title "Also Enter keypress"
class=keyboardBtn>EXAM</button>
<button id=EntBtn title="No alternate keypress"
class=keyboardBtn>ENT</button>
<button id=StepBtn title="No alternate keypress"
class=keyboardBtn>STEP</button>
<button id=Btn9 class=keyboardBtn>9</button>
<button id=Btn8 class=keyboardBtn>8</button>
<button id=Btn7 class=keyboardBtn>7</button>
<button id=Btn6 class=keyboardBtn>6</button>
<button id=Btn5 class=keyboardBtn>5</button>
<button id=Btn4 class=keyboardBtn>4</button>
<button id=Btn3 class=keyboardBtn>3</button>
<button id=Btn2 class=keyboardBtn>2</button>
<button id=Btn1 class=keyboardBtn>1</button>
<button id=Btn0 class=keyboardBtn>0</button>
</div>
<div id=EnabledLamp class="redLamp"></div>
</div>
</body>
</html>

View File

@@ -0,0 +1,238 @@
/***********************************************************************
* retro-220/webUI B220ConsoleKeyboard.js
************************************************************************
* Copyright (c) 2017, Paul Kimpel.
* Licensed under the MIT License, see
* http://www.opensource.org/licenses/mit-license.php
************************************************************************
* Burroughs 220 Console Keyboard object.
************************************************************************
* 2017-03-08 P.Kimpel
* Original version, from retro-205 webUI/D205ControlConsole.html.
***********************************************************************/
"use strict";
/**************************************/
function B220ConsoleKeyboard(p) {
/* Constructor for the ConsoleKeyboard object */
this.mnemonic = "ConsoleKeyboard";
this.config = p.config; // System Configuration object
this.p = p; // B220Processor object
this.doc = null; // window document object
this.window = null; // window object, null if not displayed
this.enabled = false; // true if keyboard is active
this.boundKeypress = B220Processor.bindMethod(this, B220ConsoleKeyboard.prototype.keypress);
this.boundButton_Click = B220Util.bindMethod(this, B220ConsoleKeyboard.prototype.button_Click);
this.boundKeyboard_OnLoad = B220Util.bindMethod(this, B220ConsoleKeyboard.prototype.keyboardOnLoad);
this.boundKeyboard_Unload = B220Util.bindMethod(this, B220ConsoleKeyboard.prototype.keyboardUnload);
this.clear();
}
/**************************************/
B220ConsoleKeyboard.clickPeriod = 150; // period for button click animation, ms
/**************************************/
B220ConsoleKeyboard.prototype.$$ = function $$(e) {
return this.doc.getElementById(e);
};
/**************************************/
B220ConsoleKeyboard.prototype.clear = function clear() {
/* Initializes (and if necessary, creates) the panel state */
this.keyboardEnable(0);
};
/**************************************/
B220ConsoleKeyboard.prototype.keyboardEnable = function keyboardEnable(enable) {
/* Enables or disables the keyboard, and if necessary, opens the window for it */
if (!enable && this.enabled) {
this.enabled = false;
this.enabledLamp.set(0);
} else if (enable && !this.enabled) {
this.enabled = true;
if (!this.window) {
this.keyboardOpen(); // lamp will be lit in OnLoad()
} else {
this.enabledLamp.set(1);
this.window.focus();
}
}
};
/**************************************/
B220ConsoleKeyboard.prototype.animateClick = function animateClick(btn) {
/* Animates the click action of a keyboard button */
btn.classList.add("keyboardBtnDown");
setCallback(null, btn, B220ConsoleKeyboard.clickPeriod, function unclick() {
this.classList.remove("keyboardBtnDown");
});
};
/**************************************/
B220ConsoleKeyboard.prototype.button_Click = function button_Click(ev) {
/* Handler for button clicks */
var d; // decimal digit keyed
var id = ev.target.id; // ID of the clicked element
var p = this.p; // local copy of processor object
if (ev.target.tagName == "BUTTON") {
this.animateClick(ev.target);
}
if (this.enabled) {
switch (id) {
case "AddBtn":
this.keyboardEnable(0);
p.keyboardAction(-1);
break;
case "CBtn":
p.keyboardAction(-2);
break;
case "EBtn":
p.keyboardAction(-3);
break;
case "ExamBtn":
p.keyboardAction(-4);
break;
case "EntBtn":
p.keyboardAction(-5);
break;
case "StepBtn":
p.keyboardAction(-6);
break;
default:
if (id.length == 4 && id.substring(0, 3) == "Btn") {
d = parseInt(id.charAt(3), 10);
if (!isNaN(d)) {
p.keyboardAction(d);
}
}
break;
} // switch ev.target.it
}
ev.preventDefault();
ev.stopPropagation();
return false;
};
/**************************************/
B220ConsoleKeyboard.prototype.keypress = function keypress(ev) {
/* Handles keyboard character events. Depending on whether there is an
outstanding request for a keypress, returns a digit or finish pulse to the
Processor, or discards the event altogether. Note that we have to do a little
dance with the reference to the callback function, as the next digit can be
solicited by the processor before the callback returns to this code, so the
callback reference must be nullified before the call */
var c = ev.charCode;
if (this.enabled) {
switch (c) {
case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
case 0x35: case 0x36: case 0x37: case 0x38: case 0x39:
this.animateClick(this.$$("Btn" + (c-0x30)));
this.p.keyboardAction(c-0x30);
break;
case 0x2B: // "+" = ADD
this.animateClick(this.$$("AddBtn"));
this.p.keyboardAction(-1);
break;
case 0x43: case 0x63: // "C", "c"
this.animateClick(this.$$("CBtn"));
this.p.keyboardAction(-2);
break;
case 0x45: case 0x65: // "E", "e"
this.animateClick(this.$$("EBtn"));
this.p.keyboardAction(-3);
break;
case 0x0D: // Enter key = EXAM
this.animateClick(this.$$("ExamBtn"));
this.p.keyboardAction(-4);
break;
case 0: // Firefox reports only graphic charCodes for keypress
if (ev.keyCode == 0x0D) { // check keyCode instead
this.animateClick(this.$$("ExamBtn"));
this.p.keyboardAction(-4);
}
break;
} // switch c
ev.preventDefault();
ev.stopPropagation();
}
};
/**************************************/
B220ConsoleKeyboard.prototype.keyboardOpen = function keyboardOpen() {
/* Opens the keyboard window and sets up the onLoad event */
var h = 264;
var w = 240;
if (!this.window) {
this.window = window.open("../webUI/B220ConsoleKeyboard.html", this.mnemonic,
"location=no,scrollbars=no,resizable,width=" + w + ",height=" + h +
",left=" + (screen.availWidth - w) + ",top=" + (screen.availHeight - h));
this.window.addEventListener("load", this.boundKeyboard_OnLoad, false);
}
};
/**************************************/
B220ConsoleKeyboard.prototype.keyboardUnload = function keyboardUnload(ev) {
/* Handles manual closing of the keyboard window */
this.enabled = false;
this.window.removeEventListener("keypress", this.boundKeypress);
this.window.removeEventListener("click", this.boundButton_Click);
this.window.removeEventListener("unload", this.boundkeyboard_Unload);
this.window = this.doc = null;
};
/**************************************/
B220ConsoleKeyboard.prototype.keyboardOnLoad = function keyboardOnLoad() {
/* Initializes the Control Console window and user interface */
var body;
var de;
this.window.removeEventListener("load", this.boundKeyboard_OnLoad, false);
this.doc = this.window.document;
body = this.$$("KeyboardCase");
de = this.doc.documentElement;
// Colored Lamps
this.enabledLamp = new ColoredLamp(body, null, null, "EnabledLamp", "redLamp", "redLit");
// Events
this.window.addEventListener("keypress", this.boundKeypress);
this.window.addEventListener("click", this.boundButton_Click);
this.window.addEventListener("unload", this.boundKeyboard_Unload);
if (this.enabled) {
this.enabledLamp.set(1);
this.window.focus();
}
this.window.resizeBy(de.scrollWidth - this.window.innerWidth, // + 4 kludge for right-padding/margin
de.scrollHeight - this.window.innerHeight);
// Kludge for Chrome window.outerWidth/Height timing bug
setCallback(null, this, 100, function chromeBug() {
this.window.moveTo(screen.availWidth-this.window.outerWidth,
screen.availHeight - this.window.outerHeight);
});
};
/**************************************/
B220ConsoleKeyboard.prototype.shutDown = function shutDown() {
/* Shuts down the panel */
if (this.window) {
this.window.close();
}
};

View File

@@ -162,49 +162,56 @@
top: 12px}
#DigitCheckLamp {
left: 6px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#ProgramCheckLampLabel {
left: 42px;
top: 12px}
#ProgramCheckLamp {
left: 44px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#StorageLampLabel {
left: 80px;
top: 12px}
#StorageLamp {
left: 82px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#MagneticTapeLampLabel {
left: 118px;
top: 12px}
#MagneticTapeLamp {
left: 120px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#CardatronLampLabel {
left: 156px;
top: 12px}
#CardatronLamp {
left: 158px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#PaperTapeLampLabel {
left: 194px;
top: 12px}
#PaperTapeLamp {
left: 196px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#HighSpeedPrinterLampLabel {
left: 232px;
top: 12px}
#HighSpeedPrinterLamp {
left: 234px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#Blank1LampLabel {
left: 270px;
@@ -215,14 +222,16 @@
top: 12px}
#SystemNotReadyLamp {
left: 310px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#ComputerNotReadyLampLabel {
left: 346px;
top: 12px}
#ComputerNotReadyLamp {
left: 348px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
/***** Operation Panel *****/
@@ -242,21 +251,24 @@
top: 12px}
#RunLamp {
left: 6px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#FetchLampLabel {
left: 42px;
top: 12px}
#FetchLamp {
left: 44px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#ExecuteLampLabel {
left: 80px;
top: 12px}
#ExecuteLamp {
left: 82px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#Blank2LampLabel {
left: 118px;
@@ -280,14 +292,16 @@
top: 12px}
#OverflowLamp {
left: 6px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#RepeatLampLabel {
left: 42px;
top: 12px}
#RepeatLamp {
left: 44px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#Blank3LampLabel {
left: 80px;
@@ -298,21 +312,24 @@
top: 12px}
#LowLamp {
left: 120px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#EqualLampLabel {
left: 156px;
top: 12px}
#EqualLamp {
left: 158px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#HighLampLabel {
left: 194px;
top: 12px}
#HighLamp {
left: 196px;
top: 32px}
top: 32px;
box-shadow: 3px 3px 2px #000}
#Blank4LampLabel {
left: 232px;
@@ -593,14 +610,3 @@
visibility: visible;
border-collapse: collapse;
border-spacing: 0}
/***** Old Stuff *****/
#PowerOnBtn {
left: 600px;
top: 330px}
#PowerOnCaption {
left: 600px;
top: 360px;
width: 24px}

View File

@@ -23,10 +23,11 @@ function B220ControlConsole(p, systemShutdown) {
this.intervalToken = 0; // setInterval() token for panel refresh
this.p = p; // B220Processor object
this.systemShutdown = systemShutdown; // system shut-down callback
this.keyboard = new B220ConsoleKeyboard(p);
this.boundLamp_Click = B220Util.bindMethod(this, B220ControlConsole.prototype.lamp_Click);
this.boundPowerBtn_Click = B220Util.bindMethod(this, B220ControlConsole.prototype.powerBtn_Click);
this.boundFlipSwitch = B220Util.bindMethod(this, B220ControlConsole.prototype.flipSwitch);
this.boundSwitch_Click = B220Util.bindMethod(this, B220ControlConsole.prototype.switch_Click);
this.boundStartBtn_Click = B220Util.bindMethod(this, B220ControlConsole.prototype.startBtn_Click);
this.boundResetTimer = B220Util.bindMethod(this, B220ControlConsole.prototype.resetTimer);
this.boundUpdatePanel = B220Util.bindMethod(this, B220ControlConsole.prototype.updatePanel);
@@ -160,48 +161,41 @@ B220ControlConsole.prototype.updatePanel = function updatePanel() {
text = (timer/1000 + 10000).toFixed(1);
this.intervalTimer.textContent = text.substring(text.length-6);
p.updateGlow(0);
eLevel = (p.RUT.value ? p.EXT.glow : p.EXT.value);
// Primary Registers
p.A.updateGlow();
this.regA.updateGlow(p.A.glow);
p.B.updateGlow();
this.regB.updateGlow(p.B.glow);
p.C.updateGlow();
this.regC.updateGlow(p.C.glow);
p.D.updateGlow();
this.regD.updateGlow(p.D.glow);
p.E.updateGlow();
this.regE.updateGlow(p.E.glow);
p.P.updateGlow();
this.regP.updateGlow(p.P.glow);
p.R.updateGlow();
this.regR.updateGlow(p.R.glow);
p.S.updateGlow();
this.regS.updateGlow(p.S.glow);
// Alarm Panel
this.digitCheckLamp.set(p.digitCheckAlarm.updateGlow());
this.programCheckLamp.set(p.programCheckAlarm.updateGlow());
this.storageLamp.set(p.storageAlarm.updateGlow());
this.magneticTapeLamp.set(p.magneticTapeAlarm.updateGlow());
this.cardatronLamp.set(p.paperTapeAlarm.updateGlow());
this.paperTapeLamp.set(p.cardatronAlarm.updateGlow());
this.highSpeedPrinterLamp.set(p.highSpeedPrinterAlarm.updateGlow());
this.systemNotReadyLamp.set(p.systemNotReady.updateGlow());
this.computerNotReadyLamp.set(p.computerNotReady.updateGlow());
this.digitCheckLamp.set(p.digitCheckAlarm.glow);
this.programCheckLamp.set(p.programCheckAlarm.glow);
this.storageLamp.set(p.storageAlarm.glow);
this.magneticTapeLamp.set(p.magneticTapeAlarm.glow);
this.cardatronLamp.set(p.paperTapeAlarm.glow);
this.paperTapeLamp.set(p.cardatronAlarm.glow);
this.highSpeedPrinterLamp.set(p.highSpeedPrinterAlarm.glow);
this.systemNotReadyLamp.set(p.systemNotReady.glow);
this.computerNotReadyLamp.set(p.computerNotReady.glow);
// Operation Panel
this.runLamp.set(p.RUT.updateGlow());
this.runLamp.set(p.RUT.glow);
this.fetchLamp.set(1-eLevel);
this.executeLamp.set(eLevel);
// Status Panel
this.overflowLamp.set(p.OFT.updateGlow());
this.repeatLamp.set(p.RPT.updateGlow());
this.lowLamp.set(p.compareLowLamp.updateGlow());
this.equalLamp.set(p.compareEqualLamp.updateGlow());
this.highLamp.set(p.compareHighLamp.updateGlow());
this.overflowLamp.set(p.OFT.glow);
this.repeatLamp.set(p.RPT.glow);
this.lowLamp.set(p.compareLowLamp.glow);
this.equalLamp.set(p.compareEqualLamp.glow);
this.highLamp.set(p.compareHighLamp.glow);
/********** DEBUG **********
this.$$("ProcDelta").value = p.procSlackAvg.toFixed(2);
@@ -223,11 +217,13 @@ B220ControlConsole.prototype.lamp_Click = function lamp_Click(ev) {
if (p.poweredOn) {
if (ix < 0) {
reg = id;
bit = 0;
return;
} else if (ix > 0) {
reg = id.substring(0, ix);
bit = parseInt(id.substring(ix+1), 10) || 0;
bit = parseInt(id.substring(ix+1), 10);
if (isNaN(bit)) {
return;
}
}
switch (reg) {
@@ -285,7 +281,7 @@ B220ControlConsole.prototype.resetTimer = function resetTimer(ev) {
};
/**************************************/
B220ControlConsole.prototype.flipSwitch = function flipSwitch(ev) {
B220ControlConsole.prototype.switch_Click = function switch_Click(ev) {
/* Handler for switch & knob clicks */
var p = this.p; // local copy of processor object
@@ -297,18 +293,46 @@ B220ControlConsole.prototype.flipSwitch = function flipSwitch(ev) {
break;
case "StartSwitch":
this.startSwitch.flip();
this.keyboard.keyboardEnable(0);
p.start();
break;
case "StepSwitch":
this.stepSwitch.flip();
//this.keyboard.keyboardEnable(0);
p.step();
break;
case "ClearSwitch":
this.clearSwitch.flip();
this.keyboard.keyboardEnable(0);
p.stop();
p.clear();
break;
case "A_RightClear":
p.A.set(0);
break;
case "B_RightClear":
p.B.set(0);
break;
case "C_RightClear":
p.C.set(0);
break;
case "D_RightClear":
p.D.set(0);
break;
case "E_RightClear":
p.E.set(0);
break;
case "P_RightClear":
p.P.set(0);
break;
case "R_RightClear":
p.R.set(0);
break;
case "S_RightClear":
p.S.set(0);
break;
case "ControlSwitch1":
this.controlSwitch1.flip();
this.config.putNode("ControlConsole.controlSwitch1", this.controlSwitch1.state);
@@ -362,7 +386,9 @@ B220ControlConsole.prototype.flipSwitch = function flipSwitch(ev) {
case "KeyboardSwitch":
this.keyboardSwitch.flip();
//?? << Action TBD >>
if (!p.RUT.value && !p.computerNotReady.value) {
this.keyboard.keyboardEnable(1);
}
break;
case "SOnSwitch":
this.sOnSwitch.flip();
@@ -386,6 +412,7 @@ B220ControlConsole.prototype.flipSwitch = function flipSwitch(ev) {
break;
case "ResetTransferSwitch":
this.resetTransferSwitch.flip();
this.keyboard.keyboardEnable(0);
p.resetTransfer();
break;
case "TCUClearSwitch":
@@ -413,38 +440,38 @@ B220ControlConsole.prototype.flipSwitch = function flipSwitch(ev) {
break;
case "FetchLamp":
p.setPhase(0);
p.setCycle(0);
break;
case "ExecuteLamp":
p.setPhase(1);
p.setCycle(1);
break;
case "OverflowLamp":
p.OFT.flip();
break;
case "RepeatLamp":
p.RPT.flip()
p.RPT.flip();
break;
case "LowLamp":
p.compareLowLamp.set(1);
p.compareLowLamp.flip();
p.compareEqualLamp.set(0);
p.compareHighLamp.set(0);
p.UET.set(1);
p.UET.set(p.compareLowLamp.value);
p.HIT.set(0);
break;
case "EqualLamp":
p.compareLowLamp.set(0);
p.compareEqualLamp.set(1);
p.compareEqualLamp.flip();
p.compareHighLamp.set(0);
p.UET.set(0);
p.HIT.set(1);
p.HIT.set(p.compareEqualLamp.value);
break;
case "HighLamp":
p.compareLowLamp.set(0);
p.compareEqualLamp.set(0);
p.compareHighLamp.set(1);
p.UET.set(1);
p.HIT.set(1);
p.compareHighLamp.flip();
p.UET.set(p.compareHighLamp.value);
p.HIT.set(p.compareHighLamp.value);
break;
} // switch ev.target.id
}
@@ -606,45 +633,54 @@ B220ControlConsole.prototype.consoleOnLoad = function consoleOnLoad() {
this.regR.addEventListener("click", this.boundLamp_Click);
this.regS.addEventListener("click", this.boundLamp_Click);
this.programCheckLamp.addEventListener("click", this.boundFlipSwitch);
this.storageLamp.addEventListener("click", this.boundFlipSwitch);
this.magneticTapeLamp.addEventListener("click", this.boundFlipSwitch);
this.cardatronLamp.addEventListener("click", this.boundFlipSwitch);
this.paperTapeLamp.addEventListener("click", this.boundFlipSwitch);
this.highSpeedPrinterLamp.addEventListener("click", this.boundFlipSwitch);
this.regA.rightClearBar.addEventListener("click", this.boundSwitch_Click);
this.regB.rightClearBar.addEventListener("click", this.boundSwitch_Click);
this.regC.rightClearBar.addEventListener("click", this.boundSwitch_Click);
this.regD.rightClearBar.addEventListener("click", this.boundSwitch_Click);
this.regE.rightClearBar.addEventListener("click", this.boundSwitch_Click);
this.regP.rightClearBar.addEventListener("click", this.boundSwitch_Click);
this.regR.rightClearBar.addEventListener("click", this.boundSwitch_Click);
this.regS.rightClearBar.addEventListener("click", this.boundSwitch_Click);
this.fetchLamp.addEventListener("click", this.boundFlipSwitch);
this.executeLamp.addEventListener("click", this.boundFlipSwitch);
this.programCheckLamp.addEventListener("click", this.boundSwitch_Click);
this.storageLamp.addEventListener("click", this.boundSwitch_Click);
this.magneticTapeLamp.addEventListener("click", this.boundSwitch_Click);
this.cardatronLamp.addEventListener("click", this.boundSwitch_Click);
this.paperTapeLamp.addEventListener("click", this.boundSwitch_Click);
this.highSpeedPrinterLamp.addEventListener("click", this.boundSwitch_Click);
this.overflowLamp.addEventListener("click", this.boundFlipSwitch);
this.repeatLamp.addEventListener("click", this.boundFlipSwitch);
this.lowLamp.addEventListener("click", this.boundFlipSwitch);
this.equalLamp.addEventListener("click", this.boundFlipSwitch);
this.highLamp.addEventListener("click", this.boundFlipSwitch);
this.fetchLamp.addEventListener("click", this.boundSwitch_Click);
this.executeLamp.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch1.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch2.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch3.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch4.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch5.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch6.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch7.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch8.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch9.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch10.addEventListener("click", this.boundFlipSwitch);
this.overflowLamp.addEventListener("click", this.boundSwitch_Click);
this.repeatLamp.addEventListener("click", this.boundSwitch_Click);
this.lowLamp.addEventListener("click", this.boundSwitch_Click);
this.equalLamp.addEventListener("click", this.boundSwitch_Click);
this.highLamp.addEventListener("click", this.boundSwitch_Click);
this.stopSwitch.addEventListener("click", this.boundFlipSwitch);
this.startSwitch.addEventListener("click", this.boundFlipSwitch);
this.stepSwitch.addEventListener("click", this.boundFlipSwitch);
this.clearSwitch.addEventListener("click", this.boundFlipSwitch);
this.controlSwitch1.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch2.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch3.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch4.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch5.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch6.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch7.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch8.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch9.addEventListener("click", this.boundSwitch_Click);
this.controlSwitch10.addEventListener("click", this.boundSwitch_Click);
this.keyboardSwitch.addEventListener("click", this.boundFlipSwitch);
this.sOnSwitch.addEventListener("click", this.boundFlipSwitch);
this.unitsSwitch.addEventListener("click", this.boundFlipSwitch);
this.sToPSwitch.addEventListener("click", this.boundFlipSwitch);
this.sToCSwitch.addEventListener("click", this.boundFlipSwitch);
this.resetTransferSwitch.addEventListener("click", this.boundFlipSwitch);
this.tcuClearSwitch.addEventListener("click", this.boundFlipSwitch);
this.stopSwitch.addEventListener("click", this.boundSwitch_Click);
this.startSwitch.addEventListener("click", this.boundSwitch_Click);
this.stepSwitch.addEventListener("click", this.boundSwitch_Click);
this.clearSwitch.addEventListener("click", this.boundSwitch_Click);
this.keyboardSwitch.addEventListener("click", this.boundSwitch_Click);
this.sOnSwitch.addEventListener("click", this.boundSwitch_Click);
this.unitsSwitch.addEventListener("click", this.boundSwitch_Click);
this.sToPSwitch.addEventListener("click", this.boundSwitch_Click);
this.sToCSwitch.addEventListener("click", this.boundSwitch_Click);
this.resetTransferSwitch.addEventListener("click", this.boundSwitch_Click);
this.tcuClearSwitch.addEventListener("click", this.boundSwitch_Click);
this.$$("IntervalTimerResetBtn").addEventListener("click", this.boundResetTimer);
this.$$("PowerOffBtn").addEventListener("click", this.boundPowerBtn_Click);
@@ -659,13 +695,23 @@ B220ControlConsole.prototype.consoleOnLoad = function consoleOnLoad() {
});
};
/**************************************/
B220ControlConsole.prototype.keyboardOpen = function keyboardOpen() {
/* Signals the Control Console to open the keyboard window if it's not
already open */
this.keyboard.keyboardOpen();
};
/**************************************/
B220ControlConsole.prototype.shutDown = function shutDown() {
/* Shuts down the panel */
this.window.removeEventListener("beforeunload", B220ControlConsole.prototype.beforeUnload);
if (this.intervalToken) {
this.window.clearInterval(this.intervalToken);
}
this.window.removeEventListener("beforeunload", B220ControlConsole.prototype.beforeUnload);
this.keyboard.shutDown();
this.keyboard = null;
this.window.close();
};

View File

@@ -1,5 +1,5 @@
CACHE MANIFEST
# retro-220 emulator 0.00b, 2017-03-04 17:40
# retro-220 emulator 0.00c, 2017-03-12 12:15
CACHE:
../emulator/B220Processor.js
B220.css
@@ -18,6 +18,9 @@ B220.js
B220Common.css
#B220ConsoleInput.css
#B220ConsoleInput.js
B220ConsoleKeyboard.css
B220ConsoleKeyboard.html
B220ConsoleKeyboard.js
#B220ConsoleOutput.css
#B220ConsoleOutput.js
B220ControlConsole.css

View File

@@ -737,11 +737,13 @@ function PanelRegister(parent, bits, rows, idPrefix, caption) {
parent.appendChild(this.captionDiv);
this.leftClearBar = document.createElement("div");
this.leftClearBar.id = idPrefix + "LeftClear";
this.leftClearBar.className = PanelRegister.regClearBarClass;
this.leftClearBar.style.left = "0";
parent.appendChild(this.leftClearBar);
this.rightClearBar = document.createElement("div");
this.rightClearBar.id = idPrefix + "RightClear";
this.rightClearBar.className = PanelRegister.regClearBarClass;
this.rightClearBar.style.right = "0";
parent.appendChild(this.rightClearBar);