1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-04-16 01:30:40 +00:00

Commit version 1.03e:

1. Reduce buffer size in B5500DatacomUnit from 112 to 56 characters to accommodate the R/C text editor under the DCMCP.
2. Correct bug in B5500DatacomUnit that caused to first several characters after an input message to be output too quickly.
3. Change method of Greenbar highlighting in B5500LinePrinter to eliminate extra blank lines every three lines when copying or saving the paper area.
4. Embed ASCII FF (hex 0C) characters in skip-to-channel lines for B5500LinePrinter.
5. Initialize focus to the "Start up Powered" button on B5500Console and the "Load" button on B5500ConsolePanel.
6. Adjust method of initially positioning peripheral windows so it works better in Google Chrome.
This commit is contained in:
Paul Kimpel
2016-06-02 05:52:36 -07:00
parent 252c5adfa1
commit fa9d0a997c
13 changed files with 5186 additions and 32 deletions

View File

@@ -61,7 +61,7 @@ function B5500CentralControl(global) {
/**************************************/
/* Global constants */
B5500CentralControl.version = "1.03d";
B5500CentralControl.version = "1.03e";
B5500CentralControl.memReadCycles = 2; // assume 2 µs memory read cycle time (the other option was 3 µs)
B5500CentralControl.memWriteCycles = 4; // assume 4 µs memory write cycle time (the other option was 6 µs)

View File

@@ -778,9 +778,26 @@ B5500IOUnit.prototype.finishGenericRead = function finishGenericRead(errorMask,
/**************************************/
B5500IOUnit.prototype.finishDatacomRead = function finishDatacomRead(errorMask, length) {
/* Handles I/O finish for a datacom read operation */
var bufExhausted = (errorMask & 0x080) >>> 7;
var bufExhausted = (errorMask & 0x80) >>> 7;
var tuBuf = (errorMask%0x10000000000 - errorMask%0x40000000)/0x40000000; // get TU/buf #
/********** Debug: **********
console.log(this.mnemonic + " U" + this.Dunit + ": TU " +
((tuBuf >>> 5) & 0x0F) + "/" + (tuBuf & 0x0F) + " " +
"DCRF: len=" + length + ", mask=" + errorMask.toString(8) + " " +
"state=" + ((errorMask & 0x100) >>> 8) + ((errorMask & 0x20) >>> 5) +
((errorMask & 0x10) >>> 4) + ((errorMask & 0x04) >>> 2) + " " +
((tuBuf & 0x200) ? "DTCN " : "DTCU ") +
((tuBuf & 0x10) ? "DCCN " : "DCCU ") +
((errorMask & 0x4000) ? "Intg " : "R/W ") +
((errorMask & 0x800) ? "BIN " : "BCL ") +
((errorMask & 0x200) ? "ABN " : "NOR ") +
(bufExhausted ? "BE " : "GM ") +
((errorMask & 0x40) ? "MO " : "OK ") +
((errorMask & 1) ? "BZ " : "RY "));
console.log(" ");
****************************/
if (bufExhausted || (tuBuf & 0x10)) {
this.storeBuffer(length, 0, 1, 56);
} else {
@@ -799,10 +816,27 @@ B5500IOUnit.prototype.finishDatacomRead = function finishDatacomRead(errorMask,
/**************************************/
B5500IOUnit.prototype.finishDatacomWrite = function finishDatacomWrite(errorMask, length) {
/* Handles I/O finish for a datacom write or interrogate operation */
var bufExhausted = (errorMask & 0x080) >>> 7;
var bufExhausted = (errorMask & 0x80) >>> 7;
var tuBuf = (errorMask%0x10000000000 - errorMask%0x40000000)/0x40000000; // get TU/buf #
if (!(bufExhausted || (this.DwordCount & 0x10))) {
/********** Debug: **********
console.log(this.mnemonic + " U" + this.Dunit + ": TU " +
((tuBuf >>> 5) & 0x0F) + "/" + (tuBuf & 0x0F) + " " +
"DCWF: len=" + length + ", mask=" + errorMask.toString(8) + " " +
"state=" + ((errorMask & 0x100) >>> 8) + ((errorMask & 0x20) >>> 5) +
((errorMask & 0x10) >>> 4) + ((errorMask & 0x04) >>> 2) + " " +
((tuBuf & 0x200) ? "DTCN " : "DTCU ") +
((tuBuf & 0x10) ? "DCCN " : "DCCU ") +
((errorMask & 0x4000) ? "Intg " : "R/W ") +
((errorMask & 0x800) ? "BIN " : "BCL ") +
((errorMask & 0x200) ? "ABN " : "NOR ") +
(bufExhausted ? "BE " : "GM ") +
((errorMask & 0x40) ? "MO " : "OK ") +
((errorMask & 1) ? "BZ " : "RY "));
console.log(" ");
****************************/
if (!bufExhausted) {
++length; // account for the terminating Group Mark
}
this.Daddress += (length+7) >>> 3;
@@ -824,6 +858,14 @@ B5500IOUnit.prototype.initiateDatacomIO = function initiateDatacomIO(u) {
maximum DTTU buffer of 448 chars (56 B5500 words) */
var chars;
/********** Debug: **********
console.log(this.mnemonic + " U" + this.Dunit + " IOCW=" + this.D.toString(8) + ": TU " +
((this.DwordCount >>> 5) & 0x0F) + "/" + (this.DwordCount & 0x0F) + " " +
(this.D24F ? (this.D18F ? "Rint " : "Read ") : (this.D18F ? "Intg " : "Write ")) +
((this.DwordCount & 0x10) ? "NG " : "GM ") +
(this.D21F ? "BIN " : "BCL ") + "A=" + this.Daddress.toString(8));
****************************/
this.D23F = 0; // datacom does not use word count field as a word count
if (this.D24F) { // DCA read
u.read(this.boundFinishDatacomRead, this.buffer, 449, this.D21F, this.DwordCount);
@@ -1088,7 +1130,7 @@ B5500IOUnit.prototype.forkIO = function forkIO() {
this.LP = (x >>> 15) & 0x3F; // save control bits for disk, drum, and printer
this.Daddress = x % 0x8000; // starting memory address
this.busyUnit = index = B5500CentralControl.unitIndex[this.D24F & 1][this.Dunit & 0x1F];
this.busyUnit = index = B5500CentralControl.unitIndex[this.D24F][this.Dunit];
if (this.cc.testUnitBusy(index)) {
this.D32F = 1; // set unit busy error
this.finish();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -144,8 +144,8 @@ function dumpr(caption) {
document.write(" ");
}
document.write(" ");
//document.write(B5500Util.octize(r[i][j], 16)); // raw output
document.write(B5500Util.octize(b55Normalize(r[i][j]), 16)); // normalized output
document.write(B5500Util.octize(r[i][j], 16)); // raw output
//document.write(B5500Util.octize(b55Normalize(r[i][j]), 16)); // normalized output
}
}
document.writeln();

File diff suppressed because it is too large Load Diff

View File

@@ -61,6 +61,18 @@ DIV.devicePanel {
height: auto;
margin: 4px;
padding: 0}
DIV.paper {
font-family: DejaVuSansMonoBookWeb, monospace;
white-space: pre;
margin-top: 0;
margin-bottom: 0;
font-size: 8pt;
line-height: 120%}
DIV.topOfForm {
page-break-before: always;
margin-top: 1px;
padding-top: 1px;
border-top: 1px dashed black}
IFRAME.paper {
font-family: DejaVuSansMonoBookWeb, monospace;
@@ -76,11 +88,6 @@ PRE.paper {
margin-bottom: 0;
font-size: 8pt;
line-height: 120%}
PRE.topOfForm {
page-break-before: always;
margin-top: 1px;
padding-top: 1px;
border-top: 1px dashed black}
INPUT[type=text] {
font-family: DejaVuSansMonoBookWeb, monospace;

View File

@@ -27,6 +27,7 @@ window.addEventListener("load", function() {
consolePanel = null;
document.getElementById("StartUpPoweredBtn").disabled = false;
document.getElementById("StartUpNoPowerBtn").disabled = false;
document.getElementById("StartUpPoweredBtn").focus();
window.focus();
}
@@ -89,6 +90,7 @@ window.addEventListener("load", function() {
document.getElementById("StartUpPoweredBtn").addEventListener("click", systemStartup);
document.getElementById("StartUpNoPowerBtn").disabled = false;
document.getElementById("StartUpNoPowerBtn").addEventListener("click", systemStartup);
document.getElementById("StartUpPoweredBtn").focus();
window.applicationCache.addEventListener("checking", function(ev) {
document.getElementById("StatusMsg").textContent = "Checking for emulator update...";

View File

@@ -101,6 +101,7 @@ B5500ConsolePanel.prototype.focusConsole = function focusConsole() {
/* Globally-accessible function to focus the console panel window */
this.window.focus();
this.$$("LoadBtn").focus();
}
/**************************************/

View File

@@ -29,7 +29,7 @@ function B5500DatacomUnit(mnemonic, unitIndex, designate, statusChange, signal,
this.maxScrollLines = 5000; // Maximum amount of printer scrollback
this.charPeriod = 100; // Printer speed, milliseconds per character
this.bufferSize = 112; // 4 28-character B487 buffer segments
this.bufferSize = 56; // 2 x 28-character B487 buffer segments
this.mnemonic = mnemonic; // Unit mnemonic
this.unitIndex = unitIndex; // Ready-mask bit number
@@ -275,8 +275,8 @@ B5500DatacomUnit.prototype.outputChar = function outputChar() {
} else {
stamp = performance.now();
nextTime = (this.nextCharTime < stamp ? stamp : this.nextCharTime) + this.charPeriod;
delay = nextTime - stamp;
this.nextCharTime = nextTime;
delay = nextTime - stamp;
c = this.buffer[this.bufIndex++];
switch (c) {
@@ -337,7 +337,8 @@ B5500DatacomUnit.prototype.keyAction = function keyAction(ev, c) {
this.nextCharTime = stamp;
}
nextTime = this.nextCharTime + this.charPeriod;
nextTime = (this.nextCharTime < stamp ? stamp : this.nextCharTime) + this.charPeriod;
this.nextCharTime = nextTime;
delay = nextTime - stamp;
if (this.bufState == this.bufReadReady && this.fullBuffer) {
@@ -351,7 +352,7 @@ B5500DatacomUnit.prototype.keyAction = function keyAction(ev, c) {
case 0x7E: // ~ left-arrow (Group Mark), end of message
case 0x5F: // _ underscore (TTY left-arrow), end of message
this.inTimer = setCallback(this.mnemonic, this, delay, this.printChar, c);
this.nextCharTime = this.charPeriod + nextTime;
this.nextCharTime += this.charPeriod;
setCallback(this.mnemonic, this, this.charPeriod+delay, this.terminateInput);
ev.stopPropagation();
ev.preventDefault();
@@ -361,7 +362,6 @@ B5500DatacomUnit.prototype.keyAction = function keyAction(ev, c) {
--this.bufIndex;
}
this.inTimer = setCallback(this.mnemonic, this, delay, this.printChar, c);
this.nextCharTime = nextTime;
ev.stopPropagation();
ev.preventDefault();
break;
@@ -372,7 +372,6 @@ B5500DatacomUnit.prototype.keyAction = function keyAction(ev, c) {
this.setState(this.bufReadReady);
setCallback(this.mnemonic, this, delay, this.signal);
this.inTimer = setCallback(this.mnemonic, this, delay, this.printChar, c);
this.nextCharTime = nextTime;
ev.stopPropagation();
ev.preventDefault();
break;
@@ -412,7 +411,6 @@ B5500DatacomUnit.prototype.keyAction = function keyAction(ev, c) {
c -= 32; // up-case echoed letters
}
this.inTimer = setCallback(this.mnemonic, this, delay, this.printChar, c);
this.nextCharTime = nextTime;
if (this.bufIndex < this.bufferSize) {
this.setState(this.bufInputBusy);
} else {
@@ -755,7 +753,7 @@ B5500DatacomUnit.prototype.writeInterrogate = function writeInterrogate(finish,
var bufNr;
var tuNr;
this.errorMask = 0; // default result is idle
this.errorMask = 0x4000; // default result is idle & interrogate
bufNr = control % 0x10;
tuNr = (control % 0x200) >>> 5;

View File

@@ -32,15 +32,17 @@ BODY {
height: 1px;
border: 0;
opacity: 0}
PRE.whiteBar {
DIV.whiteBar {
white-space: pre;
background-color: white}
PRE.greenBar {
DIV.greenBar {
white-space: pre;
background-color: #CFC}
</style>
</head>
<body>
<pre id=Paper class=paper></pre>
<div id=Paper class=paper></div>
<div id=EndOfPaper></div>
</body>
</html>

View File

@@ -140,21 +140,23 @@ B5500LinePrinter.prototype.appendLine = function appendLine(text) {
greenbar group, this.barGroup. This handles top-of-form and greenbar
highlighting */
var feed = "\n";
var skip = "";
if (this.groupLinesLeft <= 0) {
// Start the green half of a greenbar group
this.barGroup = this.doc.createElement("pre");
this.barGroup = this.doc.createElement("div");
this.paper.appendChild(this.barGroup);
this.groupLinesLeft = this.lpi;
if (!this.atTopOfForm) {
this.barGroup.className = "paper greenBar";
} else {
skip = "\f"; // prepend a form-feed to the line
this.atTopOfForm = false;
this.barGroup.className = "paper greenBar topOfForm";
}
} else if (this.groupLinesLeft*2 == this.lpi) {
// Start the white half of a greenbar group
this.barGroup = this.doc.createElement("pre");
this.barGroup = this.doc.createElement("div");
this.paper.appendChild(this.barGroup);
this.barGroup.className = "paper whiteBar";
} else if (this.groupLinesLeft == 1) {
@@ -163,7 +165,7 @@ B5500LinePrinter.prototype.appendLine = function appendLine(text) {
feed = ""; // ditto
}
this.barGroup.appendChild(this.doc.createTextNode(text + feed));
this.barGroup.appendChild(this.doc.createTextNode(skip + text + feed));
--this.groupLinesLeft;
};
@@ -227,7 +229,7 @@ B5500LinePrinter.prototype.setGreenbar = function setGreenbar(useGreen) {
// Next, search through the rules for the one that controls greenbar shading.
for (x=rules.length-1; x>=0; --x) {
rule = rules[x];
if (rule.selectorText.toLowerCase() == "pre.greenbar") {
if (rule.selectorText.toLowerCase() == "div.greenbar") {
// Found it: now flip the background color.
rule.style.backgroundColor = (useGreen ? this.theColorGreen : "white");
}
@@ -368,6 +370,8 @@ B5500LinePrinter.prototype.printerOnload = function printerOnload() {
B5500CentralControl.bindMethod(this, B5500LinePrinter.prototype.LPStopBtn_onclick), false);
this.$$("LPStartBtn").addEventListener("click",
B5500CentralControl.bindMethod(this, B5500LinePrinter.prototype.LPStartBtn_onclick), false);
this.window.moveTo(0, screen.availHeight - this.window.outerHeight);
};
/**************************************/

View File

@@ -43,7 +43,8 @@ function B5500SPOUnit(mnemonic, unitIndex, designate, statusChange, signal, opti
this.inputBox = null;
this.endOfPaper = null;
this.window = window.open("../webUI/B5500SPOUnit.html", mnemonic,
"location=no,scrollbars=no,resizable,width=" + w + ",height=" + h);
"location=no,scrollbars=no,resizable,width=" + w + ",height=" + h +
",left=" + (screen.availWidth - w) + ",top=" + (screen.availHeight - h));
this.window.addEventListener("load", B5500CentralControl.bindMethod(this,
B5500SPOUnit.prototype.spoOnload), false);
}
@@ -510,18 +511,20 @@ B5500SPOUnit.prototype.spoOnload = function spoOnload() {
this.$$("SPOAlgolGlyphsBtn").addEventListener("click",
B5500CentralControl.bindMethod(this, B5500SPOUnit.prototype.SPOAlgolGlyphsBtn_onclick), false);
this.window.focus();
this.printText("retro-B5500 Emulator Version " + B5500CentralControl.version,
B5500CentralControl.bindMethod(this, function initFinish() {
this.window.focus();
this.setRemote();
this.appendEmptyLine("\xA0");
this.endOfPaper.scrollIntoView();
this.signal(-1); // re-focus the Console window
}));
this.window.moveTo(screen.availWidth-this.window.outerWidth,
screen.availHeight-this.window.outerHeight);
this.window.focus();
// 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);
});
};
/**************************************/