Merge branch 'next-release'

This commit is contained in:
Jeff Parsons 2016-10-23 00:44:30 -07:00
commit 1a3ecb40f3
102 changed files with 11967 additions and 328 deletions

View file

@ -482,7 +482,7 @@ FileDump.prototype.dumpBuffer = function(sKey, buf, len, cbItem, offDump, nWidth
nWidthDump = nWidthDump || this.nWidthDump;
var sDump = "";
if (this.addrLoad) {
if (this.addrLoad != null) {
/*
* TODO: We need command-line overrides (eg, --load and --exec) to allow the user to specify the
* correct load (and exec) addresses. For now, we're simply inferring that the first address parsed

View file

@ -1435,7 +1435,7 @@ Computer.prototype.getMachineComponent = function(sType, componentPrev)
* the scroll feature has annoying effect on iOS, so we no longer do it by default (fScroll must be true).
*
* @this {Computer}
* @param {boolean} [fScroll]
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
*/
Computer.prototype.updateFocus = function(fScroll)
{
@ -1446,7 +1446,7 @@ Computer.prototype.updateFocus = function(fScroll)
* is to ensure that keyboard input is fielded properly.
*/
var x = 0, y = 0;
if (fScroll && window) {
if (!fScroll && window) {
x = window.scrollX;
y = window.scrollY;
}
@ -1454,7 +1454,7 @@ Computer.prototype.updateFocus = function(fScroll)
* TODO: We need a mechanism to determine the "active" display, instead of hard-coding this to aVideo[0].
*/
this.aVideo[0].setFocus();
if (fScroll && window) {
if (!fScroll && window) {
window.scrollTo(x, y);
}
}

View file

@ -1405,11 +1405,28 @@ ComputerPDP11.prototype.getMachineComponent = function(sType, componentPrev)
* where the display is more constrained, so we no longer do it by default (fScroll must be true).
*
* @this {ComputerPDP11}
* @param {boolean} [fScroll]
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
*/
ComputerPDP11.prototype.setFocus = function(fScroll)
{
if (this.controlPrint) this.controlPrint.focus();
if (this.controlPrint) {
/*
* This seems to be recommended work-around to prevent the browser from scrolling the focused element
* into view. The CPU is not a visual component, so when the CPU wants to set focus, the primary intent
* is to ensure that keyboard input is fielded properly.
*/
var x = 0, y = 0;
if (!fScroll && window) {
x = window.scrollX;
y = window.scrollY;
}
this.controlPrint.focus();
if (!fScroll && window) {
window.scrollTo(x, y);
}
}
};
/**

View file

@ -1130,8 +1130,8 @@ PDP11.opHALT = function(opCode)
* buffer is enabled, but that's more work.
*
* Because rewinding is not normal CPU behavior, attempting to Run again (or use the Debugger's
* "g" command) will cause an immediate HALT again; the work-around is simple: either set the PC to
* a new address (eg, "r pc=pc+2") or single-step the HALT instruction ("t").
* "g" command) would cause an immediate HALT again -- except that checkInstruction() checks for that
* precise condition, so if the CPU starts on a HALT, checkInstruction() will skip over it.
*/
this.dbg.stopInstruction();
}

View file

@ -141,7 +141,7 @@ CPUStatePDP11.prototype.initProcessor = function()
this.aTriggers = []; // list of all triggers, active or not (just for debugging)
}
this.flags.complete = this.flags.debugCheck = false;
this.flags.complete = false;
};
/**
@ -2084,24 +2084,23 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
* so stopCPU() would have no effect as far as the Debugger is concerned.
*/
this.flags.complete = true;
this.flags.debugCheck = (DEBUGGER && this.dbg && this.dbg.checksEnabled());
/*
* nDebugCheck is 1 if we want to "check" every instruction with the Debugger, and -1 if we only
* want to check the first instruction.
* nDebugCheck is 1 if we want the Debugger's checkInstruction() to check every instruction,
* -1 if we want it to check just the first instruction, and 0 if there's no need for any checks.
*/
var nDebugCheck = this.flags.debugCheck? 1 : -1;
var nDebugCheck = (DEBUGGER && this.dbg && this.dbg.checksEnabled())? 1 : (this.flags.starting? -1 : 0);
/*
* nDebugState is checked only when nDebugCheck is set, and its sole purpose is to tell the first call
* to checkInstruction() that it can skip breakpoint checks, and that will be true ONLY when fStarting is
* true OR nMinCycles is zero (the latter means the Debugger is single-stepping).
* nDebugState is needed only when nDebugCheck is non-zero; it is -1 if this is a single-step, 0 if
* this is the start of a new run, and 1 if this is a continuation of a previous run. It is used by
* checkInstruction() to determine if it should skip breakpoint checks and/or HALT instructions (ie,
* if nDebugState is <= zero).
*/
var nDebugState = (!nMinCycles)? -1 : (this.flags.starting? 0 : 1);
/*
* Once we snap fStarting, we clear it, because technically, we've moved beyond "starting" and have
* officially "started" now.
* We've moved beyond "starting" now and have officially "started".
*/
this.flags.starting = false;

View file

@ -572,13 +572,31 @@ if (DEBUGGER) {
};
/**
* setFocus()
* setFocus(fScroll)
*
* @this {DebuggerPDP11}
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
*/
DebuggerPDP11.prototype.setFocus = function()
DebuggerPDP11.prototype.setFocus = function(fScroll)
{
if (this.controlDebug) this.controlDebug.focus();
if (this.controlDebug) {
/*
* This seems to be recommended work-around to prevent the browser from scrolling the focused element
* into view. The CPU is not a visual component, so when the CPU wants to set focus, the primary intent
* is to ensure that keyboard input is fielded properly.
*/
var x = 0, y = 0;
if (!fScroll && window) {
x = window.scrollX;
y = window.scrollY;
}
this.controlDebug.focus();
if (!fScroll && window) {
window.scrollTo(x, y);
}
}
};
/**
@ -1617,16 +1635,19 @@ if (DEBUGGER) {
var cpu = this.cpu;
/*
* Purely as a convenience, we're going to skip over a HALT opcode if the machine is just starting,
* and pretend that the NEXT instruction is the first to be executed.
* Since opHalt() will rewind the PC on a HALT, purely for our debugging benefit, we must compensate
* for that here by skipping over the HALT if/when the machine starts up again.
*/
if (nState == 0) {
if (!nState) {
opCode = this.cpu.getWordDirect(addr);
if (opCode == PDP11.OPCODE.HALT) {
addr = this.cpu.advancePC(2);
}
}
/*
* If the CPU stopped on a breakpoint, we're not interested in stopping again if the machine is starting.
*/
if (nState > 0) {
if (this.nBreakInstructions) {
if (!--this.nBreakInstructions) return true;

View file

@ -249,6 +249,9 @@ RAMPDP11.prototype.reset = function()
/**
* loadImage(aBytes, addrLoad, addrExec, addrInit, fReset)
*
* If the array contains an image in the "Absolute Format," load it as specified by
* the format; otherwise, load it as-is using the address(es) supplied.
*
* @this {RAMPDP11}
* @param {Array|Uint8Array} aBytes
* @param {number|null} [addrLoad]
@ -261,14 +264,15 @@ RAMPDP11.prototype.loadImage = function(aBytes, addrLoad, addrExec, addrInit, fR
{
var fLoaded = false;
/*
* Data on tapes is organized into blocks; each block begins with a 6-byte header:
* Data on tapes in the "Absolute Format" is organized into blocks; each block begins with
* a 6-byte header:
*
* 2-byte signature (0x0001)
* 2-byte block length (N + 6, because it includes the 6-byte header)
* 2-byte load address
*
* followed by N data bytes. If N is zero, then the 2-byte load address is the exec address,
* unless the address is odd (usually 1). DEC's "Absolute Loader" jumps to the exec address
* unless the address is odd (usually 1). DEC's Absolute Loader jumps to the exec address
* in former case, halts in the latter.
*
* All values are stored "little endian" (low byte followed by high byte), just like the

View file

@ -38,7 +38,7 @@
</ul>
</div>
<div class="common-top-right">
<p>Powered by JavaScript and <a href="http://github.com/jeffpar/pcjs" target="_blank">GitHub</a></p>
<p>Powered by <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">JavaScript</a>, <a href="http://vanilla-js.com/" target="_blank">Vanilla JS</a>, and <a href="http://github.com/jeffpar/pcjs" target="_blank">GitHub</a></p>
</div>
</div>
<div class="common-middle">
@ -54,8 +54,8 @@
<p class="common-reference"><!-- Bottom-left-hand stuff, if there was any, would go here --></p>
<p class="common-copyright">
<!-- When using AWS, the pcjs.org domain must redirect to www.pcjs.org, so let's avoid unnecessary redirects in any absolute URLs -->
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> website © 2012-<!-- pcjs:year --> by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs Project</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-<!-- pcjs:year --> by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
</p>
</div>
</div>

View file

@ -40,7 +40,7 @@
</ul>
</div>
<div class="common-top-right">
<p>Powered by JavaScript and <a href="http://github.com/jeffpar/pcjs" target="_blank">GitHub</a></p>
<p>Powered by <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">JavaScript</a>, <a href="http://vanilla-js.com/" target="_blank">Vanilla JS</a>, and <a href="http://github.com/jeffpar/pcjs" target="_blank">GitHub</a></p>
</div>
</div>
</xsl:template>
@ -49,8 +49,8 @@
<div class="common-bottom">
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> website © 2012-2016 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs Project</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-2016 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
</p>
</div>
</xsl:template>