;
; 2009-09-26, Ullrich von Bassewitz
; 2010-02-06, Greg King
+;
+; The driver prevents the keyboard from interfering by changing the\r
+; keyboard's output port into an input port while the driver reads its\r
+; controller device. That disables a wire that is left active by the\r
+; Kernal. That wire is used by the STOP-key to break out of BASIC\r
+; programs -- CC65 programs don't use that feature. The wire is shared\r
+; by these keys: STOP, "Q", Commodore, Space, "2", CTRL, Left-Arrow, and\r
+; "1". I listed them, in order, from bit 7 over to bit 0. The\r
+; rightmost five keys can look like joystick switches.\r
+;\r
+; The driver prevents the mouse/joystick from interfering by "blinding"\r
+; the keyboard scanner while any button/switch is active. It changes\r
+; the input port into an output port, then stores all zero-bits in that\r
+; port's latch. Reading from an output port sees the bitwise-AND of the\r
+; latch and the input signals. Therefore, the scanner thinks that eight\r
+; keys are being pushed at the same time. It doesn't know what to do\r
+; about that condition; so, it does nothing. The driver lets the\r
+; scanner see normally, again, when no buttons/switches are active.
;
.include "zeropage.inc"
;
; Ullrich von Bassewitz, 2004-03-29, 2009-09-26
; 2010-02-08, Greg King
+;
+; The driver prevents the keyboard from interfering by changing the\r
+; keyboard's output port into an input port while the driver reads its\r
+; controller device. That disables a wire that is left active by the\r
+; Kernal. That wire is used by the STOP-key to break out of BASIC\r
+; programs -- CC65 programs don't use that feature. The wire is shared\r
+; by these keys: STOP, "Q", Commodore, Space, "2", CTRL, Left-Arrow, and\r
+; "1". I listed them, in order, from bit 7 over to bit 0. The\r
+; rightmost five keys can look like joystick switches.\r
+;\r
+; The driver prevents the mouse/joystick from interfering by "blinding"\r
+; the keyboard scanner while any button/switch is active. It changes\r
+; the input port into an output port, then stores all zero-bits in that\r
+; port's latch. Reading from an output port sees the bitwise-AND of the\r
+; latch and the input signals. Therefore, the scanner thinks that eight\r
+; keys are being pushed at the same time. It doesn't know what to do\r
+; about that condition; so, it does nothing. The driver lets the\r
+; scanner see normally, again, when no buttons/switches are active.
;
.include "zeropage.inc"