mirror of
https://github.com/pkimpel/retro-b5500.git
synced 2026-02-13 03:34:29 +00:00
2. Inhibit peripheral device windows from being closed while emulator is active. 3. Shut down peripheral devices and close their windows as part of cc.powerOff(). 4. Add shut-down code to peripheral drivers. 5. Ensure SPO is ready in cc.load(). 6. Enable emulator version display on B5500Console. 7. Clear DummyPrinter window when it is double-clicked (finally got this working). 8. Fix problem with "/" not accepted by SPO input in Google Chrome. 9. Commit ESPOL binary card loader image. 10. Fix problem with intensity levels in B5500Console NORMAL/CONTROL lights. 11. Attempt to enable emulator and utilities for Safari-style IndexedDB.
115 lines
4.5 KiB
JavaScript
115 lines
4.5 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 = null; // setTimeout() 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.activeIOUnit = 0; // I/O unit currently using this device
|
|
|
|
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) {
|
|
clearTimeout(this.timer);
|
|
}
|
|
// this device has no window to close
|
|
};
|