Merge branch 'next-release'

This commit is contained in:
Jeff Parsons 2016-12-04 11:35:06 -08:00
commit 6b208a9aca
30 changed files with 331 additions and 310 deletions

View file

@ -195,21 +195,6 @@ CPUPDP11.prototype.initBus = function(cmp, bus, cpu, dbg)
if (control) this.cmp.setBinding(null, CPUPDP11.BUTTONS[i], control);
}
/*
* We've already saved the parmsCPU 'autoStart' setting, but there may be a machine (or URL) override.
*/
var sAutoStart = cmp.getMachineParm('autoStart');
if (sAutoStart != null) {
this.flags.autoStart = (sAutoStart == "true"? true : (sAutoStart == "false"? false : !!sAutoStart));
}
/*
* Start running automatically on power-up, assuming there's no Debugger and no "Run" button.
*/
if ((!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined) {
this.flags.autoStart = true;
}
this.setReady();
};
@ -272,6 +257,21 @@ CPUPDP11.prototype.restore = function(data)
*/
CPUPDP11.prototype.powerUp = function(data, fRepower)
{
/*
* We've already saved the parmsCPU 'autoStart' setting, but there may be a machine (or URL) override.
*/
var sAutoStart = this.cmp.getMachineParm('autoStart');
if (sAutoStart != null) {
this.flags.autoStart = (sAutoStart == "true"? true : (sAutoStart == "false"? false : !!sAutoStart));
}
else if (this.flags.autoStart == null) {
/*
* If there's no explicit parmsCPU setting either, then we will autoStart if there's no Debugger and
* no "Run" button.
*/
this.flags.autoStart = ((!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined);
}
if (!fRepower) {
this.finish();
if (!data || !this.restore) {
@ -298,6 +298,9 @@ CPUPDP11.prototype.powerUp = function(data, fRepower)
*/
this.println("No debugger detected");
}
if (!this.flags.autoStart) {
this.println("CPU will not be auto-started, click Run to start");
}
}
/*
* The Computer component (which is responsible for all powerDown and powerUp notifications)
@ -1184,6 +1187,7 @@ CPUPDP11.prototype.startCPU = function(fUpdateFocus)
if (fUpdateFocus) this.cmp.setFocus(true);
this.cmp.start(this.msStartRun, this.getCycles());
}
if (!this.dbg) this.status("Started");
setTimeout(this.onRunTimeout, 0);
return true;
};

View file

@ -301,7 +301,7 @@ Component.getMachineResources = function(idMachine)
*/
Component.log = function(s, type)
{
if (DEBUG) {
if (!COMPILED) {
if (s) {
var sElapsed = "", sMsg = (type? (type + ": ") : "") + s;
if (typeof usr != "undefined") {
@ -352,7 +352,7 @@ Component.assert = function(f, s)
*/
Component.println = function(s, type, id)
{
if (DEBUG) {
if (!COMPILED) {
Component.log((id? (id + ": ") : "") + (s? ("\"" + s + "\"") : ""), type);
}
};
@ -368,7 +368,7 @@ Component.println = function(s, type, id)
*/
Component.notice = function(s, fPrintOnly, id)
{
if (DEBUG) {
if (!COMPILED) {
Component.println(s, "notice", id);
}
if (!fPrintOnly) web.alertUser((id? (id + ": ") : "") + s);
@ -381,7 +381,7 @@ Component.notice = function(s, fPrintOnly, id)
*/
Component.warning = function(s)
{
if (DEBUG) {
if (!COMPILED) {
Component.println(s, "warning");
}
web.alertUser(s);
@ -394,7 +394,7 @@ Component.warning = function(s)
*/
Component.error = function(s)
{
if (DEBUG) {
if (!COMPILED) {
Component.println(s, "error");
}
web.alertUser(s);
@ -716,7 +716,7 @@ Component.prototype = {
}
control.value += s + "\n";
control.scrollTop = control.scrollHeight;
if (DEBUG && window && window.console) console.log(s);
if (!COMPILED && window && window.console) console.log(s);
};
}(control));
/**
@ -750,7 +750,7 @@ Component.prototype = {
* @param {string} [type] is the message type
*/
log: function(s, type) {
if (DEBUG) {
if (!COMPILED) {
Component.log(s, type || this.id || this.type);
}
},

View file

@ -30,11 +30,15 @@
var Keys = {
/*
* Alphanumeric and other common (printable) ASCII codes.
* Keys and/or key combinations that generate common ASCII codes.
*
* TODO: Determine what we can do to get ALL constants like these inlined (enum doesn't seem to
* get the job done); the problem seems to be limited to property references that use quotes, which
* is why I've 'unquoted' as many of them as possible.
* NOTE: If you're looking for a general-purpose ASCII code table, see str.ASCII in strlib.js;
* if something's missing, that's probably the more appropriate table to add it to.
*
* TODO: The Closure Compiler doesn't inline all references to these values, at least those with
* quoted property names, which is why I've 'unquoted' as many of them as possible. One solution
* would be to add mnemonics for all of them, not just the non-printable ones (eg, SPACE instead
* of ' ', AMP instead of '&', etc.)
*/
ASCII: {
BREAK: 0, CTRL_A: 1, CTRL_B: 2, CTRL_C: 3, CTRL_D: 4, CTRL_E: 5, CTRL_F: 6, CTRL_G: 7,

View file

@ -553,12 +553,16 @@ str.trim = function(s)
};
/*
* Any codes commented out in the following table are deemed "printable"
* Future home of a general-purpose ASCII table. TODO: Flesh it out.
*/
str.ASCII = {
LF: 0x0A,
CR: 0x0D
};
/*
* Table for converting "unprintable" ASCII codes into mnemonics, to more clearly see what's being printed.
*/
str.aASCIICodes = {
0x00: "NUL",
0x01: "SOH", // (CTRL_A) Start of Heading
@ -570,10 +574,10 @@ str.aASCIICodes = {
0x07: "BEL", // (CTRL_G) Bell
0x08: "BS", // (CTRL_H) Backspace
0x09: "TAB", // (CTRL_I) Horizontal Tab
// 0x0A: "LF", // (CTRL_J) Line Feed (New Line)
0x0A: "LF", // (CTRL_J) Line Feed (New Line)
0x0B: "VT", // (CTRL_K) Vertical Tab
0x0C: "FF", // (CTRL_L) Form Feed (New Page)
// 0x0D: "CR", // (CTRL_M) Carriage Return
0x0D: "CR", // (CTRL_M) Carriage Return
0x0E: "SO", // (CTRL_N) Shift Out
0x0F: "SI", // (CTRL_O) Shift In
0x10: "DLE", // (CTRL_P) Data Link Escape
@ -602,7 +606,7 @@ str.aASCIICodes = {
*/
str.toASCIICode = function(b)
{
var s = str.aASCIICodes[b];
var s = (b != str.ASCII.CR && b != str.ASCII.LF? str.aASCIICodes[b] : null);
if (s) {
s = '<' + s + '>';
} else {