Working on next release (v1.24.1): first change is enabling smooth scrolling by default

This commit is contained in:
Jeff Parsons 2016-08-19 16:10:48 -07:00
commit 6a5e18d493
222 changed files with 355 additions and 289 deletions

View file

@ -37,6 +37,7 @@ if (NODE) {
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 Messages8080= require("./messages");
}
@ -428,6 +429,15 @@ ChipSet8080.prototype.initBus = function(cmp, bus, cpu, dbg)
this.video = /** @type {Video8080} */ (cmp.getMachineComponent("Video"));
bus.addPortInputTable(this, this.config.portsInput);
bus.addPortOutputTable(this, this.config.portsOutput);
if (DEBUGGER) {
if (dbg) {
var chipset = this;
dbg.messageDump(Messages8080.NVR, function onDumpNVR() {
chipset.dumpNVR();
});
}
}
};
/**
@ -490,12 +500,33 @@ ChipSet8080.VT100.INIT = [
[
0, 0, 0, 0,
[
0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80,
0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80,
0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80,
0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e80, 0x2e00,
0x2e08, 0x2e8e, 0x2e00, 0x2e50, 0x2e30, 0x2e40, 0x2e20, 0x2e00, 0x2ee0, 0x2ee0,
0x2e51, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
/*
* The following table contains the data we use to initialize all (100) words of NVR (Non-Volatile RAM).
* According the DEC Technical Manual:
*
* If the NVR fails, the bell sounds several times to inform the operator, and then default settings
* stored in the ROM allow the terminal to work.
*
* However, this behavior may be limited to only certain kinds of "failures", because if I deliberately
* stuff an invalid value in the table, there is indeed an attempt to beep (though sound isn't working yet),
* an error code (2) is displayed in the top-left corner of the screen, but the NVR still appears to contain
* all the same (invalid) data we started with. Perhaps all they meant to say is that the RAM copy of NVR
* settings is reset, not the NVR itself.
*
* Using a VT100 configuration with the Debugger attached, use the NVR dumper command ("d nvr") to see how
* other SET-UP changes affect the NVR (after you've saved your changes using SHIFT-S, of course).
*
* NVR Notes
* ---------
* After enabling smooth scrolling, the word in row 5, col 4 changes from 2E50 to 2ED0, and the final word
* changes from 2E51 to 2E71 (I'm guessing that the final word is an NVR checksum).
*/
0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80,
0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80,
0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80,
0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E80, 0x2E00,
0x2E08, 0x2E8E, 0x2E00, 0x2ED0, 0x2E30, 0x2E40, 0x2E20, 0x2E00, 0x2EE0, 0x2EE0,
0x2E71, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@ -504,6 +535,25 @@ ChipSet8080.VT100.INIT = [
]
];
/**
* dumpNVR()
*
* @this {ChipSet8080}
*/
ChipSet8080.prototype.dumpNVR = function()
{
if (DEBUGGER) {
var sDump = "";
for (var iWord = 0; iWord < this.aNVRWords.length; iWord++) {
if (sDump) {
sDump += (iWord && (iWord % 10)? ", " : ",\n");
}
sDump += str.toHexWord(this.aNVRWords[iWord]);
}
this.dbg.println(sDump);
}
};
/**
* reset()
*

View file

@ -39,9 +39,6 @@ if (NODE) {
var ReportAPI = require("../../shared/lib/reportapi");
var Component = require("../../shared/lib/component");
var State = require("../../shared/lib/state");
/*
* TODO: I'm confused why WebStorm complains if the following require() is missing in THIS file but not other files.
*/
var PC8080 = require("./defines");
var Bus8080 = require("./bus");
var Messages8080= require("./messages");

View file

