Added round LEDs to the UI (initially just for the VT100)

This commit is contained in:
Jeff Parsons 2016-08-02 11:02:00 -07:00 committed by Jeff Parsons
commit b25a9268a1
21 changed files with 865 additions and 738 deletions

View file

@ -242,6 +242,8 @@ function Video(parmsVideo, canvas, context, textarea, container)
});
}
this.ledBindings = {};
if (DEBUG) this.nCyclesPrev = 0;
}
@ -404,12 +406,17 @@ Video.prototype.initBus = function(cmp, bus, cpu, dbg)
this.initBuffers();
/*
* If we have an associated keyboard, then ensure that the keyboard will be notified whenever the canvas
* gets focus and receives input.
* If we have an associated keyboard, then ensure that the keyboard will be notified
* whenever the canvas gets focus and receives input.
*/
this.kbd = cmp.getMachineComponent("Keyboard");
if (this.kbd && this.canvasScreen) {
this.kbd.setBinding(this.textareaScreen? "textarea" : "canvas", "kbd", this.inputScreen);
if (this.kbd) {
for (var s in this.ledBindings) {
this.kbd.setBinding("led", s, this.ledBindings[s]);
}
if (this.canvasScreen) {
this.kbd.setBinding(this.textareaScreen? "textarea" : "canvas", "kbd", this.inputScreen);
}
}
if (!this.sFontROM) this.setReady();
@ -666,6 +673,14 @@ Video.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
{
var video = this;
/*
* TODO: A more general-purpose binding mechanism would be nice someday....
*/
if (sHTMLType == "led" || sHTMLType == "rled") {
this.ledBindings[sBinding] = control;
return true;
}
switch (sBinding) {
case "fullScreen":
this.bindings[sBinding] = control;