Some minor Debugger tweaks and other improvements
If a Markdown document contains an embedded machine that specifies a version number (eg, "1.15.6"), then the web server will switch to serving a compiled version, since that's the only way it can guarantee the requested version
This commit is contained in:
parent
c3e7320598
commit
905a30017e
9 changed files with 911 additions and 889 deletions
|
|
@ -19,5 +19,4 @@
|
||||||
<chipset id="chipset" model="5170" floppies="[1440,1200]"/>
|
<chipset id="chipset" model="5170" floppies="[1440,1200]"/>
|
||||||
<serial id="com1" adapter="1" binding="print"/>
|
<serial id="com1" adapter="1" binding="print"/>
|
||||||
<serial id="com2" adapter="2"/>
|
<serial id="com2" adapter="2"/>
|
||||||
<mouse serial="com2"/>
|
|
||||||
</machine>
|
</machine>
|
||||||
|
|
|
||||||
|
|
@ -1747,12 +1747,20 @@ HTMLOut.prototype.processMachines = function(aMachines, done)
|
||||||
HTMLOut.logDebug('HTMLOut.processMachines(' + JSON.stringify(infoMachine) + ')');
|
HTMLOut.logDebug('HTMLOut.processMachines(' + JSON.stringify(infoMachine) + ')');
|
||||||
|
|
||||||
var sClass = infoMachine['class']; // aka the machine class
|
var sClass = infoMachine['class']; // aka the machine class
|
||||||
|
|
||||||
var sVersion = infoMachine['version'];
|
var sVersion = infoMachine['version'];
|
||||||
if (sVersion === undefined) sVersion = "*"; // default to newest version
|
if (sVersion === undefined) sVersion = "*"; // default to newest version
|
||||||
|
|
||||||
var fDebugger = infoMachine['debugger'];
|
var fDebugger = infoMachine['debugger'];
|
||||||
if (fDebugger === undefined) fDebugger = false; // default to no debugger
|
if (fDebugger === undefined) fDebugger = false; // default to no debugger
|
||||||
|
|
||||||
var fCompiled = infoMachine['compiled'];
|
var fCompiled = infoMachine['compiled'];
|
||||||
if (fCompiled === undefined) fCompiled = !this.fDebug;
|
if (fCompiled === undefined) fCompiled = !this.fDebug;
|
||||||
|
if (sVersion == "*") {
|
||||||
|
sVersion = pkg.version;
|
||||||
|
} else {
|
||||||
|
fCompiled = true; // use of a specific version requires using the compiled version
|
||||||
|
}
|
||||||
var fNoDebug = !fCompiled && net.hasParm(net.GORT_COMMAND, net.GORT_NODEBUG, this.req);
|
var fNoDebug = !fCompiled && net.hasParm(net.GORT_COMMAND, net.GORT_NODEBUG, this.req);
|
||||||
|
|
||||||
var sScriptEmbed = "";
|
var sScriptEmbed = "";
|
||||||
|
|
@ -1764,8 +1772,8 @@ HTMLOut.prototype.processMachines = function(aMachines, done)
|
||||||
if (fCompiled) {
|
if (fCompiled) {
|
||||||
var sScriptFolder = sClass + "js"; // aka the app class
|
var sScriptFolder = sClass + "js"; // aka the app class
|
||||||
var sScriptFile = sClass + (fDebugger? "-dbg" : "") + ".js";
|
var sScriptFile = sClass + (fDebugger? "-dbg" : "") + ".js";
|
||||||
asFiles.push("/versions/" + sScriptFolder + "/" + pkg.version + "/components.css");
|
asFiles.push("/versions/" + sScriptFolder + "/" + sVersion + "/components.css");
|
||||||
asFiles.push("/versions/" + sScriptFolder + "/" + pkg.version + "/" + sScriptFile);
|
asFiles.push("/versions/" + sScriptFolder + "/" + sVersion + "/" + sScriptFile);
|
||||||
this.addFilesToHTML(asFiles, sScriptEmbed);
|
this.addFilesToHTML(asFiles, sScriptEmbed);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -1124,7 +1124,7 @@ Computer.prototype.onReset = function()
|
||||||
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
|
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
|
||||||
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
|
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
|
||||||
*/
|
*/
|
||||||
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ !web.confirmUser("Click OK to save the " + Computer.sAppName + " machine state.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
|
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ web.confirmUser("Click OK to save changes to this " + Computer.sAppName + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
|
||||||
this.powerOff(fSave, true);
|
this.powerOff(fSave, true);
|
||||||
/*
|
/*
|
||||||
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
|
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ if (DEBUGGER) {
|
||||||
'?': "help",
|
'?': "help",
|
||||||
'a [#]': "assemble",
|
'a [#]': "assemble",
|
||||||
'b [#]': "breakpoint",
|
'b [#]': "breakpoint",
|
||||||
'c': "clear window",
|
'c': "clear output",
|
||||||
'd [#]': "dump memory",
|
'd [#]': "dump memory",
|
||||||
'e [#]': "edit memory",
|
'e [#]': "edit memory",
|
||||||
'f': "frequencies",
|
'f': "frequencies",
|
||||||
|
|
@ -216,7 +216,9 @@ if (DEBUGGER) {
|
||||||
'r': "dump/edit registers",
|
'r': "dump/edit registers",
|
||||||
't [#]': "step instruction(s)",
|
't [#]': "step instruction(s)",
|
||||||
'u [#]': "unassemble",
|
'u [#]': "unassemble",
|
||||||
'x': "execution options"
|
'x': "execution options",
|
||||||
|
'reset': "reset computer",
|
||||||
|
'ver': "display version"
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -4188,7 +4190,7 @@ if (DEBUGGER) {
|
||||||
fUnknown = false;
|
fUnknown = false;
|
||||||
switch(sReg){
|
switch(sReg){
|
||||||
case "MS":
|
case "MS":
|
||||||
X86Help.opHelpLMSW(w);
|
X86Help.opHelpLMSW.call(this.cpu, w);
|
||||||
break;
|
break;
|
||||||
case "TR":
|
case "TR":
|
||||||
this.cpu.segTSS.load(w);
|
this.cpu.segTSS.load(w);
|
||||||
|
|
@ -4530,6 +4532,9 @@ if (DEBUGGER) {
|
||||||
case "reset":
|
case "reset":
|
||||||
if (this.cmp) this.cmp.reset();
|
if (this.cmp) this.cmp.reset();
|
||||||
return true;
|
return true;
|
||||||
|
case "ver":
|
||||||
|
this.println((APPNAME || "PCjs") + " version " + APPVERSION + " (" + (COMPILED? "release" : (DEBUG? "debug" : "nodebug")) + (PREFETCH? ",prefetch" : "") + (TYPEDARRAYS? ",typedarrays" : (FATARRAYS? ",fatarrays" : "")) + ")");
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
ch0 = sCmd.charAt(0);
|
ch0 = sCmd.charAt(0);
|
||||||
for (i = 1; i < sCmd.length; i++) {
|
for (i = 1; i < sCmd.length; i++) {
|
||||||
|
|
|
||||||
|
|
@ -414,7 +414,13 @@ Disk.prototype.powerDown = function(fSave, fShutdown)
|
||||||
if (fShutdown) {
|
if (fShutdown) {
|
||||||
this.disconnectRemoteDisk();
|
this.disconnectRemoteDisk();
|
||||||
}
|
}
|
||||||
if (!nErrorCode) this.controller.notice(this.sDiskName + " saved");
|
/*
|
||||||
|
* I only report that changes to the disk have been "saved" if fSave is true, to avoid confusing
|
||||||
|
* users who might not understand the difference between discarding local changes (which should restore
|
||||||
|
* all diskettes to their original state) and discarding remote changes (which could leave the remote disk
|
||||||
|
* in a bad state).
|
||||||
|
*/
|
||||||
|
if (!nErrorCode && fSave) this.controller.notice(this.sDiskName + " saved");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -40,12 +40,12 @@ var APPNAME = ""; // this @define is overridden by the Closure Com
|
||||||
/**
|
/**
|
||||||
* @define {string}
|
* @define {string}
|
||||||
*/
|
*/
|
||||||
var APPVERSION = "1.0.0"; // this @define is overridden by the Closure Compiler with the version in package.json
|
var APPVERSION = "1.x.x"; // this @define is overridden by the Closure Compiler with the version in package.json
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @define {string}
|
* @define {string}
|
||||||
*/
|
*/
|
||||||
var SITEHOST = "pcjs:8088"; // this @define is overridden by the Closure Compiler with "www.pcjs.org"
|
var SITEHOST = "localhost:8088";// this @define is overridden by the Closure Compiler with "www.pcjs.org"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @define {boolean}
|
* @define {boolean}
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ function embedMachine(sName, sVersion, idElement, sXMLFile, sXSLFile, sStateFile
|
||||||
/*
|
/*
|
||||||
* Our MarkOut module (in convertMDMachineLinks()) creates machine containers that look like:
|
* Our MarkOut module (in convertMDMachineLinks()) creates machine containers that look like:
|
||||||
*
|
*
|
||||||
* <div id="' + sMachineID + '" class="machine-placeholder"><p>Embedded PC</p><p class="machine-warning"></p></div>
|
* <div id="' + sMachineID + '" class="machine-placeholder"><p>Embedded PC</p><p class="machine-warning">...</p></div>
|
||||||
*
|
*
|
||||||
* with the "machine-warning" paragraph pre-populated with a warning message that the user will
|
* with the "machine-warning" paragraph pre-populated with a warning message that the user will
|
||||||
* see if nothing at all happens. But hopefully, in the normal case (and especially the error case),
|
* see if nothing at all happens. But hopefully, in the normal case (and especially the error case),
|
||||||
|
|
@ -321,7 +321,7 @@ function embedMachine(sName, sVersion, idElement, sXMLFile, sXSLFile, sStateFile
|
||||||
if (eMachine) {
|
if (eMachine) {
|
||||||
var sAppClass = sName.toLowerCase(); // eg, "pcjs" or "c1pjs"
|
var sAppClass = sName.toLowerCase(); // eg, "pcjs" or "c1pjs"
|
||||||
if (!sXSLFile) {
|
if (!sXSLFile) {
|
||||||
if (DEBUG && sVersion == "1.0.0") {
|
if (DEBUG && sVersion == "1.x.x") {
|
||||||
sXSLFile = "/my_modules/" + sAppClass + "-client/templates/components.xsl";
|
sXSLFile = "/my_modules/" + sAppClass + "-client/templates/components.xsl";
|
||||||
} else {
|
} else {
|
||||||
sXSLFile = "/versions/" + sAppClass + "/" + sVersion + "/components.xsl";
|
sXSLFile = "/versions/" + sAppClass + "/" + sVersion + "/components.xsl";
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue