improved key repeat handling

This commit is contained in:
FeralChild64 committed 2020-12-02 18:24:16 +01:00
1 parent c571e0babb
commit 0ea10b24a1
3 files changed
+20 -28

No files matched your search

+2
View File
@@ -389,6 +389,8 @@
!ifdef CONFIG_JOY1_CURSOR { !set CONFIG_JOY1_OR_JOY2_CURSOR = 1 }
!ifdef CONFIG_JOY2_CURSOR { !set CONFIG_JOY1_OR_JOY2_CURSOR = 1 }
!ifdef CONFIG_RS232_UP9600 { !set CONFIG_KEY_DELAY = $18 } else { !set CONFIG_KEY_DELAY = $16 }
; Handle debug configuration
+1 -5
View File
@@ -298,11 +298,7 @@ scnkey_got_key: ; .Y should now contain the key offset in matrix pointed by KEYT
;
; Besides - since I am the one who writes the code, I will make the values exactly how I like them :D
!ifndef CONFIG_RS232_UP9600 {
lda #$16
} else {
lda #$18
}
lda #CONFIG_KEY_DELAY
sta DELAY
; FALLTROUGH
+17 -23
View File
@@ -90,7 +90,7 @@ m65_scnkey_keytab_set_done:
jsr m65_scnkey_init_pressed
lda M65_KB_COLSUM
+beq m65_scnkey_no_keys ; branch if no key was pressed XXX try joystick
beq m65_scnkey_no_keys ; branch if no key was pressed XXX try joystick
ldx #$08
@@ -162,11 +162,7 @@ m65_scnkey_got_key: ; .Y should now contain the key offset in matrix pointed by
; Reset key repeat counters XXX turn values into constants
!ifndef CONFIG_RS232_UP9600 {
lda #$16
} else {
lda #$18
}
lda #CONFIG_KEY_DELAY
sta DELAY
; FALLTROUGH
@@ -209,6 +205,21 @@ m65_scnkey_done:
rts
m65_scnkey_jam:
pla
jsr m65_scnkey_init_pressed
; FALLTROUGH
m65_scnkey_no_keys:
; Mark no key press
lda #$48
sta LSTX
rts
m65_scnkey_try_repeat:
!ifndef CONFIG_KEY_REPEAT_ALWAYS {
@@ -248,20 +259,3 @@ m65_scnkey_handle_repeat:
dec KOUNT
rts
m65_scnkey_jam:
pla
; XXX
jmp m65_scnkey_init_pressed
m65_scnkey_no_keys:
; XXX
rts