completed RPTFLG support

This commit is contained in:
FeralChild64 committed 2019-10-14 21:10:56 +02:00
1 parent 643de3a8b7
commit 9377573f98
3 files changed
+48 -15

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@
// #define CONFIG_SCNKEY_TWW_CTR // XXX document this // #define CONFIG_SCNKEY_TWW_CTR // XXX document this
#define CONFIG_KEY_REPEAT // XXX document this // #define CONFIG_KEY_REPEAT // XXX document this
#define CONFIG_JOY1_CURSOR // XXX document this #define CONFIG_JOY1_CURSOR // XXX document this
#define CONFIG_JOY2_CURSOR // XXX document this #define CONFIG_JOY2_CURSOR // XXX document this
@@ -0,0 +1,23 @@
//
// Matrix ids of keys which should be repeated regardless of RPTFLG
//
// Values based on:
// - [CM64] Compute's Mapping the Commodore 64 - page 58
//
#if !CONFIG_SCNKEY_TWW_CTR
kb_matrix_alwaysrepeat:
.byte $3C // SPACE
.byte $02 // CRSR LEFT/RIGHT
.byte $07 // CRSR UP/DOWN
.byte $00 // INS/DEL
__kb_matrix_alwaysrepeat_end:
#endif // no CONFIG_SCNKEY_TWW_CTR
+24 -14
View File
@@ -24,7 +24,6 @@
// XXX add Commodore 128 keyboard support // XXX add Commodore 128 keyboard support
// XXX add Commodore 65 keybopard support // XXX add Commodore 65 keybopard support
// XXX fix support for joystick port 2 to move cursor keys // XXX fix support for joystick port 2 to move cursor keys
// XXX add support for keys which are repeated always
#if !CONFIG_SCNKEY_TWW_CTR #if !CONFIG_SCNKEY_TWW_CTR
@@ -78,17 +77,18 @@ scnkey_bucky_loop:
// Check for control port 2 activity // Check for control port 2 activity
// ldx #$00 ldx #$00
// stx CIA1_DDRA // set port to input to read joystick stx CIA1_DDRA // set port to input to read joystick
// lda CIA1_PRA // read the joystick 2 status lda CIA1_PRA // read the joystick 2 status
// dex ldx #$FF
// stx CIA1_DDRA // set port back to output stx CIA1_DDRA // set port back to output
// and #%00001111 // filter out anything but joystick movement and #%00001111 // filter out anything but joystick movement
// cmp #%00001111 cmp #%00001111
// bne scnkey_joystick_filtered
bne scnkey_joystick_filtered
#endif #endif
@@ -207,7 +207,7 @@ scnkey_joystick_filtered:
scnkey_got_key: // .Y should now contain the key offset in matrix pointed by KEYTAB scnkey_got_key: // .Y should now contain the key offset in matrix pointed by KEYTAB
cpy LSTX cpy LSTX
beq scnkey_handle_repeat // branch if the same key as previously beq scnkey_try_repeat // branch if the same key as previously
sty LSTX sty LSTX
// Reset key repeat counters - see [CM64] page 58 // Reset key repeat counters - see [CM64] page 58
@@ -251,13 +251,23 @@ scnkey_done:
rts rts
scnkey_handle_repeat: scnkey_try_repeat:
// Check whether we should repeat keys // Check whether we should repeat keys - first the flag, afterwards hardcoded list
// XXX always repeat SPACE, cvursors, ins/del
lda RPTFLG lda RPTFLG
bpl scnkey_done // branch if we should do no repeat bmi scnkey_handle_repeat // branch if we should repeat always
tya
ldx #(__kb_matrix_alwaysrepeat_end - kb_matrix_alwaysrepeat - 1)
!:
cmp kb_matrix_alwaysrepeat, x
beq scnkey_handle_repeat
dex
bpl !-
bmi scnkey_done
scnkey_handle_repeat:
// Countdown before first repeat // Countdown before first repeat