1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00
cc65/libsrc/c128/mou/callback.inc
Greg King 9023e975df Stopped the C128 mouse drivers from blocking certain keys such as '1', '2', and 'Q'.
This extra fix is needed because the C128 keyboard scanner works a little differently than the C64 scanner works.
Fixes #696. Fixes #853.
2020-07-14 16:06:21 -04:00

31 lines
912 B
PHP

;
; Callback routine, called from the IRQ handler after the ROM IRQ handler
; has been run.
;
; 2014-04-24, Christian Groessler
; 2020-07-14, Greg King
;
; Check if there was button/joystick activity before and/or after the ROM handler.
; If there was activity, discard the key presses because they are most
; probably "phantom" key presses.
callback:
ldx old_key_count
cpx KEY_COUNT
beq @nokey
lda OLD_BUTTONS ; keypress before?
bne @discard_key ; yes, discard key
lda #$FF
sta CIA1_PRA
lda CIA1_PRB ; Read joystick #0
and #$1F
eor #$1F ; keypress after
beq @nokey ; no, probably a real key press
@discard_key:
stx KEY_COUNT ; set old keyboard buffer fill level
@nokey: rts