Final preparations for open source roll-out

This commit is contained in:
Jeff Parsons 2014-10-12 00:08:15 -07:00 • committed by jeffpar
commit 60669365f9
40 changed files with 2814 additions and 2639 deletions

View file

@ -270,6 +270,29 @@ C1PComputer.init = function()
var component;
var modules = {};
/*
* Let's see if the Control Panel is installed (NOTE: its ID must be "panel", and only one per machine is supported);
* the Panel needs our setPower() notifications, and this relieves us from having an explicit <module> entry for type="panel".
*/
var panel = Component.getComponentByID('panel', parmsComputer['id']);
if (panel) {
modules['panel'] = [panel];
/*
* Iterate through all the other components and update their print methods if the Control Panel has provided overrides.
*/
if (panel.controlPrint) {
var aComponents = Component.getComponents(parmsComputer['id']);
for (var iComponent = 0; iComponent < aComponents.length; iComponent++) {
component = aComponents[iComponent];
if (component == panel) continue;
component.notice = panel.notice;
component.println = panel.println;
component.controlPrint = panel.controlPrint;
}
}
}
var abMemory;
var addrStart = 0, addrEnd = 0;
@ -326,15 +349,6 @@ C1PComputer.init = function()
}
}
/*
* Let's see if the Control Panel is installed (NOTE: its ID must be "panel", and only one per machine is supported);
* the Panel needs our setPower() notifications, and this relieves us from having an explicit <module> entry for type="panel".
*/
component = Component.getComponentByID('panel', parmsComputer['id']);
if (component) {
modules['panel'] = [component];
}
var computer = new C1PComputer(parmsComputer, modules);
/*
* We may eventually add a "Power" button, but for now, all we have is a "Reset" button

View file

@ -809,7 +809,7 @@ C1PDiskController.prototype.loadDisk = function(sDiskName, sDiskData, nErrorCode
* to its trackNum index, but just in case that wasn't intended, we're going to mention it.
*/
if (iTrackNum != iTrack) {
this.warning("track " + iTrackNum + " out of order (expected " + iTrack + ")");
Component.warning("track " + iTrackNum + " out of order (expected " + iTrack + ")");
}
/*
* For each track, we start with an empty trackData array and "push" (ie, append) all the

View file

@ -56,19 +56,19 @@ Component.subclass(Component, C1PPanel);
* component that doesn't recognize the specified binding should simply ignore it.
*
* @this {C1PPanel}
* @param {string|null} c is the class of the HTML control (eg, "input", "output")
* @param {string|null} t is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea")
* @param {string} s is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset")
* @param {Object} e is the HTML control DOM object (eg, HTMLButtonElement)
* @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output")
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset")
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
* @return {boolean} true if binding was successful, false if unrecognized binding request
*/
C1PPanel.prototype.setBinding = function(c, t, s, e)
C1PPanel.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control)
{
if (this.cmp && this.cmp.setBinding(c, t, s, e)) return true;
if (this.cpu && this.cpu.setBinding(c, t, s, e)) return true;
if (this.kbd && this.kbd.setBinding(c, t, s, e)) return true;
if (DEBUGGER && this.dbg && this.dbg.setBinding(c, t, s, e)) return true;
return Component.prototype.setBinding.call(this, c, t, s, e);
if (this.cmp && this.cmp.setBinding(sHTMLClass, sHTMLType, sBinding, control)) return true;
if (this.cpu && this.cpu.setBinding(sHTMLClass, sHTMLType, sBinding, control)) return true;
if (this.kbd && this.kbd.setBinding(sHTMLClass, sHTMLType, sBinding, control)) return true;
if (DEBUGGER && this.dbg && this.dbg.setBinding(sHTMLClass, sHTMLType, sBinding, control)) return true;
return Component.prototype.setBinding.call(this, sHTMLClass, sHTMLType, sBinding, control);
};
/**