diff --git a/apple2js.html b/apple2js.html index b806eee..40b5794 100644 --- a/apple2js.html +++ b/apple2js.html @@ -348,6 +348,7 @@
diff --git a/apple2jse.html b/apple2jse.html index 5d8a921..1f44f56 100644 --- a/apple2jse.html +++ b/apple2jse.html @@ -353,6 +353,7 @@ diff --git a/js/main2.js b/js/main2.js index 768aca4..5ea6a0b 100644 --- a/js/main2.js +++ b/js/main2.js @@ -105,7 +105,7 @@ var disk2 = new DiskII(io, driveLights, sectors); var clock = new Thunderclock(io); var smartport = new SmartPort(io, cpu, { block: true }); -initUI(apple2, disk2, smartport, false); +initUI(apple2, disk2, smartport, printer, false); io.setSlot(0, lc); io.setSlot(1, parallel); diff --git a/js/main2e.js b/js/main2e.js index 453ace5..b50ab09 100644 --- a/js/main2e.js +++ b/js/main2e.js @@ -86,7 +86,7 @@ var disk2 = new DiskII(io, driveLights); var clock = new Thunderclock(io); var smartport = new SmartPort(io, cpu); -initUI(apple2, disk2, smartport, options.e); +initUI(apple2, disk2, smartport, printer, options.e); io.setSlot(1, parallel); io.setSlot(2, slinky); diff --git a/js/ui/apple2.js b/js/ui/apple2.js index d2830c2..a46d852 100644 --- a/js/ui/apple2.js +++ b/js/ui/apple2.js @@ -35,6 +35,7 @@ var vm; var tape; var _disk2; var _smartPort; +var _printer; var audio; var keyboard; var io; @@ -769,7 +770,11 @@ export function openPrinterModal() { MicroModal.show('printer-modal'); } -export function initUI(apple2, disk2, smartPort, e) { +export function clearPrinterPaper() { + _printer.clear(); +} + +export function initUI(apple2, disk2, smartPort, printer, e) { _apple2 = apple2; cpu = _apple2.getCPU(); io = _apple2.getIO(); @@ -778,6 +783,7 @@ export function initUI(apple2, disk2, smartPort, e) { tape = new Tape(io); _disk2 = disk2; _smartPort = smartPort; + _printer = printer; keyboard = new KeyBoard(cpu, io, e); keyboard.create('#keyboard'); diff --git a/js/ui/printer.js b/js/ui/printer.js index 2dc2023..e372c85 100644 --- a/js/ui/printer.js +++ b/js/ui/printer.js @@ -9,6 +9,20 @@ * implied warranty. */ + /** + * Printer UI. The "paper" is bound to the element selected by the input. + * + * Every line that is output to the printer is added as a