mirror of
https://github.com/pkimpel/retro-b5500.git
synced 2026-05-02 22:33:52 +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:
@@ -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;
|
||||
|
||||
@@ -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...";
|
||||
|
||||
@@ -101,6 +101,7 @@ B5500ConsolePanel.prototype.focusConsole = function focusConsole() {
|
||||
/* Globally-accessible function to focus the console panel window */
|
||||
|
||||
this.window.focus();
|
||||
this.$$("LoadBtn").focus();
|
||||
}
|
||||
|
||||
/**************************************/
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
/**************************************/
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
/**************************************/
|
||||
|
||||
Reference in New Issue
Block a user