A (PC8080) VT100 can now connect to a (PCx86) IBM PC AT; only problem seems to be flow control now.
Also, each PCjs debugger can now be independently accessed from an external debugger (eg, "pcx86('ver')" or "pc8080('ver')"); the global '$' symbol is no longer used for debugger access.
TODO: There are still many places where GLOBALVAR should be replaced with PCX86.GLOBALVAR or PC8080.GLOBALVAR as appropriate (which I've finally started doing in each debugger.js file).
This commit is contained in:
parent
a3c0995934
commit
5ed8f13840
45 changed files with 10989 additions and 1417 deletions
|
|
@ -1561,6 +1561,11 @@ Computer8080.show = function()
|
|||
computer.printMessage("onShow(" + computer.fInitialized + "," + computer.flags.fPowered + ")");
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that the FIRST 'onpageshow' event, and therefore the first show() callback, occurs
|
||||
* AFTER the the initial 'onload' event, and at that point in time, fInitialized will not be set yet.
|
||||
* So, practically speaking, the first show() callback isn't all that useful.
|
||||
*/
|
||||
if (computer.fInitialized && !computer.flags.fPowered) {
|
||||
/**
|
||||
* Repower the computer, notifying every component to continue running as-is.
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ if (DEBUGGER) {
|
|||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var State = require("../../shared/lib/state");
|
||||
var PC8080 = require("./defines");
|
||||
var CPUDef8080 = require("./cpudef");
|
||||
var CPU8080 = require("./cpu");
|
||||
var Keyboard8080= require("./keyboard");
|
||||
|
|
@ -192,19 +193,19 @@ function Debugger8080(parmsDbg)
|
|||
* Make it easier to access Debugger8080 commands from an external REPL (eg, the WebStorm
|
||||
* "live" console window); eg:
|
||||
*
|
||||
* $('r')
|
||||
* $('dw 0:0')
|
||||
* $('h')
|
||||
* pc8080('r')
|
||||
* pc8080('dw 0:0')
|
||||
* pc8080('h')
|
||||
* ...
|
||||
*/
|
||||
var dbg = this;
|
||||
if (window) {
|
||||
if (window['$'] === undefined) {
|
||||
window['$'] = function(s) { return dbg.doCommands(s); };
|
||||
if (window[PC8080.APPCLASS] === undefined) {
|
||||
window[PC8080.APPCLASS] = function(s) { return dbg.doCommands(s); };
|
||||
}
|
||||
} else {
|
||||
if (global['$'] === undefined) {
|
||||
global['$'] = function(s) { return dbg.doCommands(s); };
|
||||
if (global[PC8080.APPCLASS] === undefined) {
|
||||
global[PC8080.APPCLASS] = function(s) { return dbg.doCommands(s); };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4760,7 +4761,7 @@ if (DEBUGGER) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
this.println((APPNAME || "PC8080") + " version " + (XMLVERSION || APPVERSION) + " (" + this.cpu.model + (COMPILED? ",RELEASE" : (DEBUG? ",DEBUG" : ",NODEBUG")) + (TYPEDARRAYS? ",TYPEDARRAYS" : (BYTEARRAYS? ",BYTEARRAYS" : ",LONGARRAYS")) + ')');
|
||||
this.println((PC8080.APPNAME || "PC8080") + " version " + (XMLVERSION || PC8080.APPVERSION) + " (" + this.cpu.model + (PC8080.COMPILED? ",RELEASE" : (PC8080.DEBUG? ",DEBUG" : ",NODEBUG")) + (PC8080.TYPEDARRAYS? ",TYPEDARRAYS" : (PC8080.BYTEARRAYS? ",BYTEARRAYS" : ",LONGARRAYS")) + ')');
|
||||
this.println(web.getUserAgent());
|
||||
break;
|
||||
case '?':
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@ if (NODE) {
|
|||
global.BYTEARRAYS = BYTEARRAYS;
|
||||
global.TYPEDARRAYS = TYPEDARRAYS;
|
||||
global.PC8080 = PC8080;
|
||||
/*
|
||||
* TODO: When we're "required" by Node, should we return anything via module.exports?
|
||||
*/
|
||||
|
||||
module.exports = PC8080;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ function SerialPort8080(parmsSerial) {
|
|||
}
|
||||
|
||||
/*
|
||||
* No connection until initBus() invokes initConnection().
|
||||
* No connection until initConnection() is called.
|
||||
*/
|
||||
this.sDataReceived = "";
|
||||
this.connection = this.sendData = null;
|
||||
|
|
@ -396,8 +396,6 @@ SerialPort8080.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
bus.addPortInputTable(this, SerialPort8080.aPortInput, this.portBase);
|
||||
bus.addPortOutputTable(this, SerialPort8080.aPortOutput, this.portBase);
|
||||
|
||||
this.initConnection();
|
||||
|
||||
this.setReady();
|
||||
};
|
||||
|
||||
|
|
@ -424,14 +422,14 @@ SerialPort8080.prototype.initConnection = function()
|
|||
var asParts = sConnection.split('->');
|
||||
if (asParts.length == 2) {
|
||||
var sSourceID = str.trim(asParts[0]);
|
||||
if (sSourceID != this.idComponent) return; // this connection string is meant for another instance
|
||||
if (sSourceID != this.idComponent) return; // this connection string is intended for another instance
|
||||
var sTargetID = str.trim(asParts[1]);
|
||||
this.connection = Component.getComponentByID(sTargetID);
|
||||
if (this.connection) {
|
||||
var exports = this.connection['exports'];
|
||||
if (exports) {
|
||||
this.sendData = exports['receiveData'];
|
||||
this.printMessage(this.idMachine + '.' + sSourceID + " connected to " + sTargetID, true);
|
||||
this.status(this.idMachine + '.' + sSourceID + " connected to " + sTargetID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -451,6 +449,16 @@ SerialPort8080.prototype.initConnection = function()
|
|||
SerialPort8080.prototype.powerUp = function(data, fRepower)
|
||||
{
|
||||
if (!fRepower) {
|
||||
|
||||
/*
|
||||
* We needed to wait until now to make our first inter-machine connection attempt;
|
||||
* doing this in initBus() was still too early, because initBus() is called in the context
|
||||
* of onInit() processing for all machines of the same type (eg, PCx86), and if we're
|
||||
* trying to connect to the port of a machine of a DIFFERENT type (eg, PC8080), it may not
|
||||
* have been initialized yet.
|
||||
*/
|
||||
this.initConnection();
|
||||
|
||||
if (!data || !this.restore) {
|
||||
this.reset();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue