diff --git a/README.md b/README.md index ca1126540..4e83502ba 100644 --- a/README.md +++ b/README.md @@ -388,6 +388,12 @@ specified page; e.g.: http://localhost:8088/?aspect=2.0 +- *resume*: set it to a numeric value (0-3) to override a machine's *resume* setting; e.g.: + + http://localhost:8088/?resume=0 + +More information about the *resume* attribute is available in the [documentation](/docs/pcx86/computer/#attributes). + Updating PCjs --- diff --git a/_posts/2014-09-30-pcjs-coding-conventions.md b/_posts/2014-09-30-pcjs-coding-conventions.md index 445e5c654..0317ecf4c 100644 --- a/_posts/2014-09-30-pcjs-coding-conventions.md +++ b/_posts/2014-09-30-pcjs-coding-conventions.md @@ -81,10 +81,10 @@ However, I've gradually switched to the more conventional JavaScript object nota ``` javascript ChipSet.PIC_LO = { - OCW2_EOI: 0x20, // non-specific EOI (end-of-interrupt) - OCW2_EOI_SPEC: 0x60, // specific EOI - OCW2_EOI_ROT: 0xA0, // rotate on non-specific EOI - OCW2_EOI_ROTSPEC: 0xE0 // rotate on specific EOI + OCW2_EOI: 0x20, // non-specific EOI (end-of-interrupt) + OCW2_EOI_SPEC: 0x60, // specific EOI + OCW2_EOI_ROT: 0xA0, // rotate on non-specific EOI + OCW2_EOI_ROTSPEC: 0xE0 // rotate on specific EOI }; ``` @@ -104,7 +104,7 @@ To ensure that debug-only code is not simply *disabled* but also *removed*, the ``` javascript if (DEBUG) { - [code to be removed by the Closure Compiler] + [code to be removed by the Closure Compiler] } ``` diff --git a/devices/pdp11/machine/1170/panel/debugger/README.md b/devices/pdp11/machine/1170/panel/debugger/README.md index 256f8066a..fd36680e3 100644 --- a/devices/pdp11/machine/1170/panel/debugger/README.md +++ b/devices/pdp11/machine/1170/panel/debugger/README.md @@ -6,6 +6,7 @@ machines: - id: test1170 type: pdp11 debugger: true + sticky: top --- {% include machine.html id="test1170" %} @@ -46,8 +47,62 @@ Debugger commands described below to load and execute these "toggle-ins". Load Address 300 Exam Display = 070707 ... Relocation works -With the PDPjs Debugger, the above "toggle-in" is easily entered with the following commands (the semicolons are optional; -they just make it easier to paste an entire set of commands into the Debugger at once): +Step 1: Load ADDR register with 200: +{% include machine-command.html type='clickOnce' label='LOAD 200' machine='test1170' command='script' value='set Panel SR 200;toggle Panel LOAD' %} + +Step 2: Deposit 012737 at ADDR 200: +{% include machine-command.html type='clickOnce' label='DEPOSIT 012737' machine='test1170' command='script' value='set Panel SR 012737;toggle Panel DEP' %} + +Step 3: Deposit 000400 at ADDR 202: +{% include machine-command.html type='clickOnce' label='DEPOSIT 000400' machine='test1170' command='script' value='set Panel SR 000400;toggle Panel DEP' %} + +Step 4: Deposit 177572 at ADDR 204: +{% include machine-command.html type='clickOnce' label='DEPOSIT 177572' machine='test1170' command='script' value='set Panel SR 177572;toggle Panel DEP' %} + +Step 5: Deposit 012737 at ADDR 206: +{% include machine-command.html type='clickOnce' label='DEPOSIT 012737' machine='test1170' command='script' value='set Panel SR 012737;toggle Panel DEP' %} + +Step 6: Deposit 070707 at ADDR 210: +{% include machine-command.html type='clickOnce' label='DEPOSIT 070707' machine='test1170' command='script' value='set Panel SR 070707;toggle Panel DEP' %} + +Step 7: Deposit 000200 at ADDR 212: +{% include machine-command.html type='clickOnce' label='DEPOSIT 000200' machine='test1170' command='script' value='set Panel SR 000200;toggle Panel DEP' %} + +Step 8: Deposit 000000 at ADDR 214: +{% include machine-command.html type='clickOnce' label='DEPOSIT 000000' machine='test1170' command='script' value='set Panel SR 000000;toggle Panel DEP' %} + +Step 9: Load ADDR register with 300: +{% include machine-command.html type='clickOnce' label='LOAD 300' machine='test1170' command='script' value='set Panel SR 300;toggle Panel LOAD' %} + +Step 10: Deposit 300 at ADDR 300: +{% include machine-command.html type='clickOnce' label='DEPOSIT 300' machine='test1170' command='script' value='toggle Panel DEP' %} + +Step 11: Load ADDR register with 17772300: +{% include machine-command.html type='clickOnce' label='LOAD 17772300' machine='test1170' command='script' value='set Panel SR 17772300;toggle Panel LOAD' %} + +Step 12: Deposit 077406 at ADDR 17772300: +{% include machine-command.html type='clickOnce' label='DEPOSIT 077406' machine='test1170' command='script' value='set Panel SR 077406;toggle Panel DEP' %} + +Step 13: Load ADDR register with 17772340: +{% include machine-command.html type='clickOnce' label='LOAD 17772340' machine='test1170' command='script' value='set Panel SR 17772340;toggle Panel LOAD' %} + +Step 14: Deposit 000001 at ADDR 17772340: +{% include machine-command.html type='clickOnce' label='DEPOSIT 000001' machine='test1170' command='script' value='set Panel SR 000001;toggle Panel DEP' %} + +Step 15: Load ADDR register with 200: +{% include machine-command.html type='clickOnce' label='LOAD 200' machine='test1170' command='script' value='set Panel SR 200;toggle Panel LOAD' %} + +Step 16: Set ENABLE and toggle START: +{% include machine-command.html type='clickOnce' label='START' machine='test1170' command='script' value='set Panel ENABLE 1; toggle Panel START' %} + +Step 17: Load ADDR register with 300: +{% include machine-command.html type='clickOnce' label='LOAD 300' machine='test1170' command='script' value='set Panel SR 300;toggle Panel LOAD' %} + +Step 18: Examine ADDR 300: +{% include machine-command.html type='clickOnce' label='EXAM' machine='test1170' command='script' value='toggle Panel EXAM' %} + +Alternatively, with the PDPjs Debugger, the above "toggle-in" is easily entered with the following commands (the +semicolons are optional; they just make it easier to paste an entire set of commands into the Debugger at once): e 200 012737 000400 177572 012737 070707 000200 000000; e 300 000300; diff --git a/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md b/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md index 1bb90c479..bb225b9a4 100644 --- a/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md +++ b/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md @@ -46,7 +46,8 @@ This machine is ready to boot [XXDP+ Diagnostics](/disks/dec/rl02k/xxdp/) ("BOOT We need to select a drive to load the [RL02K XXDP+ Diagnostics Disk](/disks/dec/rl02k/xxdp/), and since it is an RL02K disk, we need to use an RL02 drive. A typical PDP-11 machine with a single [RL11 Disk Controller](/devices/pdp11/rl11/) -could contain up to four such drives, which we refer to as RL0 through RL3. +could contain up to four such drives, which we refer to as RL0 through RL3. And since we want to boot the XXDP +disk, we need to select drive RL0, since the boot code on the disk appears to assume drive 0. To automatically boot the [RL02K XXDP+ Diagnostics Disk](/disks/dec/rl02k/xxdp/) and run the **EKBAD0** diagnostic, press: {% include machine-command.html type='button' label='Run EKBAD0' machine='test1170' command='runEKBAD0' %} diff --git a/disks/dec/rl02k/xxdp/README.md b/disks/dec/rl02k/xxdp/README.md index efe419b28..3e248a987 100644 --- a/disks/dec/rl02k/xxdp/README.md +++ b/disks/dec/rl02k/xxdp/README.md @@ -34,7 +34,8 @@ At the prompt, type "BOOT RL0". The following text should appear: . -NOTE: Any RL11 disk drive (RL0-RL3) can be used. RL0 was selected for demonstration purposes. +NOTE: In theory, any RL11 disk drive (RL0-RL3) could be used. However, the boot code on the disk appears to assume +drive 0, so RL0 should be selected. PDPjs has been tested with the following diagnostics: diff --git a/docs/pcx86/examples/pcx86-dbg.js b/docs/pcx86/examples/pcx86-dbg.js index 2e9a20964..64a66541b 100644 --- a/docs/pcx86/examples/pcx86-dbg.js +++ b/docs/pcx86/examples/pcx86-dbg.js @@ -68,7 +68,7 @@ function eb(a,b,c){gb[a]&&b&&(gb[a][b]=c)}function Wa(a){window&&window.alert(a) function lb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d= 0) { fnCallReady = function processNextCommand(iNextCommand) { @@ -731,26 +749,26 @@ class Component { }(iCommand + 1); } - var fnScript = Component.globalCommands[sCommand]; - if (fnScript) { + var fnCommand = Component.globalCommands[sCommand]; + if (fnCommand) { if (!fnCallReady) { - fSuccess = fnScript(aTokens[1], aTokens[2], aTokens[3]); + fSuccess = fnCommand(aTokens[1], aTokens[2], aTokens[3]); } else { - if (!fnScript(fnCallReady, aTokens[1], aTokens[2], aTokens[3])) break; + if (!fnCommand(fnCallReady, aTokens[1], aTokens[2], aTokens[3])) break; } } else { fSuccess = false; var component = Component.getComponentByType(aTokens[1], idMachine); if (component) { - fnScript = Component.componentCommands[sCommand]; - if (fnScript) { - fSuccess = fnScript(component, aTokens[2], aTokens[3]); + fnCommand = Component.componentCommands[sCommand]; + if (fnCommand) { + fSuccess = fnCommand(component, aTokens[2], aTokens[3]); } else { var exports = component['exports']; if (exports) { - var fnCommand = exports[sCommand]; + fnCommand = exports[sCommand]; if (fnCommand) { fSuccess = true; if (!fnCallReady) { @@ -765,7 +783,7 @@ class Component { } if (!fSuccess) { - Component.alertUser("Script error (" + sCommand + ")"); + Component.alertUser("Script error: " + sCommand + (fnCommand? " failed" : " unrecognized")); break; } diff --git a/modules/shared/lib/sticky.js b/modules/shared/lib/sticky.js index afc0da659..4ac914747 100644 --- a/modules/shared/lib/sticky.js +++ b/modules/shared/lib/sticky.js @@ -88,7 +88,7 @@ function addStickyMachine(idMachine, sPosition) } /** - * commandMachine(idMachine, sComponent, sCommand, sValue) + * commandMachine(control, fSingle, idMachine, sComponent, sCommand, sValue) * * Note that this script is not compiled into any of the machines, since "sticky machines" are feature of the PCjs * website rather than of the machines. And since the machines are compiled, all their code and data is completely @@ -103,14 +103,19 @@ function addStickyMachine(idMachine, sPosition) * component is found, then its 'exports' table is checked for an entry matching the specified command string, and if * an entry is found, then the corresponding function is called with the specified data. * + * @param {Object} control + * @param {boolean} fSingle * @param {string} idMachine * @param {string} sComponent * @param {string} sCommand * @param {string} [sValue] * @return {boolean} */ -function commandMachine(idMachine, sComponent, sCommand, sValue) +function commandMachine(control, fSingle, idMachine, sComponent, sCommand, sValue) { + if (fSingle) { + control.disabled = true; + } if (sCommand == "script" && window.processMachineScript) { return window.processMachineScript(idMachine, sComponent, sValue); }