diff --git a/src/aliases/,aliases_config.s b/src/aliases/,aliases_config.s index a1e19e13..598244ad 100644 --- a/src/aliases/,aliases_config.s +++ b/src/aliases/,aliases_config.s @@ -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 diff --git a/src/kernal/keyboard/scnkey.s b/src/kernal/keyboard/scnkey.s index 2b1df0cd..6857df74 100644 --- a/src/kernal/keyboard/scnkey.s +++ b/src/kernal/keyboard/scnkey.s @@ -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 diff --git a/src/kernal/keyboard_m65/mega65_scnkey.s b/src/kernal/keyboard_m65/mega65_scnkey.s index ea377e76..d8836af3 100644 --- a/src/kernal/keyboard_m65/mega65_scnkey.s +++ b/src/kernal/keyboard_m65/mega65_scnkey.s @@ -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