1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-02-12 19:27:39 +00:00
Files
pkimpel.retro-b5500/webUI/prototypes/B5500DistributionAndDisplay.js
paul.kimpel@digm.com 1c430583cd 1. Release emulator version 0.20.
2. Fully implement Double Precision Add/Subtract (DLA/DLS), Multiply (DLM), and Divide (DLD) syllables.
3. Replace standard setTimeout() by redesigned setCallback() mechanism throughout the emulator for scheduling timing delays and other callbacks on the Javascript thread. Delete obsolete setImmediate() mechanism.
4. Replace "new Date().getTime()" by "performance.now()" calls for greater timer precision.
5. Minor tweaks to Single Precision arithmetic operators.
6. Replace Javascript postfix operators by prefix operators wherever feasible (e.g., x++ becomes ++x).
8. Attempt to correct character translation and keyboard filtering in DatacomUnit for CANDE.
9. Minor changes to button colors and illumination behavior for I/O devices and Console.
10. Suppress I/O device classes in B5500SyllableDebugger by default (uncomment in source to enable).
. Drop support for webkitIndexedDB and mozIndexedDB (for now).
. Configure four tape drives (MTA-MTD) by default.
2014-06-29 21:13:51 +00:00

79 lines
2.9 KiB
JavaScript

/***********************************************************************
* retro-b5500/emulator B5500DistributionAndDisplay.js
************************************************************************
* Copyright (c) 2012, Nigel Williams and Paul Kimpel.
* Licensed under the MIT License, see http://www.opensource.org/licenses/mit-license.php
************************************************************************
* JavaScript object definition for the B5500 Distribution & Display module.
************************************************************************
* 2012-06-16 P.Kimpel
* Original version, from thin air.
***********************************************************************/
"use strict";
/**************************************/
function B5500DistributionAndDisplay(cc) {
/* Constructor for the Distribution And Display module object */
this.cc = cc; // Reference back to Centrol Control module
/* Global system modules */
this.nextRefresh = 0; // Next actual Date.getTime() expected
this.timer = null; // Reference to the RTC setTimeout id.
this.panels = {}; // D&D panel object collection
this.updateDisplay.that = this; // Establish contexts for when called from setTimeout().
this.clear(); // Create and initialize the Central Control state
}
/**************************************/
/* Global constants */
B5500DistributionAndDisplay.prototype.refreshPeriod = 50; // milliseconds
/**************************************/
B5500DistributionAndDisplay.prototype.clear = function() {
/* Initializes the displays and starts the refresh timer */
if (this.timer) {
clearTimeout(this.timer);
}
this.nextTimeStamp = new Date().getTime() + this.refreshPeriod;
this.timer = setTimeout(this.tock, this.refreshPeriod);
}
}
/**************************************/
B5500DistributionAndDisplay.prototype.openProcessorPanel(p, caption) {
/* Creates a D&D panel window for a processor */
var x;
var panel = this.panels[caption];
if (panel) {
win = panel.window;
} else {
win = window.open("B5500ProcessorPanel.html", "P"+caption,
"resizable=yes,scrollbars=yes");
panel = {module:p, window:win, caption:caption};
this.panels[caption] = panel;
}
}
/**************************************/
B5500DistributionAndDisplay.prototype.updateDisplay = function updateDisplay() {
/* Schedules itself to update the display on a periodic basis. */
var delayTime;
var that = updateDisplay.that;
var thisTime = new Date().getTime();
// Schedule ourself for the next refresh period
that.nextRefresh += that.refreshPeriod;
delayTime = that.nextRefresh - thisTime;
that.timer = setTimeout(that.updateDisplay, (delayTime < 0 ? 1 : delayTime);
}