2 ; Callback routine called from the IRQ handler after the ROM IRQ handler
5 ; Christian Groessler, 24.04.2014
7 ; Check if there was button/joystick activity before and/or after the ROM handler.
8 ; If there was activity, discard the key presses since they are most
9 ; probably "phantom" key presses.
16 lda OLD_BUTTONS ; keypress before?
17 bne @discard_key ; yes, discard key
21 lda CIA1_PRB ; Read joystick #0
23 eor #$1F ; keypress after
24 beq @nokey ; no, probably a real key press
27 stx KEY_COUNT ; set old keyboard buffer fill level