1
0
mirror of https://github.com/pkimpel/retro-220.git synced 2026-04-04 21:07:29 +00:00

Release emulator version 0.00e:

1. Rework the partial-word operators for better efficiency.
2. Correct emulated processor clock update during I/O operations.
3. Centralize common I/O initialization and termination code.
4. Correct statistics calculations in schedule().
5. Correct timing for integer and floating divide operators.
6. Correct remainder shifting in floating divide.
7. Implement diagnostic monitor window, opened by double-click on retro-220 logo on home page.
8. Correct timing for ConsolePrinter carriage control functions.
9. Implement simple demo programs pre-loaded into memory.
This commit is contained in:
Paul Kimpel
2017-05-13 18:44:56 -07:00
parent 9fa3d967d2
commit 06a4eb3f08
7 changed files with 585 additions and 404 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@
window.addEventListener("load", function() {
var config = new B220SystemConfig();// system configuration object
var devices = {}; // hash of I/O devices for the Processor
var diagWindow = null; // handle for the diagnostic monitor panel
var processor; // the Processor object
var statusMsgTimer = 0; // status message timer control cookie
@@ -31,6 +32,10 @@ window.addEventListener("load", function() {
}
}
if (diagWindow && !diagWindow.closed) {
diagWindow.close();
}
processor = null;
document.getElementById("StartUpBtn").disabled = false;
document.getElementById("StartUpBtn").focus();
@@ -90,12 +95,12 @@ window.addEventListener("load", function() {
/**************************************/
function openDiagPanel(ev) {
/* Opens the emulator's diagnostic panel in a new sub-window */
var win;
/* Opens the emulator's diagnostic monitor panel in a new sub-window */
win = window.open("B220DiagMonitor.html", "DiagPanel",
"location=no,scrollbars=no,resizable,width=300,height=500,top=0,left=0");
win.global = window; // give it access to our globals.
diagWindow = window.open("B220DiagMonitor.html", "DiagPanel",
"resizable,width=300,height=500,left=0,top=" + screen.availHeight-500);
diagWindow.global = window; // give it access to our globals.
diagWindow.focus();
}
/**************************************/

View File

@@ -510,11 +510,13 @@ B220ConsolePrinter.prototype.receiveChar = function receiveChar(char, successor)
break;
case 0x15: // form-feed
delay *= 4;
this.suppressLZ = 0;
this.printFormFeed();
break;
case 0x16: // carriage-return
delay *= 2;
this.suppressLZ = 0;
this.emptyLine();
break;
@@ -525,7 +527,6 @@ B220ConsolePrinter.prototype.receiveChar = function receiveChar(char, successor)
break;
case 0x35: // end-of-word
delay = 0;
nextReceiver = this.boundReceiveSign; // next will be start of a new word
if (this.eowAction) {
switch (this.format) {
@@ -536,6 +537,7 @@ B220ConsolePrinter.prototype.receiveChar = function receiveChar(char, successor)
this.printTab();
break;
case 2: // EOW = carriage-return
delay *= 2;
this.emptyLine();
break;
}

View File

@@ -730,8 +730,8 @@ B220ControlConsole.prototype.keyboardOpen = function keyboardOpen() {
B220ControlConsole.prototype.outputUnitSelect = function outputUnitSelect(unitNr, successor) {
/* Prepares for paper-tape or SPO output by selecting the first ready device
having a unitMask matching the unitNr parameter. If one is found, returns
that index and calls initiateOutput() for the unit. If no such unit is found,
returns -1 */
that index and schedules initiateOutput() for the unit. If no such unit is
found, returns -1 */
var result = -1; // be pessimistic
var u = null; // output unit object
var x; // for loop index
@@ -741,8 +741,8 @@ B220ControlConsole.prototype.outputUnitSelect = function outputUnitSelect(unitNr
if (u && u.ready) {
if (u.unitMask & B220Processor.pow2[unitNr]) {
result = x;
u.initiateOutput(successor);
break; // out of for loop
setCallback(this.mnemonic, u, 1, u.initiateOutput, successor);
break; // out of for loop
}
}
}

130
webUI/B220DiagMonitor.html Normal file
View File

@@ -0,0 +1,130 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>retro-220 Emulator Diagnostic Panel</title>
<!--
/***********************************************************************
* retro-220/webUI B220DiagMonitor.html
************************************************************************
* Copyright (c) 2017, Paul Kimpel.
* Licensed under the MIT License, see
* http://www.opensource.org/licenses/mit-license.php
************************************************************************
* Burroughs 220 emulator diagnostic monitoring panel.
************************************************************************
* 2017-05-13 P.Kimpel
* Original version, from retro-205 D205DiagMonitor.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=diagStyleSheet rel=stylesheet type="text/css" href="B220.css">
<script>
window.addEventListener("load", function(ev) {
var body = document.getElementById("DiagBody");
var delayDevNodes = {};
var getCallbackState = window.global.getCallbackState;
var intervalPeriod = 300; // milliseconds
var intervalToken = 0;
var p = null; // the Processor object
var delayDeltaNode = document.getElementById("DelayDeltaAvg").firstChild;
var execClockNode = document.getElementById("ExecClock").firstChild;
var procRunNode = document.getElementById("ProcRunAvg").firstChild;
var procSlackNode = document.getElementById("ProcSlackAvg").firstChild;
var procTimeNode = document.getElementById("ProcTime").firstChild;
var timeStampNode = document.getElementById("TimeStamp").firstChild;
function clockIn(stamp, val) {
/* Clocks in a clocked-out timer */
var t = val;
while (t < 0) {
t += stamp;
}
return t;
}
function refreshStats() {
/* Obtains the current "delayDev" has from the SetCallback mechanism and
formats the data to DiagBody */
var cat;
var cell;
var textNode;
var delayDev;
var e;
var row;
var stamp = performance.now();
var state;
if (!p) {
p = window.global.B220Processor.instance;
} else {
timeStampNode.nodeValue = p.runStamp.toFixed(2);
execClockNode.nodeValue = clockIn(stamp, p.execClock).toFixed(2);
procTimeNode.nodeValue = clockIn(stamp, p.procTime).toFixed(2);
delayDeltaNode.nodeValue = p.delayDeltaAvg.toFixed(2);
procSlackNode.nodeValue = p.procSlackAvg.toFixed(4);
procRunNode.nodeValue = p.procRunAvg.toFixed(4);
}
state = getCallbackState(0x01); // get delayDev hash only
delayDev = state.delayDev;
for (cat in delayDev) {
textNode = delayDevNodes[cat];
if (!textNode) {
row = document.createElement("tr");
cell = document.createElement("td");
cell.className = "rj";
textNode = document.createTextNode("");
delayDevNodes[cat] = textNode;
cell.appendChild(textNode);
row.appendChild(cell);
cell = document.createElement("td");
cell.appendChild(document.createTextNode(cat));
row.appendChild(cell);
body.appendChild(row);
}
textNode.nodeValue = delayDev[cat].toFixed(2);
} // for cat
}
window.resizeTo(300, 500);
window.moveTo(0, screen.availHeight-500);
intervalToken = setInterval(refreshStats, intervalPeriod);
window.addEventListener("unload", function(ev) {
if (intervalToken) {
clearInterval(intervalToken);
}
});
});
</script>
</head>
<body>
<h3>retro-220<br>Diagnostic Monitor</h1>
<hr>
<table id=DiagTable border=1 cellpadding=1 cellspacing=0>
<colgoup>
<col style="width:7em">
<col style="width:12em">
</colgroup>
<thead>
<tr>
<th>Delta (ms)<th>Category
<tbody id=DiagBody>
<tr><td id=TimeStamp class=rj> <td>Time Stamp
<tr><td id=ExecClock class=rj> <td>Exec Clock
<tr><td id=ProcTime class=rj> <td>Proc Time
<tr><td id=DelayDeltaAvg class=rj> <td>Delay Delta Avg
<tr><td id=ProcSlackAvg class=rj> <td>Proc Slack Avg
<tr><td id=ProcRunAvg class=rj> <td>Proc Run Avg
</table>
</body>
</html>

View File

@@ -1,5 +1,5 @@
CACHE MANIFEST
# retro-220 emulator 0.00e, 2017-05-09 20:15
# retro-220 emulator 0.01, 2017-05-13 18:30
CACHE:
../emulator/B220Processor.js
B220.css
@@ -30,7 +30,7 @@ B220ControlConsole.js
#B220DataFile.css
#B220DataFile.html
#B220DataFile.js
#B220DiagMonitor.html
B220DiagMonitor.html
B220FramePaper.html
#B220MagTapeControl.css
#B220MagTapeControl.html

View File

@@ -487,7 +487,7 @@ function OrganSwitch(parent, x, y, id, offImage, onImage, momentary) {
OrganSwitch.topCaptionClass = "OrganSwitchTopCaption";
OrganSwitch.bottomCaptionClass = "OrganSwitchBottomCaption";
OrganSwitch.momentaryPeriod = 150; // time for momentary switch to bounce back, ms
OrganSwitch.momentaryPeriod = 200; // time for momentary switch to bounce back, ms
/**************************************/
OrganSwitch.prototype.addEventListener = function addEventListener(eventName, handler, useCapture) {