new SCNKEY is now more configurable (size vs features)

This commit is contained in:
FeralChild64 committed 2019-10-14 22:58:43 +02:00
1 parent 3b69cd398b
commit 5c58af117a
16 files changed
+51 -37

No files matched your search

+4 -2
View File
@@ -48,8 +48,10 @@
// Keyboard settings
// #define CONFIG_SCNKEY_TWW_CTR // XXX document this
// #define CONFIG_KEY_REPEAT // XXX document this
// #define CONFIG_LEGACY_SCNKEY // XXX document this
// #define CONFIG_KEY_REPEAT_DEFAULT // XXX document this
// #define CONFIG_KEY_REPEAT_ALWAYS // XXX document this
#define CONFIG_KEY_FAST_SCAN // XXX document this
#define CONFIG_JOY1_CURSOR // XXX document this
#define CONFIG_JOY2_CURSOR // XXX document this
+4 -2
View File
@@ -50,8 +50,10 @@
// Keyboard settings
#define CONFIG_SCNKEY_TWW_CTR // XXX document this
// #define CONFIG_KEY_REPEAT // XXX document this
#define CONFIG_LEGACY_SCNKEY // XXX document this
// #define CONFIG_KEY_REPEAT_DEFAULT // XXX document this
// #define CONFIG_KEY_REPEAT_ALWAYS // XXX document this
#define CONFIG_KEY_FAST_SCAN // XXX document this
#define CONFIG_JOY1_CURSOR // XXX document this
#define CONFIG_JOY2_CURSOR // XXX document this
+4 -2
View File
@@ -48,8 +48,10 @@
// Keyboard settings
// #define CONFIG_SCNKEY_TWW_CTR // XXX document this
// #define CONFIG_KEY_REPEAT // XXX document this
// #define CONFIG_LEGACY_SCNKEY // XXX document this
// #define CONFIG_KEY_REPEAT_DEFAULT // XXX document this
// #define CONFIG_KEY_REPEAT_ALWAYS // XXX document this
#define CONFIG_KEY_FAST_SCAN // XXX document this
#define CONFIG_JOY1_CURSOR // XXX document this
#define CONFIG_JOY2_CURSOR // XXX document this
+5 -5
View File
@@ -104,7 +104,7 @@
.label CNTDN = $A5 // -- NOT IMPLEMENTED --
.label BUFPNT = $A6 // -- NOT IMPLEMENTED --
.label INBIT = $A7 // -- NOT IMPLEMENTED --
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
.label BITCI = $A8 // -- NOT IMPLEMENTED --
.label RINONE = $A9 // -- NOT IMPLEMENTED --
.label RIDDATA = $AA // -- NOT IMPLEMENTED --
@@ -114,11 +114,11 @@
.label EAL = $AE // $AE-$AF -- NOT IMPLEMENTED -- [!] used also by screen editor, for temporary color storage when scrolling
.label CMP0 = $B0 // $B0-$B1 temporary tape storage, [!] here used for BRK instruction address
.label TAPE1 = $B2 // $B2-$B3 tape buffer pointer
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
.label BITTS = $B4 // -- NOT IMPLEMENTED --
#endif
.label NXTBIT = $B5 // -- NOT IMPLEMENTED --
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
.label RODATA = $B6 // -- NOT IMPLEMENTED --
#endif
@@ -172,7 +172,7 @@
.label BUF = $200 // $200-$250, BASIC line editor input buffer (81 bytes)
// $250-$258 is the 81st - 88th characters in BASIC input, a carry over from VIC-20
// and not used on C64 - they are used if CONFIG_SCNKEY_TWW_CTR is enabled.
// and not used on C64 - they are used if CONFIG_LEGACY_SCNKEY is enabled.
// [!] XXX document $251-$258 usage
.label LAT = $259 // $259-$262, logical file numbers (table, 10 bytes)
@@ -194,7 +194,7 @@
.label KEYLOG = $28F // $28F-$290 routine to setup keyboard decoding
.label MODE = $291 // flag, is case switch allowed
.label AUTODN = $292 // -- NOT IMPLEMENTED -- screen scroll disable
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
.label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551
.label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551
.label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551
+2 -2
View File
@@ -75,7 +75,7 @@ cint_brk: // entry for BRK and STOP+RESTORE - XXX, where should it start?
// Enable cursor repeat - XXX make it configurable
#if CONFIG_KEY_REPEAT
#if CONFIG_KEY_REPEAT_DEFAULT && !CONFIG_KEY_REPEAT_ALWAYS
lda #$80
sta RPTFLG
@@ -84,7 +84,7 @@ cint_brk: // entry for BRK and STOP+RESTORE - XXX, where should it start?
// Set keyboard decode vector (Compute's Mapping the 64 p215)
#if CONFIG_SCNKEY_TWW_CTR
#if CONFIG_LEGACY_SCNKEY
// Set initial variables for our improved keyboard scan routine
lda #$FF
+2 -2
View File
@@ -7,7 +7,7 @@
//
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY && !CONFIG_KEY_REPEAT_ALWAYS
kb_matrix_alwaysrepeat:
@@ -20,4 +20,4 @@ kb_matrix_alwaysrepeat:
__kb_matrix_alwaysrepeat_end:
#endif // no CONFIG_SCNKEY_TWW_CTR
#endif // no CONFIG_LEGACY_SCNKEY and no CONFIG_KEY_REPEAT_ALWAYS
+2 -2
View File
@@ -7,7 +7,7 @@
//
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
kb_matrix_bucky_confmask: // values to be written to CIA1_PRA
@@ -33,4 +33,4 @@ kb_matrix_bucky_shflag: // mask to be ORed to SHFLAG to mark key status
.byte KEY_FLAG_CTRL
#endif // no CONFIG_SCNKEY_TWW_CTR
#endif // no CONFIG_LEGACY_SCNKEY
+2 -2
View File
@@ -7,7 +7,7 @@
//
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
kb_matrix_bucky_filter:
@@ -24,4 +24,4 @@ kb_matrix_bucky_filter:
.byte %00100100 // VENDOR + CONTROL
#endif // no CONFIG_SCNKEY_TWW_CTR
#endif // no CONFIG_LEGACY_SCNKEY
+1 -1
View File
@@ -4,7 +4,7 @@
//
#if !CONFIG_SCNKEY_TWW_CTR && (CONFIG_JOY1_CURSOR || CONFIG_JOY2_CURSOR)
#if !CONFIG_LEGACY_SCNKEY && (CONFIG_JOY1_CURSOR || CONFIG_JOY2_CURSOR)
kb_matrix_joy_status:
+1 -1
View File
@@ -7,7 +7,7 @@
//
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
kb_matrix_lookup:
@@ -12,9 +12,9 @@
// This lookup table is used by TWW/CTR keyboard routine only!
#if CONFIG_SCNKEY_TWW_CTR
#if CONFIG_LEGACY_SCNKEY
kb_matrix_lookup_tww_ctr:
kb_matrix_lookup:
.byte $00 // Normal
.byte $40 // Shifted
@@ -25,4 +25,4 @@ kb_matrix_lookup_tww_ctr:
.byte $80 // Vendor + CTRL
.byte $80 // Vendor + CTRL + SHIFT
#endif // CONFIG_SCNKEY_TWW_CTR
#endif // CONFIG_LEGACY_SCNKEY
+2 -2
View File
@@ -7,7 +7,7 @@
//
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
kb_matrix_row_keys:
@@ -25,4 +25,4 @@ kb_matrix_row_keys:
.byte %01111111
#endif // no CONFIG_SCNKEY_TWW_CTR
#endif // no CONFIG_LEGACY_SCNKEY
+2 -2
View File
@@ -4,7 +4,7 @@
//
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
kb_matrix_row_offsets:
@@ -20,4 +20,4 @@ kb_matrix_row_offsets:
.byte 6*8
.byte 7*8
#endif // no CONFIG_SCNKEY_TWW_CTR
#endif // no CONFIG_LEGACY_SCNKEY
+12 -4
View File
@@ -25,7 +25,7 @@
// XXX add Commodore 65 keyboard support
#if !CONFIG_SCNKEY_TWW_CTR
#if !CONFIG_LEGACY_SCNKEY
// Routine takes some ideas from TWW/CTR proposal, see here:
// - http://codebase64.org/doku.php?id=base:scanning_the_keyboard_the_correct_and_non_kernal_way
@@ -44,7 +44,7 @@ SCNKEY:
// Check for any activity
#if !CONFIG_JOY2_CURSOR
#if !CONFIG_JOY2_CURSOR && CONFIG_KEY_FAST_SCAN
ldx #$00
stx CIA1_PRA // connect all the rows
@@ -93,13 +93,17 @@ scnkey_bucky_loop:
bne scnkey_joystick_filtered
#if CONFIG_KEY_FAST_SCAN
inx // puts $00
stx CIA1_PRA // connect all the rows
dex // puts $FF
cpx CIA1_PRB
beq scnkey_no_keys
#endif
#endif // CONFIG_KEY_FAST_SCAN
#endif // CONFIG_JOY2_CURSOR
// Check for control port 1 activity (can interfere with keyboard)
@@ -262,6 +266,8 @@ scnkey_done:
scnkey_try_repeat:
#if !CONFIG_KEY_REPEAT_ALWAYS
// Check whether we should repeat keys - first the flag, afterwards hardcoded list
lda RPTFLG
@@ -278,6 +284,8 @@ scnkey_try_repeat:
scnkey_handle_repeat:
#endif // no CONFIG_KEY_REPEAT_ALWAYS
// Countdown before first repeat
lda DELAY
@@ -309,4 +317,4 @@ via_keylog:
jmp (KEYLOG)
#endif // no CONFIG_SCNKEY_TWW_CTR
#endif // no CONFIG_LEGACY_SCNKEY
@@ -9,7 +9,7 @@
//
#if CONFIG_SCNKEY_TWW_CTR
#if CONFIG_LEGACY_SCNKEY
// Scan the keyboard..
@@ -116,7 +116,7 @@ accept_key:
tax
pla
and #$3f
ora kb_matrix_lookup_tww_ctr,x
ora kb_matrix_lookup,x
tax
lda kb_matrix,x
// But don't insert $00 characters
@@ -521,4 +521,4 @@ KeyRepeatWait:
jmp ConsiderNextKey
#endif // CONFIG_SCNKEY_TWW_CTR
#endif // CONFIG_LEGACY_SCNKEY
+2 -2
View File
@@ -9,7 +9,7 @@
scnkey_set_keytab:
#if CONFIG_SCNKEY_TWW_CTR // routine not compatible with legacy SCNKEY
#if CONFIG_LEGACY_SCNKEY // routine not compatible with legacy SCNKEY
rts
@@ -54,7 +54,7 @@ scnkey_valid_offset:
// FALLTROUGH
#endif // no CONFIG_SCNKEY_TWW_CTR
#endif // no CONFIG_LEGACY_SCNKEY
scnkey_toggle_if_needed: // entry for SCNKEY (TWW/CTR version)