diff --git a/modules/c1pjs/lib/computer.js b/modules/c1pjs/lib/computer.js index 8f1c93594..60b29dcc4 100644 --- a/modules/c1pjs/lib/computer.js +++ b/modules/c1pjs/lib/computer.js @@ -248,14 +248,12 @@ C1PComputer.power = function(computer) }; /* - * C1PComputer.init() + * C1PComputer.init() * - * This function operates on every element (e) of class "computer", and initializes - * all the necessary HTML to construct the C1PComputer(s) as spec'ed. - * - * Note that each element (e) of class "computer" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the C1PComputer constructor - * expects. + * This function operates on every HTML element of class "computer", extracting the + * JSON-encoded parameters for the C1PComputer constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PComputer component, and then binding + * any associated HTML controls to the new component. */ C1PComputer.init = function() { diff --git a/modules/c1pjs/lib/cpu.js b/modules/c1pjs/lib/cpu.js index 0a14355ef..4bc5c1617 100644 --- a/modules/c1pjs/lib/cpu.js +++ b/modules/c1pjs/lib/cpu.js @@ -3862,14 +3862,12 @@ C1PCPU.prototype.opUndefined = function() }; /** - * C1PCPU.init() + * C1PCPU.init() * - * This function operates on every element (e) of class "cpu", and initializes - * all the necessary HTML to construct the CPU module(s) as spec'ed. - * - * Note that each element (e) of class "cpu" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the CPU constructor - * expects. + * This function operates on every HTML element of class "cpu", extracting the + * JSON-encoded parameters for the C1PCPU constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PCPU component, and then binding + * any associated HTML controls to the new component. */ C1PCPU.init = function() { diff --git a/modules/c1pjs/lib/debugger.js b/modules/c1pjs/lib/debugger.js index bf9c2f0eb..73a5ad366 100644 --- a/modules/c1pjs/lib/debugger.js +++ b/modules/c1pjs/lib/debugger.js @@ -2185,12 +2185,10 @@ if (DEBUGGER) { /** * C1PDebugger.init() * - * This function operates on every element (e) of class "debugger", and initializes - * all the necessary HTML to construct the Debugger module(s) as spec'ed. - * - * Note that each element (e) of class "debugger" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Debugger constructor - * expects. + * This function operates on every HTML element of class "debugger", extracting the + * JSON-encoded parameters for the C1PDebugger constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PDebugger component, and then binding + * any associated HTML controls to the new component. */ C1PDebugger.init = function() { diff --git a/modules/c1pjs/lib/disk.js b/modules/c1pjs/lib/disk.js index 48f9f4e1b..c78c48fc1 100644 --- a/modules/c1pjs/lib/disk.js +++ b/modules/c1pjs/lib/disk.js @@ -1240,12 +1240,10 @@ C1PDiskController.prototype.writePort = function(port, reg) /** * C1PDiskController.init() * - * This function operates on every element (e) of class "disk", and initializes - * all the necessary HTML to construct the DiskController module(s) as spec'ed. - * - * Note that each element (e) of class "disk" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the DiskController - * constructor expects. + * This function operates on every HTML element of class "disk", extracting the + * JSON-encoded parameters for the C1PDiskController constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PDiskController component, and then binding + * any associated HTML controls to the new component. */ C1PDiskController.init = function() { diff --git a/modules/c1pjs/lib/keyboard.js b/modules/c1pjs/lib/keyboard.js index f74e7d0f6..1c53681a4 100644 --- a/modules/c1pjs/lib/keyboard.js +++ b/modules/c1pjs/lib/keyboard.js @@ -1079,12 +1079,10 @@ C1PKeyboard.prototype.updateMemory = function(fPropagate, addr, bWrite) /** * C1PKeyboard.init() * - * This function operates on every element (e) of class "keyboard", and initializes - * all the necessary HTML to construct the Keyboard module(s) as spec'ed. - * - * Note that each element (e) of class "keyboard" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Keyboard constructor - * expects. + * This function operates on every HTML element of class "keyboard", extracting the + * JSON-encoded parameters for the C1PKeyboard constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PKeyboard component, and then binding + * any associated HTML controls to the new component. */ C1PKeyboard.init = function() { diff --git a/modules/c1pjs/lib/panel.js b/modules/c1pjs/lib/panel.js index 8e15a0791..1f8d876c8 100644 --- a/modules/c1pjs/lib/panel.js +++ b/modules/c1pjs/lib/panel.js @@ -89,21 +89,19 @@ C1PPanel.prototype.setPower = function(fOn, cmp) /** * C1PPanel.init() * - * This function operates on every element (e) of class "panel", and initializes - * all the necessary HTML to construct the Panel module(s) as spec'ed. - * - * Note that each element (e) of class "panel" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Panel constructor - * expects. + * This function operates on every HTML element of class "panel", extracting the + * JSON-encoded parameters for the C1PPanel constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PPanel component, and then binding + * any associated HTML controls to the new component. * * NOTE: Unlike most other component init() functions, this one is designed to be * called multiple times: once at load time, so that we can binding our print() - * function to the panel's output control ASAP, and again when the Computer component + * function to the panel's output control ASAP, and again when the C1PComputer component * is verifying that all components are ready and invoking their setPower() functions. * * Our setPower() method gives us a second opportunity to notify any components that - * that might care (eg, CPU, Keyboard, and Debugger) that we have some controls they - * might want to use. + * that might care (eg, C1PCPU, C1PKeyboard, and C1PDebugger) that we have some controls + * they might want to use. */ C1PPanel.init = function() { diff --git a/modules/c1pjs/lib/ram.js b/modules/c1pjs/lib/ram.js index d3886e0ad..dc30e8e26 100644 --- a/modules/c1pjs/lib/ram.js +++ b/modules/c1pjs/lib/ram.js @@ -71,12 +71,10 @@ C1PRAM.prototype.setBuffer = function(abMemory, start, end, cpu) /** * C1PRAM.init() * - * This function operates on every element (e) of class "ram", and initializes - * all the necessary HTML to construct the RAM module(s) as spec'ed. - * - * Note that each element (e) of class "ram" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the RAM constructor - * expects. + * This function operates on every HTML element of class "ram", extracting the + * JSON-encoded parameters for the C1PRAM constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PRAM component, and then binding + * any associated HTML controls to the new component. */ C1PRAM.init = function() { diff --git a/modules/c1pjs/lib/rom.js b/modules/c1pjs/lib/rom.js index 7d3d57379..e736373e0 100644 --- a/modules/c1pjs/lib/rom.js +++ b/modules/c1pjs/lib/rom.js @@ -214,12 +214,10 @@ C1PROM.prototype.copyImage = function() /** * C1PROM.init() * - * This function operates on every element (e) of class "rom", and initializes - * all the necessary HTML to construct the ROM module(s) as spec'ed. - * - * Note that each element (e) of class "rom" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the ROM constructor - * expects. + * This function operates on every HTML element of class "rom", extracting the + * JSON-encoded parameters for the C1PROM constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PROM component, and then binding + * any associated HTML controls to the new component. */ C1PROM.init = function() { diff --git a/modules/c1pjs/lib/serial.js b/modules/c1pjs/lib/serial.js index 1ddd83819..863ffe1fd 100644 --- a/modules/c1pjs/lib/serial.js +++ b/modules/c1pjs/lib/serial.js @@ -377,12 +377,10 @@ C1PSerialPort.prototype.updateMemory = function() /** * C1PSerialPort.init() * - * This function operates on every element (e) of class "serial", and initializes - * all the necessary HTML to construct the SerialPort module(s) as spec'ed. - * - * Note that each element (e) of class "serial" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the SerialPort constructor - * expects. + * This function operates on every HTML element of class "serial", extracting the + * JSON-encoded parameters for the C1PSerialPort constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PSerialPort component, and then binding + * any associated HTML controls to the new component. */ C1PSerialPort.init = function() { diff --git a/modules/c1pjs/lib/video.js b/modules/c1pjs/lib/video.js index 72287ac41..6e97126c9 100644 --- a/modules/c1pjs/lib/video.js +++ b/modules/c1pjs/lib/video.js @@ -512,12 +512,10 @@ C1PVideo.prototype.updateWindow = function(col, row, b) /** * C1PVideo.init() * - * This function operates on every element (e) of class "video", and initializes - * all the necessary HTML to construct every Video module as spec'ed. - * - * Note that each element (e) of class "video" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Video constructor - * expects. + * This function operates on every HTML element of class "video", extracting the + * JSON-encoded parameters for the C1PVideo constructor from the element's "data-value" + * attribute, invoking the constructor to create a C1PVideo component, and then binding + * any associated HTML controls to the new component. */ C1PVideo.init = function() { diff --git a/modules/pcjs/lib/chipset.js b/modules/pcjs/lib/chipset.js index 14ab1b48e..5a122006d 100644 --- a/modules/pcjs/lib/chipset.js +++ b/modules/pcjs/lib/chipset.js @@ -4996,14 +4996,12 @@ ChipSet.aPortOutput5170 = { }; /** - * ChipSet.init() + * ChipSet.init() * - * This function operates on every element (e) of class "chipset", and initializes - * all the necessary HTML to construct the ChipSet module(s) as spec'ed. - * - * Note that each element (e) of class "chipset" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the ChipSet constructor - * expects. + * This function operates on every HTML element of class "chipset", extracting the + * JSON-encoded parameters for the ChipSet constructor from the element's "data-value" + * attribute, invoking the constructor to create a ChipSet component, and then binding + * any associated HTML controls to the new component. */ ChipSet.init = function() { diff --git a/modules/pcjs/lib/computer.js b/modules/pcjs/lib/computer.js index 8b3b46f5c..224a6c2d3 100644 --- a/modules/pcjs/lib/computer.js +++ b/modules/pcjs/lib/computer.js @@ -1189,12 +1189,10 @@ Computer.prototype.getComponentByType = function(sType, componentPrev) /** * Computer.init() * - * This function operates on every element (e) of class "computer", and initializes - * all the necessary HTML to construct the Computer(s) as spec'ed. - * - * Note that each element (e) of class "computer" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Computer constructor - * expects. + * For every machine represented by an HTML element of class "pcjs-machine", this function + * locates the HTML element of class "computer", extracting the JSON-encoded parameters for the + * Computer constructor from the element's "data-value" attribute, invoking the constructor to + * create a Computer component, and then binding any associated HTML controls to the new component. */ Computer.init = function() { @@ -1240,6 +1238,12 @@ Computer.init = function() /** * Computer.show() + * + * When exit() is using an "onbeforeunload" handler, this "onpageshow" handler allows us to repower everything, + * without either resetting or restoring. We call powerOn() with a special resume value (RESUME_REPOWER) if the + * computer is already marked as "ready", meaning the browser didn't change anything. This "repower" process + * should be very quick, essentially just marking all components as powered again (so that, for example, the Video + * component will start drawing again) and firing the CPU up again. */ Computer.show = function() { diff --git a/modules/pcjs/lib/debugger.js b/modules/pcjs/lib/debugger.js index b456a2d68..414668fd4 100644 --- a/modules/pcjs/lib/debugger.js +++ b/modules/pcjs/lib/debugger.js @@ -4839,12 +4839,10 @@ if (DEBUGGER) { /** * Debugger.init() * - * This function operates on every element (e) of class "debugger", and initializes - * all the necessary HTML to construct the Debugger module(s) as spec'ed. - * - * Note that each element (e) of class "debugger" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Debugger constructor - * expects. + * This function operates on every HTML element of class "debugger", extracting the + * JSON-encoded parameters for the Debugger constructor from the element's "data-value" + * attribute, invoking the constructor to create a Debugger component, and then binding + * any associated HTML controls to the new component. */ Debugger.init = function() { diff --git a/modules/pcjs/lib/fdc.js b/modules/pcjs/lib/fdc.js index fd5033af6..94ebf856d 100644 --- a/modules/pcjs/lib/fdc.js +++ b/modules/pcjs/lib/fdc.js @@ -2469,11 +2469,10 @@ FDC.aPortOutput = { /** * FDC.init() * - * This function operates on every element (e) of class "fdc", and initializes - * all the necessary HTML to construct the FDC module(s) as spec'ed. - * - * Note that each element (e) of class "fdc" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the FDC constructor expects. + * This function operates on every HTML element of class "fdc", extracting the + * JSON-encoded parameters for the FDC constructor from the element's "data-value" + * attribute, invoking the constructor to create a FDC component, and then binding + * any associated HTML controls to the new component. */ FDC.init = function() { var aeFDC = Component.getElementsByClass(window.document, PCJSCLASS, "fdc"); diff --git a/modules/pcjs/lib/hdc.js b/modules/pcjs/lib/hdc.js index fed56374a..81f9b0e48 100644 --- a/modules/pcjs/lib/hdc.js +++ b/modules/pcjs/lib/hdc.js @@ -2815,11 +2815,10 @@ HDC.aATCPortOutput = { /** * HDC.init() * - * This function operates on every element (e) of class "hdc", and initializes - * all the necessary HTML to construct the HDC module(s) as spec'ed. - * - * Note that each element (e) of class "hdc" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the HDC constructor expects. + * This function operates on every HTML element of class "hdc", extracting the + * JSON-encoded parameters for the HDC constructor from the element's "data-value" + * attribute, invoking the constructor to create a HDC component, and then binding + * any associated HTML controls to the new component. */ HDC.init = function() { diff --git a/modules/pcjs/lib/keyboard.js b/modules/pcjs/lib/keyboard.js index 1739bbeb3..d9b748436 100644 --- a/modules/pcjs/lib/keyboard.js +++ b/modules/pcjs/lib/keyboard.js @@ -2177,12 +2177,10 @@ Keyboard.prototype.keySimulate = function(simCode, fDown) /** * Keyboard.init() * - * This function operates on every element (e) of class "keyboard", and initializes - * all the necessary HTML to construct the Keyboard module(s) as spec'ed. - * - * Note that each element (e) of class "keyboard" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Keyboard constructor - * expects. + * This function operates on every HTML element of class "keyboard", extracting the + * JSON-encoded parameters for the Keyboard constructor from the element's "data-value" + * attribute, invoking the constructor to create a Keyboard component, and then binding + * any associated HTML controls to the new component. */ Keyboard.init = function() { diff --git a/modules/pcjs/lib/mouse.js b/modules/pcjs/lib/mouse.js index 827182af0..8cdd75577 100644 --- a/modules/pcjs/lib/mouse.js +++ b/modules/pcjs/lib/mouse.js @@ -635,12 +635,10 @@ Mouse.prototype.notifyMCR = function(bMCR) /** * Mouse.init() * - * This function operates on every element (e) of class "mouse", and initializes - * all the necessary HTML to construct the Mouse module(s) as spec'ed. - * - * Note that each element (e) of class "mouse" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Mouse constructor - * expects. + * This function operates on every HTML element of class "mouse", extracting the + * JSON-encoded parameters for the Mouse constructor from the element's "data-value" + * attribute, invoking the constructor to create a Mouse component, and then binding + * any associated HTML controls to the new component. */ Mouse.init = function() { diff --git a/modules/pcjs/lib/panel.js b/modules/pcjs/lib/panel.js index e38432b85..4317b546a 100644 --- a/modules/pcjs/lib/panel.js +++ b/modules/pcjs/lib/panel.js @@ -125,12 +125,10 @@ Panel.prototype.powerDown = function(fSave) /** * Panel.init() * - * This function operates on every element (e) of class "panel", and initializes - * all the necessary HTML to construct the Panel module(s) as spec'ed. - * - * Note that each element (e) of class "panel" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Panel constructor - * expects. + * This function operates on every HTML element of class "panel", extracting the + * JSON-encoded parameters for the Panel constructor from the element's "data-value" + * attribute, invoking the constructor to create a Panel component, and then binding + * any associated HTML controls to the new component. * * NOTE: Unlike most other component init() functions, this one is designed to be * called multiple times: once at load time, so that we can binding our print() diff --git a/modules/pcjs/lib/ram.js b/modules/pcjs/lib/ram.js index 5e2d25089..52bdcb832 100644 --- a/modules/pcjs/lib/ram.js +++ b/modules/pcjs/lib/ram.js @@ -187,12 +187,10 @@ RAM.prototype.reset = function() { /** * RAM.init() * - * This function operates on every element (e) of class "ram", and initializes - * all the necessary HTML to construct the RAM module(s) as spec'ed. - * - * Note that each element (e) of class "ram" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the RAM constructor - * expects. + * This function operates on every HTML element of class "ram", extracting the + * JSON-encoded parameters for the RAM constructor from the element's "data-value" + * attribute, invoking the constructor to create a RAM component, and then binding + * any associated HTML controls to the new component. */ RAM.init = function() { var aeRAM = Component.getElementsByClass(window.document, PCJSCLASS, "ram"); diff --git a/modules/pcjs/lib/rom.js b/modules/pcjs/lib/rom.js index 0ad29f952..81b7963bb 100644 --- a/modules/pcjs/lib/rom.js +++ b/modules/pcjs/lib/rom.js @@ -330,12 +330,10 @@ ROM.prototype.addROM = function(addr) /** * ROM.init() * - * This function operates on every element (e) of class "rom", and initializes - * all the necessary HTML to construct the ROM module(s) as spec'ed. - * - * Note that each element (e) of class "rom" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the ROM constructor - * expects. + * This function operates on every HTML element of class "rom", extracting the + * JSON-encoded parameters for the ROM constructor from the element's "data-value" + * attribute, invoking the constructor to create a ROM component, and then binding + * any associated HTML controls to the new component. */ ROM.init = function() { diff --git a/modules/pcjs/lib/serial.js b/modules/pcjs/lib/serial.js index be44b7566..fd5a0a567 100644 --- a/modules/pcjs/lib/serial.js +++ b/modules/pcjs/lib/serial.js @@ -741,12 +741,10 @@ SerialPort.aPortOutput = { /** * SerialPort.init() * - * This function operates on every element (e) of class "serial", and initializes - * all the necessary HTML to construct the SerialPort module(s) as spec'ed. - * - * Note that each element (e) of class "serial" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the SerialPort constructor - * expects. + * This function operates on every HTML element of class "serial", extracting the + * JSON-encoded parameters for the SerialPort constructor from the element's "data-value" + * attribute, invoking the constructor to create a SerialPort component, and then binding + * any associated HTML controls to the new component. */ SerialPort.init = function() { var aeSerial = Component.getElementsByClass(window.document, PCJSCLASS, "serial"); diff --git a/modules/pcjs/lib/video.js b/modules/pcjs/lib/video.js index cab06295d..a48c5dc60 100644 --- a/modules/pcjs/lib/video.js +++ b/modules/pcjs/lib/video.js @@ -5127,12 +5127,10 @@ Video.aEGAPortOutput = { /** * Video.init() * - * This function operates on every element (e) of class "video", and initializes - * all the necessary HTML to construct every Video module as spec'ed. - * - * Note that each element (e) of class "video" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the Video constructor - * expects. + * This function operates on every HTML element of class "video", extracting the + * JSON-encoded parameters for the Video constructor from the element's "data-value" + * attribute, invoking the constructor to create a Video component, and then binding + * any associated HTML controls to the new component. */ Video.init = function() { diff --git a/modules/pcjs/lib/x86cpu.js b/modules/pcjs/lib/x86cpu.js index 705bdbaee..c4385a9d0 100644 --- a/modules/pcjs/lib/x86cpu.js +++ b/modules/pcjs/lib/x86cpu.js @@ -2639,12 +2639,11 @@ X86CPU.prototype.stepCPU = function(nMinCycles) /** * X86CPU.init() * - * This function operates on every element (e) of class "cpu", and initializes - * all the necessary HTML to construct the CPU module(s) as spec'ed. - * - * Note that each element (e) of class "cpu" is expected to have a "data-value" - * attribute containing the same JSON-encoded parameters that the CPU constructor - * expects. + * This function operates on every HTML element of class "cpu", extracting the + * JSON-encoded parameters for the X86CPU constructor from the element's "data-value" + * attribute, invoking the constructor (which in turn invokes the CPU constructor) + * to create a X86CPU component, and then binding any associated HTML controls to the + * new component. */ X86CPU.init = function() {