From aa4cdca89e34173f491db43d335d3af00c66b29c Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Tue, 24 Jan 2017 15:37:46 -0800 Subject: [PATCH] Start on support for component scripts --- .../machine/1170/panel/debugger/xxdp/README.md | 13 ++++++++++--- modules/shared/lib/sticky.js | 14 +++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md b/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md index a296f0328..115bd5dc7 100644 --- a/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md +++ b/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md @@ -12,6 +12,12 @@ machines: RL0: path: http://archive.pcjs.org/disks/dec/rl02k/RL02K-XXDP.json sticky: top +commands: + bootXXDP: | + select rl11 listDrives RL0 + select rl11 listDisks "XXDP+ Diagnostics" + load rl11 + boot rl11 --- This machine is ready to boot [XXDP+ Diagnostics](/disks/dec/rl02k/xxdp/) ("BOOT RL0") and run @@ -27,9 +33,10 @@ Step-by-step instructions are included below. Other interesting things to know {% include machine.html id="test1170" %} -Step 1: We need to select a drive to load the XXDP+ Diagnostics disk, 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 could contain -up to four such drives, which we refer to as RL0 through RL3. +Step 1: 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. To select drive RL0, press {% include machine-command.html type='button' label='Select RL0' machine='test1170' component='RL11' command='selectDrive' value='RL0' %} +To boot the [RL02K XXDP+ Diagnostics Disk](/disks/dec/rl02k/xxdp/) in one step, press {% include machine-command.html type='button' label='Boot XXDP+' machine='test1170' component='RL11' command='bootXXDP' %} diff --git a/modules/shared/lib/sticky.js b/modules/shared/lib/sticky.js index d20ff0c86..3b8d3b41a 100644 --- a/modules/shared/lib/sticky.js +++ b/modules/shared/lib/sticky.js @@ -88,7 +88,7 @@ function addStickyMachine(idMachine, sPosition) } /** - * commandMachine(idMachine, sType, sCommand, sValue) + * commandMachine(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 @@ -98,19 +98,19 @@ function addStickyMachine(idMachine, sPosition) * * findMachineComponent() * - * which uses existing Component methods to find the requested component type for a specific machine, and if a + * which uses existing Component methods to find the requested component for a specific machine, and if the * 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 {string} idMachine - * @param {string} sType + * @param {string} sComponent * @param {string} sCommand * @param {string} [sValue] */ -function commandMachine(idMachine, sType, sCommand, sValue) +function commandMachine(idMachine, sComponent, sCommand, sValue) { if (window.findMachineComponent) { - var component = window.findMachineComponent(idMachine, sType); + var component = window.findMachineComponent(idMachine, sComponent); if (component) { var exports = component['exports']; if (exports) { @@ -118,14 +118,14 @@ function commandMachine(idMachine, sType, sCommand, sValue) if (fnCommand) { //noinspection JSUnresolvedFunction if (!fnCommand.call(component, sValue)) { - window.alert("Error calling " + idMachine + "." + sType + "." + sCommand + "(" + sValue + ")"); + window.alert("Error calling " + idMachine + "." + sComponent + "." + sCommand + "(" + sValue + ")"); } return; } } } } - console.log("unimplemented: commandMachine('" + idMachine + "','" + typeComponent + "','" + sCommand + "','" + sValue + "')"); + console.log("unimplemented: commandMachine('" + idMachine + "','" + sComponent + "','" + sCommand + "','" + sValue + "')"); } /**