1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-02-13 03:34:29 +00:00
Files
pkimpel.retro-b5500/webUI/B5500DummyUnit.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

114 lines
4.4 KiB
JavaScript

/***********************************************************************
* retro-b5500/emulator B5500DummyUnit.js
************************************************************************
* Copyright (c) 2012, Nigel Williams and Paul Kimpel.
* Licensed under the MIT License, see
* http://www.opensource.org/licenses/mit-license.php
************************************************************************
* B5500 Dummy/Non-existent Peripheral Unit module.
*
* Defines a dummy peripheral unit type that should be instantiated for all
* non-existent or unimplemented peripheral units in the system. This class
* defines the full peripheral interface, but immediately reports a non-ready
* result for all I/O operations that are attempted.
*
************************************************************************
* 2012-12-21 P.Kimpel
* Original version, from thin air.
***********************************************************************/
"use strict";
/**************************************/
function B5500DummyUnit(mnemonic, index, designate, statusChange, signal) {
/* Constructor for the DummyUnit object */
this.mnemonic = mnemonic; // Unit mnemonic
this.index = index; // Ready-mask bit number
this.designate = designate; // IOD unit designate number
this.statusChange = statusChange; // external function to call for ready-status change
this.signal = signal; // external function to call for special signals (e.g,. SPO input request)
this.timer = 0; // setCallback() token
this.initiateStamp = 0; // timestamp of last initiation (set by IOUnit)
this.clear();
}
/**************************************/
B5500DummyUnit.prototype.clear = function clear() {
/* Initializes (and if necessary, creates) the processor state */
this.ready = false; // ready status
this.busy = false; // busy status
this.errorMask = 0; // error mask for finish()
this.finish = null; // external function to call for I/O completion
this.buffer = null; //
};
/**************************************/
B5500DummyUnit.prototype.read = function read(finish, buffer, length, mode, control) {
/* Initiates a read operation on the unit */
finish(0x04, 0); // report unit not ready
};
/**************************************/
B5500DummyUnit.prototype.space = function space(finish, length, control) {
/* Initiates a space operation on the unit */
finish(0x04, 0); // report unit not ready
};
/**************************************/
B5500DummyUnit.prototype.write = function write(finish, buffer, length, mode, control) {
/* Initiates a write operation on the unit */
finish(0x04, 0); // report unit not ready
};
/**************************************/
B5500DummyUnit.prototype.erase = function erase(finish, length) {
/* Initiates an erase operation on the unit */
finish(0x04, 0); // report unit not ready
};
/**************************************/
B5500DummyUnit.prototype.rewind = function rewind(finish) {
/* Initiates a rewind operation on the unit */
finish(0x04, 0); // report unit not ready
};
/**************************************/
B5500DummyUnit.prototype.readCheck = function readCheck(finish, length, control) {
/* Initiates a read check operation on the unit */
finish(0x04, 0); // report unit not ready
};
/**************************************/
B5500DummyUnit.prototype.readInterrogate = function readInterrogate(finish, control) {
/* Initiates a read interrogate operation on the unit */
finish(0x04, 0); // report unit not ready
};
/**************************************/
B5500DummyUnit.prototype.writeInterrogate = function writeInterrogate(finish, control) {
/* Initiates a write interrogate operation on the unit */
finish(0x04, 0); // report unit not ready
};
/**************************************/
B5500DummyUnit.prototype.shutDown = function shutDown() {
/* Shuts down the device */
if (this.timer) {
clearCallback(this.timer);
}
// this device has no window to close
};