diff --git a/_includes/machine-engines.html b/_includes/machine-engines.html index f66f50474..919931ff1 100644 --- a/_includes/machine-engines.html +++ b/_includes/machine-engines.html @@ -1,5 +1,6 @@ {% comment %} -As documented in /modules/markout/lib/markout.js, the following machine properties are recognized in Front Matter: +As documented in /modules/markout/lib/markout.js, our Node web server recognizes the following machine properties +in the Front Matter of Markdown files, for compatibility with the Jekyll web server: 'id' (eg, "ibm5150") 'name' (eg, "IBM PC (Model 5150) with Monochrome Display") @@ -9,25 +10,24 @@ As documented in /modules/markout/lib/markout.js, the following machine properti 'uncompiled' (eg, true) 'parms' -and the following properties (along with any property not listed above) will be added to the 'parms' property: +And the following properties (along with any property not listed above) will be added to the 'parms' property: 'autopower' (eg, "true") 'automount' (eg, {"A":{"name":"OS/2 FOOTBALL Boot Disk (v7.68.17)","path":"/disks/pc/os2/misc/football/debugger/FOOTBALL-7.68.17.json"}}) 'state' (eg, "state.json") 'messages' (eg, "disk") -Of all the above properties, the following are purely cosmetic: - - 'name' (used by machine.html, not machine-engines.html) +And all our JavaScript components expect multi-word property names to use camelCase, so that conversion happens both +here and in markout.js. Examples include 'autopower' ('autoPower') and 'automount' ('autoMount'). {% endcomment %} {% for machine in page.machines %} {% capture machine_embed %}window.embed{{ machine.type | remove:'-dbg' | upcase }}{% endcapture %} - {% unless machine.autopower %} + {% if machine.autopower == nil %} {% assign machine_autopower = "true" %} {% else %} {% capture machine_autopower %}{{ machine.autopower }}{% endcapture %} - {% endunless %} + {% endif %} {% unless machine.config %} {% assign machine_config = "machine.xml" %} {% else %} diff --git a/devices/pc/machine/custom/README.md b/devices/pc/machine/custom/README.md index ee329ff2d..56483c2de 100644 --- a/devices/pc/machine/custom/README.md +++ b/devices/pc/machine/custom/README.md @@ -5,8 +5,7 @@ permalink: /devices/pc/machine/custom/ machines: - type: pc id: custom - autopower: true - config: /devices/pc/machine/5150/mda/64kb/machine.xml + autopower: false --- Build Your Own PC diff --git a/devices/pc/machine/custom/machine.xml b/devices/pc/machine/custom/machine.xml new file mode 100644 index 000000000..b0123db81 --- /dev/null +++ b/devices/pc/machine/custom/machine.xml @@ -0,0 +1,18 @@ + + + + IBM PC (Model 5150) with Monochrome Display + + + + + diff --git a/modules/markout/lib/markout.js b/modules/markout/lib/markout.js index 9c7cd06fe..bdcb975f7 100644 --- a/modules/markout/lib/markout.js +++ b/modules/markout/lib/markout.js @@ -309,9 +309,9 @@ MarkOut.aHTMLEntities = { }; /* - * This is a list of "reserved" Front Matter machine properties (ie, properties that will NOT be - * bundled as strings in the 'parms' property). Any machine property not in this list will be added - * to the 'parms' object as a string property. + * This is a list of "reserved" Front Matter machine properties (ie, properties that will NOT be bundled as + * strings in the 'parms' property). Any machine property not in this list will be added to the 'parms' object + * as a string property. * * 'id' (eg, "ibm5150") * 'name' (eg, "IBM PC (Model 5150) with Monochrome Display") @@ -329,6 +329,16 @@ MarkOut.aHTMLEntities = { * 'autopower' (eg, true) * * and any other string-based property you wish to pass through to PCjs (via the embedPC() sParms parameter). + * + * As for any other NON-string-based property you might want to pass through sParms, like 'autopower', add it to the + * aFMBooleanMachineProps table, and it will be unquoted (ie, true or false rather than "true" or "false"); also note + * that even though the only non-reserved, non-string properties we currently use are booleans, that table is not + * really limited to booleans (eg, they could just as well be numeric properties). + * + * The other purpose that aFMBooleanMachineProps serves is to remap any lower-case Front Matter keywords to their + * camelCase equivalents; although in hindsight it was probably a stupid decision, all our machine definition properties + * (whether as attributes in a XML file or as Front Matter keywords at the top of a Markdown file) are purely lower-case, + * which are then converted to camelCase prior to calling the JavaScript components. */ MarkOut.aFMBooleanMachineProps = { 'autopower': "autoPower" diff --git a/modules/pcjs/lib/computer.js b/modules/pcjs/lib/computer.js index 497d977da..edb8bf19f 100644 --- a/modules/pcjs/lib/computer.js +++ b/modules/pcjs/lib/computer.js @@ -713,7 +713,7 @@ Computer.prototype.donePowerOn = function(aParms) this.aFlags.fPowered = true; var controlPower = this.bindings["power"]; - if (controlPower) controlPower.textContent = "On"; + if (controlPower) controlPower.textContent = "Shutdown"; if (!this.fInitialized) { this.println(Computer.APPNAME + " v" + Computer.APPVERSION + "\n" + Computer.COPYRIGHT + "\n" + Computer.LICENSE); @@ -923,7 +923,7 @@ Computer.prototype.powerOff = function(fSave, fShutdown) if (fShutdown) { this.aFlags.fPowered = false; var controlPower = this.bindings["power"]; - if (controlPower) controlPower.textContent = "Off"; + if (controlPower) controlPower.textContent = "Power"; } this.nPowerChange = 0;