fix pressing of same key masking problem. Issue #4.

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-24 08:16:18 +09:30
1 parent ca382f4dc7
commit dc8090478d
1 file changed
+13 -6
+13 -6
View File
@@ -63,7 +63,7 @@ scan_keyboard:
lda #$00 lda #$00
sta BufferQuantity sta BufferQuantity
;; Decrement key repeat timeout if non-zero ;; Decrement key repeat timeout if non-zero
ldx key_repeat_counter ldx key_repeat_counter
beq sk_start beq sk_start
@@ -173,15 +173,19 @@ OverFlow:
;// Don't manipulate last legal buffer as the routine will fix itself once it gets valid input again. ;// Don't manipulate last legal buffer as the routine will fix itself once it gets valid input again.
TooManyNewKeys: TooManyNewKeys:
ReturnNoKeys: ReturnNoKeys:
sec sec
lda #$00 lda #$00
sta BufferQuantity sta BufferQuantity
lda #$FF lda #$FF
sta last_key_matrix_position sta last_key_matrix_position
sta Buffer+0 ldx #MaxKeyRollover-1
sta Buffer+1 *
sta Buffer+2 sta Buffer,x
sta BufferOld,x
dex
bpl -
rts rts
@@ -189,6 +193,7 @@ ReturnNoKeys:
;; // Exit Routine for: No Activity ;; // Exit Routine for: No Activity
NoActivityDetected: NoActivityDetected:
;; So cancel all bucky keys ;; So cancel all bucky keys
lda key_bucky_state lda key_bucky_state
sta key_last_bucky_state sta key_last_bucky_state
@@ -217,7 +222,8 @@ Main:
sty $dc00 ;// Connect all Keyboard Rows sty $dc00 ;// Connect all Keyboard Rows
cpx $dc01 cpx $dc01
beq NoActivityDetected bne skip0
jmp NoActivityDetected
skip0: skip0:
@@ -442,6 +448,7 @@ KeyHeld:
cmp last_key_matrix_position cmp last_key_matrix_position
beq SameKeyHeld beq SameKeyHeld
;; Different key held ;; Different key held
sta last_key_matrix_position sta last_key_matrix_position
pha pha