@ -36,6 +36,7 @@ if (NODE) {
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 Messages8080= require("./messages");

View file

@ -665,47 +665,6 @@ if (DEBUGGER) {
/* 0xFF */ [Debugger8080.INS.RST, Debugger8080.TYPE_INT]
];
/*
* Message categories supported by the messageEnabled() function and other assorted message
* functions. Each category has a corresponding bit value that can be combined (ie, OR'ed) as
* needed. The Debugger's message command ("m") is used to turn message categories on and off,
* like so:
*
* m port on
* m port off
* ...
*
* NOTE: The order of these categories can be rearranged, alphabetized, etc, as desired; just be
* aware that changing the bit values could break saved Debugger states (not a huge concern, just
* something to be aware of).
*/
Debugger8080.MESSAGES = {
"cpu": Messages8080.CPU,
"bus": Messages8080.BUS,
"mem": Messages8080.MEM,
"port": Messages8080.PORT,
"chipset": Messages8080.CHIPSET,
"keyboard": Messages8080.KEYBOARD, // "kbd" is also allowed as shorthand for "keyboard"; see doMessages()
"key": Messages8080.KEYS, // using "key" instead of "keys", since the latter is a method on JavasScript objects
"video": Messages8080.VIDEO,
"fdc": Messages8080.FDC,
"disk": Messages8080.DISK,
"serial": Messages8080.SERIAL,
"speaker": Messages8080.SPEAKER,
"computer": Messages8080.COMPUTER,
"log": Messages8080.LOG,
"warn": Messages8080.WARN,
/*
* Now we turn to message actions rather than message types; for example, setting "halt"
* on or off doesn't enable "halt" messages, but rather halts the CPU on any message above.
*
* Similarly, "m buffer on" turns on message buffering, defering the display of all messages
* until "m buffer off" is issued.
*/
"buffer": Messages8080.BUFFER,
"halt": Messages8080.HALT
};
Debugger8080.HISTORY_LIMIT = DEBUG? 100000 : 1000;
/**
@ -1315,9 +1274,9 @@ if (DEBUGGER) {
*/
var aEnable = this.parseCommand(sEnable.replace("keys","key").replace("kbd","keyboard"), false, '|');
if (aEnable.length) {
for (var m in Debugger8080.MESSAGES) {
for (var m in Messages8080.CATEGORIES) {
if (usr.indexOf(aEnable, m) >= 0) {
this.bitsMessage |= Debugger8080.MESSAGES[m];
this.bitsMessage |= Messages8080.CATEGORIES[m];
this.println(m + " messages enabled");
}
}
@ -1334,8 +1293,8 @@ if (DEBUGGER) {
*/
Debugger8080.prototype.messageDump = function(bitMessage, fnDumper)
{
for (var m in Debugger8080.MESSAGES) {
if (bitMessage == Debugger8080.MESSAGES[m]) {
for (var m in Messages8080.CATEGORIES) {
if (bitMessage == Messages8080.CATEGORIES[m]) {
this.afnDumpers[m] = fnDumper;
return true;
}
@ -3504,7 +3463,7 @@ if (DEBUGGER) {
if (sAddr == '?') {
var sDumpers = "";
for (m in Debugger8080.MESSAGES) {
for (m in Messages8080.CATEGORIES) {
if (this.afnDumpers[m]) {
if (sDumpers) sDumpers += ',';
sDumpers = sDumpers + m;
@ -3549,7 +3508,7 @@ if (DEBUGGER) {
}
if (sCmd == "d") {
for (m in Debugger8080.MESSAGES) {
for (m in Messages8080.CATEGORIES) {
if (asArgs[1] == m) {
var fnDumper = this.afnDumpers[m];
if (fnDumper) {
@ -3933,9 +3892,9 @@ if (DEBUGGER) {
*/
if (sCategory == "keys") sCategory = "key";
if (sCategory == "kbd") sCategory = "keyboard";
for (m in Debugger8080.MESSAGES) {
for (m in Messages8080.CATEGORIES) {
if (sCategory == m) {
bitsMessage = Debugger8080.MESSAGES[m];
bitsMessage = Messages8080.CATEGORIES[m];
fCriteria = !!(this.bitsMessage & bitsMessage);
break;
}
@ -3968,9 +3927,9 @@ if (DEBUGGER) {
*/
var n = 0;
var sCategories = "";
for (m in Debugger8080.MESSAGES) {
for (m in Messages8080.CATEGORIES) {
if (!sCategory || sCategory == m) {
var bitMessage = Debugger8080.MESSAGES[m];
var bitMessage = Messages8080.CATEGORIES[m];
var fEnabled = !!(this.bitsMessage & bitMessage);
if (fCriteria !== null && fCriteria != fEnabled) continue;
if (sCategories) sCategories += ',';

View file

@ -35,6 +35,7 @@ if (NODE) {
var str = require("../../shared/lib/strlib");
var web = require("../../shared/lib/weblib");
var Component = require("../../shared/lib/component");
var PC8080 = require("./defines");
var ChipSet8080 = require("./chipset");
var Messages8080= require("./messages");
}

View file

@ -36,6 +36,7 @@ var Messages8080 = {
BUS: 0x00000040,
MEM: 0x00000080,
PORT: 0x00000100,
NVR: 0x00004000,
CHIPSET: 0x00008000,
KEYBOARD: 0x00010000,
KEYS: 0x00020000,
@ -51,4 +52,46 @@ var Messages8080 = {
HALT: 0x80000000|0
};
/*
* Message categories supported by the messageEnabled() function and other assorted message
* functions. Each category has a corresponding bit value that can be combined (ie, OR'ed) as
* needed. The Debugger's message command ("m") is used to turn message categories on and off,
* like so:
*
* m port on
* m port off
* ...
*
* NOTE: The order of these categories can be rearranged, alphabetized, etc, as desired; just be
* aware that changing the bit values could break saved Debugger states (not a huge concern, just
* something to be aware of).
*/
Messages8080.CATEGORIES = {
"cpu": Messages8080.CPU,
"bus": Messages8080.BUS,
"mem": Messages8080.MEM,
"port": Messages8080.PORT,
"nvr": Messages8080.NVR,
"chipset": Messages8080.CHIPSET,
"keyboard": Messages8080.KEYBOARD, // "kbd" is also allowed as shorthand for "keyboard"; see doMessages()
"key": Messages8080.KEYS, // using "key" instead of "keys", since the latter is a method on JavasScript objects
"video": Messages8080.VIDEO,
"fdc": Messages8080.FDC,
"disk": Messages8080.DISK,
"serial": Messages8080.SERIAL,
"speaker": Messages8080.SPEAKER,
"computer": Messages8080.COMPUTER,
"log": Messages8080.LOG,
"warn": Messages8080.WARN,
/*
* Now we turn to message actions rather than message types; for example, setting "halt"
* on or off doesn't enable "halt" messages, but rather halts the CPU on any message above.
*
* Similarly, "m buffer on" turns on message buffering, deferring the display of all messages
* until "m buffer off" is issued.
*/
"buffer": Messages8080.BUFFER,
"halt": Messages8080.HALT
};
if (NODE) module.exports = Messages8080;

View file

@ -36,6 +36,7 @@ if (NODE) {
var usr = require("../../shared/lib/usrlib");
var web = require("../../shared/lib/weblib");
var Component = require("../../shared/lib/component");
var PC8080 = require("./defines");
var Bus8080 = require("./bus");
var CPUDef8080 = require("./cpudef");
var Memory8080 = require("./memory");

View file

@ -36,6 +36,7 @@ if (NODE) {
var web = require("../../shared/lib/weblib");
var Component = require("../../shared/lib/component");
var State = require("../../shared/lib/state");
var PC8080 = require("./defines");
var Memory8080 = require("./memory");
var ROM8080 = require("./rom");
}

View file

@ -36,6 +36,7 @@ if (NODE) {
var web = require("../../shared/lib/weblib");
var DumpAPI = require("../../shared/lib/dumpapi");
var Component = require("../../shared/lib/component");
var PC8080 = require("./defines");
var CPUDef8080 = require("./cpudef");
var Memory8080 = require("./memory");
}

View file

@ -36,6 +36,7 @@ if (NODE) {
var web = require("../../shared/lib/weblib");
var Component = require("../../shared/lib/component");
var State = require("../../shared/lib/state");
var PC8080 = require("./defines");
var Messages8080= require("./messages");
}

View file

@ -37,6 +37,7 @@ if (NODE) {
var DumpAPI = require("../../shared/lib/dumpapi");
var Component = require("../../shared/lib/component");
var State = require("../../shared/lib/state");
var PC8080 = require("./defines");
var ChipSet8080 = require("./chipset");
var Memory8080 = require("./memory");
var Messages8080= require("./messages");
@ -1153,6 +1154,16 @@ Video8080.prototype.updateVT100 = function(fForced)
* cache entry, to guarantee that it's redrawn on the next update.
*/
this.assert(iCellUpdated >= 0);
/*
* TODO: If I change the RECV rate to 19200 and enable smooth scrolling, I sometimes see a spurious
* "H" on the bottom line after a long series of "HELLO WORLD!\r\n" tests. Dumping video memory shows
* "HELLO WORLD!" on 23 lines and an "H" on the 24th line, so it's really there. But strangely, if
* I then press SET-UP two times, the restored screen does NOT have the spurious "H". So somehow the
* firmware knows what should and shouldn't be on-screen.
*
* Possible VT100 firmware bug? I'm not sure. Anyway, this DEBUG-only code is here to help trap
* that scenario, until I figure it out.
*/
if (DEBUG && (this.aCellCache[iCellUpdated] & 0x7f) == 0x48) {
console.log("spurious character?");
}