further work on new SCNKEY
This commit is contained in:
1 parent
183ac3ab87
commit
677e5452a6
11 files changed
+228
-87
No files matched your search
@@ -96,53 +96,53 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
|
|||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
| Address | Unofficial | Name | Status | Remarks |
|
| Address | Unofficial | Name | Status | Remarks |
|
||||||
| :-------: | :--------: | :---------- | :------: | :------------------------------------------------: |
|
| :-------: | :--------: | :---------- | :------: | :--------------------------------------------------: |
|
||||||
| `($028F)` | | `KEYLOG` | DONE | |
|
| `($028F)` | | `KEYLOG` | DONE | works differently on purpose, to improve kb scanning |
|
||||||
| `$FF81` | `$FF5B` | `CINT` | DONE | |
|
| `$FF81` | `$FF5B` | `CINT` | DONE | |
|
||||||
| `$FF84` | `$FDA3` | `IOINIT` | PARTIAL | CIA initialization incomplete |
|
| `$FF84` | `$FDA3` | `IOINIT` | PARTIAL | CIA initialization incomplete |
|
||||||
| `$FF87` | `$FD50` | `RAMTAS` | DONE | |
|
| `$FF87` | `$FD50` | `RAMTAS` | DONE | |
|
||||||
| `$FF8A` | `$FD15` | `RESTOR` | DONE | |
|
| `$FF8A` | `$FD15` | `RESTOR` | DONE | |
|
||||||
| `$FF8D` | `$FD1A` | `VECTOR` | DONE | |
|
| `$FF8D` | `$FD1A` | `VECTOR` | DONE | |
|
||||||
| `$FF90` | | `SETMSG` | DONE | |
|
| `$FF90` | | `SETMSG` | DONE | |
|
||||||
| `$FF93` | | `SECOND` | DONE | |
|
| `$FF93` | | `SECOND` | DONE | |
|
||||||
| `$FF96` | | `TKSA` | DONE | |
|
| `$FF96` | | `TKSA` | DONE | |
|
||||||
| `$FF99` | | `MEMTOP` | DONE | |
|
| `$FF99` | | `MEMTOP` | DONE | |
|
||||||
| `$FF9C` | | `MEMBOT` | DONE | |
|
| `$FF9C` | | `MEMBOT` | DONE | |
|
||||||
| `$FF9F` | | `SCNKEY` | PARTIAL | future complete version has compatibility problems |
|
| `$FF9F` | | `SCNKEY` | PARTIAL | future complete version has compatibility problems |
|
||||||
| `$FFA2` | | `SETTMO` | DONE | |
|
| `$FFA2` | | `SETTMO` | DONE | |
|
||||||
| `$FFA5` | | `ACPTR` | DONE | |
|
| `$FFA5` | | `ACPTR` | DONE | |
|
||||||
| `$FFA8` | | `CIOUT` | DONE | |
|
| `$FFA8` | | `CIOUT` | DONE | |
|
||||||
| `$FFAB` | | `UNTLK` | DONE | |
|
| `$FFAB` | | `UNTLK` | DONE | |
|
||||||
| `$FFAE` | | `UNLSN` | DONE | |
|
| `$FFAE` | | `UNLSN` | DONE | |
|
||||||
| `$FFB1` | | `LISTEN` | DONE | |
|
| `$FFB1` | | `LISTEN` | DONE | |
|
||||||
| `$FFB4` | | `TALK` | DONE | |
|
| `$FFB4` | | `TALK` | DONE | |
|
||||||
| `$FFB7` | | `READST` | DONE | |
|
| `$FFB7` | | `READST` | DONE | |
|
||||||
| `$FFBA` | | `SETFLS` | DONE | |
|
| `$FFBA` | | `SETFLS` | DONE | |
|
||||||
| `$FFBD` | | `SETNAM` | DONE | |
|
| `$FFBD` | | `SETNAM` | DONE | |
|
||||||
| `$FFC0` | `$F34A` | `OPEN` | DONE | |
|
| `$FFC0` | `$F34A` | `OPEN` | DONE | |
|
||||||
| `$FFC3` | `$F291` | `CLOSE` | DONE | |
|
| `$FFC3` | `$F291` | `CLOSE` | DONE | |
|
||||||
| `$FFC6` | `$F20E` | `CHKIN` | DONE | |
|
| `$FFC6` | `$F20E` | `CHKIN` | DONE | |
|
||||||
| `$FFC9` | `$F250` | `CKOUT` | PARTIAL | |
|
| `$FFC9` | `$F250` | `CKOUT` | PARTIAL | |
|
||||||
| `$FFCC` | `$F333` | `CLRCHN` | DONE | |
|
| `$FFCC` | `$F333` | `CLRCHN` | DONE | |
|
||||||
| `$FFCF` | `$F157` | `CHRIN` | PARTIAL | |
|
| `$FFCF` | `$F157` | `CHRIN` | PARTIAL | |
|
||||||
| `$FFD2` | `$F1CA` | `CHROUT` | PARTIAL | |
|
| `$FFD2` | `$F1CA` | `CHROUT` | PARTIAL | |
|
||||||
| `$FFD5` | `$F49E` | `LOAD` | PARTIAL | not yet clear what's this entry doing |
|
| `$FFD5` | `$F49E` | `LOAD` | PARTIAL | not yet clear what's this entry doing |
|
||||||
| `($0330)` | `$F4A5` | `LOAD` | PARTIAL | no VERIFY support, no STOP key, check $F49E addr |
|
| `($0330)` | `$F4A5` | `LOAD` | PARTIAL | no VERIFY support, no STOP key, check $F49E addr |
|
||||||
| `$FFD8` | `$F5DD` | `SAVE` | NOT DONE | |
|
| `$FFD8` | `$F5DD` | `SAVE` | NOT DONE | |
|
||||||
| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | |
|
| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | |
|
||||||
| `$FFDB` | | `SETTIM` | DONE | |
|
| `$FFDB` | | `SETTIM` | DONE | |
|
||||||
| `$FFDE` | | `RDTIM` | DONE | |
|
| `$FFDE` | | `RDTIM` | DONE | |
|
||||||
| `$FFE1` | `$F6ED` | `STOP` | DONE | |
|
| `$FFE1` | `$F6ED` | `STOP` | DONE | |
|
||||||
| `$FFE4` | `$F13E` | `GETIN` | PARTIAL | only some devices supported |
|
| `$FFE4` | `$F13E` | `GETIN` | PARTIAL | only some devices supported |
|
||||||
| `$FFE7` | `$F32F` | `CLALL` | DONE | |
|
| `$FFE7` | `$F32F` | `CLALL` | DONE | |
|
||||||
| `$FFEA` | | `UDTIM` | DONE | |
|
| `$FFEA` | | `UDTIM` | DONE | |
|
||||||
| `$FFED` | | `SCREEN` | DONE | |
|
| `$FFED` | | `SCREEN` | DONE | |
|
||||||
| `$FFF0` | `$E50A` | `PLOT` | DONE | |
|
| `$FFF0` | `$E50A` | `PLOT` | DONE | |
|
||||||
| `$FFF3` | | `IOBASE` | DONE | |
|
| `$FFF3` | | `IOBASE` | DONE | |
|
||||||
| `($FFFA)` | | NMI vec | PARTIAL | |
|
| `($FFFA)` | | NMI vec | PARTIAL | |
|
||||||
| `($FFFC)` | | RESET vec | PARTIAL | |
|
| `($FFFC)` | | RESET vec | PARTIAL | |
|
||||||
| `($FFFE)` | | IRQ/BRK vec | PARTIAL | |
|
| `($FFFE)` | | IRQ/BRK vec | PARTIAL | |
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,9 @@
|
|||||||
#define CONFIG_PANIC_SCREEN
|
#define CONFIG_PANIC_SCREEN
|
||||||
#define CONFIG_DOS_WEDGE
|
#define CONFIG_DOS_WEDGE
|
||||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||||
#define CONFIG_SCNKEY_TWW_CTR // for now has to be enabled
|
// #define CONFIG_SCNKEY_TWW_CTR // XXX document this
|
||||||
|
#define CONFIG_JOY1_CURSOR // XXX document this
|
||||||
|
#define CONFIG_JOY2_CURSOR // XXX document this
|
||||||
|
|
||||||
|
|
||||||
// Debug options
|
// Debug options
|
||||||
|
|||||||
@@ -60,7 +60,9 @@
|
|||||||
#define CONFIG_PANIC_SCREEN
|
#define CONFIG_PANIC_SCREEN
|
||||||
#define CONFIG_DOS_WEDGE
|
#define CONFIG_DOS_WEDGE
|
||||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||||
#define CONFIG_SCNKEY_TWW_CTR // for now has to be enabled
|
#define CONFIG_SCNKEY_TWW_CTR // XXX document this
|
||||||
|
#define CONFIG_JOY1_CURSOR // XXX document this
|
||||||
|
#define CONFIG_JOY2_CURSOR // XXX document this
|
||||||
|
|
||||||
|
|
||||||
// Debug options
|
// Debug options
|
||||||
|
|||||||
@@ -58,7 +58,9 @@
|
|||||||
#define CONFIG_PANIC_SCREEN
|
#define CONFIG_PANIC_SCREEN
|
||||||
#define CONFIG_DOS_WEDGE
|
#define CONFIG_DOS_WEDGE
|
||||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||||
#define CONFIG_SCNKEY_TWW_CTR // for now has to be enabled
|
// #define CONFIG_SCNKEY_TWW_CTR // XXX document this
|
||||||
|
#define CONFIG_JOY1_CURSOR // XXX document this
|
||||||
|
#define CONFIG_JOY2_CURSOR // XXX document this
|
||||||
|
|
||||||
|
|
||||||
// Debug options
|
// Debug options
|
||||||
|
|||||||
@@ -25,18 +25,17 @@ udtim_update_stkey: // entry to be used when interrupts are disabled
|
|||||||
|
|
||||||
// Another action we have to perform is to copy the last row of keyboard to RAM,
|
// Another action we have to perform is to copy the last row of keyboard to RAM,
|
||||||
// so that various routines can detect the STOP key press
|
// so that various routines can detect the STOP key press
|
||||||
// XXX scnkey contains similar sequence - deduplicate this!
|
|
||||||
lda #$FF
|
|
||||||
sta CIA1_DDRA // output
|
|
||||||
lda #$00
|
|
||||||
sta CIA1_DDRB // input
|
|
||||||
|
|
||||||
lda #$7F
|
lda #$7F
|
||||||
sta CIA1_PRA // select the last row (bit to 0)
|
sta CIA1_PRA // select the last row (bit to 0)
|
||||||
|
|
||||||
lda CIA1_PRB // read the row
|
lda CIA1_PRB // read the row
|
||||||
sta STKEY
|
sta STKEY
|
||||||
rts
|
|
||||||
|
// Finish by disconnecting the keyboard, this will prevent
|
||||||
|
// interference when scanning joystick in port 1
|
||||||
|
|
||||||
|
jmp keyboard_disconnect
|
||||||
|
|
||||||
udtim_clock_rollover:
|
udtim_clock_rollover:
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Work out if normal, shifted, control or Vendor modified keyboard.
|
// Helper table for determining keyboard matrix decoding table on the C64 keyboard
|
||||||
// Table contains the offsets into keyboard_matrixes that should be used
|
|
||||||
// for different values of the bottom 3 bits of key_bucky_state XXX
|
|
||||||
// Interaction is simple to work out when playing with a C64:
|
|
||||||
// CTRL trumps SHIFT or VENDOR
|
|
||||||
// VENDOR + SHIFT = DOES NOTHING
|
|
||||||
// All 3 does CONTROL
|
|
||||||
//
|
//
|
||||||
|
// When more than one bucky keey is pressed, decoding keys is asking for trouble,
|
||||||
|
// so never allow this.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#if !CONFIG_SCNKEY_TWW_CTR
|
||||||
|
|
||||||
kb_matrix_lookup:
|
kb_matrix_lookup:
|
||||||
|
|
||||||
.byte (__kb_matrix_normal - kb_matrix) // Normal
|
.byte (__kb_matrix_normal - kb_matrix) // %000 Normal
|
||||||
.byte (__kb_matrix_shift - kb_matrix) // SHIFT
|
.byte (__kb_matrix_shift - kb_matrix) // %001 SHIFT
|
||||||
.byte (__kb_matrix_ctrl - kb_matrix) // CTRL
|
.byte (__kb_matrix_vendor - kb_matrix) // %010 VENDOR
|
||||||
.byte (__kb_matrix_ctrl - kb_matrix) // CTRL + SHIFT
|
.byte $FF // %011 SHIFT+VENDOR
|
||||||
.byte (__kb_matrix_vendor - kb_matrix) // VENDOR
|
.byte (__kb_matrix_ctrl - kb_matrix) // %100 CTRL
|
||||||
.byte (__kb_matrix_vendor - kb_matrix) // VENDOR + SHIFT
|
.byte $FF // %101 SHIFT+CTRL
|
||||||
.byte (__kb_matrix_ctrl - kb_matrix) // VENDOR + CTRL
|
.byte $FF // %110 VENDOR+CTRL
|
||||||
.byte (__kb_matrix_ctrl - kb_matrix) // VENDOR + CTRL + SHIFT
|
.byte $FF // %111 SHIFT+VENDOR+CTRL
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
//
|
||||||
|
// Work out if normal, shifted, control or Vendor modified keyboard.
|
||||||
|
// Table contains the offsets into keyboard_matrixes that should be used
|
||||||
|
// for different values of the bottom 3 bits of key_bucky_state XXX
|
||||||
|
// Interaction is simple to work out when playing with a C64:
|
||||||
|
// CTRL trumps SHIFT or VENDOR
|
||||||
|
// VENDOR + SHIFT = DOES NOTHING
|
||||||
|
// All 3 does CONTROL
|
||||||
|
//
|
||||||
|
|
||||||
|
// This lookup table is used by TWW/CTR keyboard routine only!
|
||||||
|
|
||||||
|
|
||||||
|
#if CONFIG_SCNKEY_TWW_CTR
|
||||||
|
|
||||||
|
kb_matrix_lookup_tww_ctr:
|
||||||
|
|
||||||
|
.byte $00 // Normal
|
||||||
|
.byte $40 // Shifted
|
||||||
|
.byte $80 // Control
|
||||||
|
.byte $80 // Control + SHIFT
|
||||||
|
.byte $C0 // Vendor
|
||||||
|
.byte $C0 // Vendor + SHIFT
|
||||||
|
.byte $80 // Vendor + CTRL
|
||||||
|
.byte $80 // Vendor + CTRL + SHIFT
|
||||||
|
|
||||||
|
#endif // CONFIG_SCNKEY_TWW_CTR
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
//
|
||||||
|
// Helper routine - disconnects the keyboard from CIA1_PRB,
|
||||||
|
// leaves $FF in .X (behavior needed in some places)
|
||||||
|
|
||||||
|
|
||||||
|
keyboard_disconnect:
|
||||||
|
|
||||||
|
ldx #$FF
|
||||||
|
stx CIA1_PRA // disconnect all the rows
|
||||||
|
|
||||||
|
rts
|
||||||
@@ -23,8 +23,9 @@
|
|||||||
|
|
||||||
// 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 add support for using joystick to move sursor keys
|
// XXX add support for using joysticks to move cursor keys
|
||||||
// XXX explicitly prevent joystick port 1 interference
|
// XXX add support for keys which are repeated always
|
||||||
|
|
||||||
|
|
||||||
#if !CONFIG_SCNKEY_TWW_CTR
|
#if !CONFIG_SCNKEY_TWW_CTR
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ SCNKEY:
|
|||||||
// Check for any activity
|
// Check for any activity
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
sta CIA1_PRA // connect all the rows
|
sta CIA1_PRA // connect all the rows
|
||||||
ldx #$FF
|
ldx #$FF
|
||||||
cpx CIA1_PRB
|
cpx CIA1_PRB
|
||||||
beq scnkey_no_keys
|
beq scnkey_no_keys
|
||||||
@@ -71,18 +72,44 @@ scnkey_bucky_loop:
|
|||||||
|
|
||||||
jsr via_keylog // XXX for some CPUs we have indirect jsr
|
jsr via_keylog // XXX for some CPUs we have indirect jsr
|
||||||
|
|
||||||
// Check if we have free space in the keyboard buffer
|
// Check if KEYTAB is not 0 (happens if more than one bucky key is pressed)
|
||||||
|
// High byte equal to 0 = table considered invalid
|
||||||
|
lda KEYTAB+1
|
||||||
|
beq scnkey_no_keys
|
||||||
|
|
||||||
lda NDX
|
#if CONFIG_JOY2_CURSOR
|
||||||
cmp XMAX
|
|
||||||
bcs scnkey_no_keys // no space in keyboard buffer - do not waste time
|
|
||||||
|
|
||||||
// XXX check for joystick activity
|
// XXX why this does not work???
|
||||||
|
|
||||||
|
// Check for control port 2 activity
|
||||||
|
|
||||||
|
// ldx #$00
|
||||||
|
// stx CIA1_DDRA // set port to input to read joystick
|
||||||
|
|
||||||
|
// lda CIA1_PRA // read the joystick 2 status
|
||||||
|
|
||||||
|
// dex
|
||||||
|
// stx CIA1_DDRA // set port back to output
|
||||||
|
|
||||||
|
// and #%00001111 // filter out anything but joystick movement
|
||||||
|
// bne scnkey_joystick_a_filtered
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Check for control port 1 activity (can interfere with keyboard)
|
||||||
|
|
||||||
|
jsr keyboard_disconnect // disconnect all the rows, .X will be $FF
|
||||||
|
cpx CIA1_PRB // only control port activity will be reported
|
||||||
|
#if CONFIG_JOY1_CURSOR
|
||||||
|
bne scnkey_joystick_x // use joystick for cursor keys
|
||||||
|
#else
|
||||||
|
bne scnkey_no_keys // if activity detected do not scan the keyboard
|
||||||
|
#endif
|
||||||
|
|
||||||
// Scan the keyboard matrix
|
// Scan the keyboard matrix
|
||||||
|
|
||||||
|
ldy #$FF // offset in key matrix table, $FF for not found yet
|
||||||
ldx #$07 // XXX adapt for C128 and C65 keyboards
|
ldx #$07 // XXX adapt for C128 and C65 keyboards
|
||||||
ldy #$FF // offset in key matrix table, $FF for not found yet
|
|
||||||
scnkey_matrix_loop:
|
scnkey_matrix_loop:
|
||||||
lda kb_matrix_row_keys, x
|
lda kb_matrix_row_keys, x
|
||||||
sta CIA1_PRA
|
sta CIA1_PRA
|
||||||
@@ -110,9 +137,16 @@ scnkey_matrix_loop_next:
|
|||||||
dex
|
dex
|
||||||
bpl scnkey_matrix_loop
|
bpl scnkey_matrix_loop
|
||||||
|
|
||||||
// Scanning complete
|
// Scanning complete - check if we got a key
|
||||||
|
|
||||||
cpy #$FF
|
cpy #$FF
|
||||||
bne scnkey_got_key
|
beq scnkey_no_keys
|
||||||
|
|
||||||
|
// To be extra sure, check for possible control port 1 interference once again
|
||||||
|
|
||||||
|
jsr keyboard_disconnect // disconnect all the rows, .X will be $FF
|
||||||
|
cpx CIA1_PRB // only control port activity will be reported
|
||||||
|
beq scnkey_got_key // branch if joystick activity NOT detected
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
@@ -125,6 +159,25 @@ scnkey_no_keys:
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
#if CONFIG_JOY1_CURSOR || CONFIG_JOY2_CURSOR
|
||||||
|
|
||||||
|
scnkey_joystick_x:
|
||||||
|
|
||||||
|
// Handle joystick activity (in .X) as cursor keys
|
||||||
|
|
||||||
|
txa
|
||||||
|
and #%00001111 // filter out anything but movement
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
|
scnkey_joystick_a_filtered:
|
||||||
|
|
||||||
|
// XXX finish the implementation
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
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
|
||||||
@@ -148,6 +201,12 @@ scnkey_got_key: // .Y should now contain the key offset in matrix pointed by KEY
|
|||||||
|
|
||||||
scnkey_output_key:
|
scnkey_output_key:
|
||||||
|
|
||||||
|
// Check if we have free space in the keyboard buffer
|
||||||
|
|
||||||
|
lda NDX
|
||||||
|
cmp XMAX
|
||||||
|
bcs scnkey_early_repeat // no space in buffer XXX set timer to trigger repeat the next time
|
||||||
|
|
||||||
// Reinitialize secondary counter
|
// Reinitialize secondary counter
|
||||||
|
|
||||||
lda #$03
|
lda #$03
|
||||||
@@ -170,12 +229,10 @@ scnkey_handle_repeat:
|
|||||||
|
|
||||||
// Check whether we should repeat keys
|
// Check whether we should repeat keys
|
||||||
|
|
||||||
// XXX some keys should be repeat always!
|
|
||||||
|
|
||||||
lda RPTFLG
|
lda RPTFLG
|
||||||
bpl scnkey_done // branch if we should do no repeat
|
bpl scnkey_done // branch if we should do no repeat
|
||||||
|
|
||||||
// First countdown (for the first repeat)
|
// Countdown before first repeat
|
||||||
|
|
||||||
lda DELAY
|
lda DELAY
|
||||||
beq !+
|
beq !+
|
||||||
@@ -183,7 +240,7 @@ scnkey_handle_repeat:
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
!:
|
!:
|
||||||
// Second countdown (for both first and subsequential repeats)
|
// Countdown before subsequent repeats
|
||||||
|
|
||||||
lda KOUNT
|
lda KOUNT
|
||||||
beq scnkey_output_key // if second counter is also 0, we can repeat the key
|
beq scnkey_output_key // if second counter is also 0, we can repeat the key
|
||||||
@@ -191,6 +248,17 @@ scnkey_handle_repeat:
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
scnkey_early_repeat:
|
||||||
|
|
||||||
|
// Keyboard buffer was full - at least make sure the key
|
||||||
|
// will be repeated as soon as possible
|
||||||
|
|
||||||
|
lda #$00
|
||||||
|
sta DELAY
|
||||||
|
sta KOUNT
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
via_keylog:
|
via_keylog:
|
||||||
jmp (KEYLOG)
|
jmp (KEYLOG)
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,17 @@
|
|||||||
// - [CM64] Compute's Mapping the Commodore 64 - pages 220, 221
|
// - [CM64] Compute's Mapping the Commodore 64 - pages 220, 221
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
scnkey_set_keytab:
|
scnkey_set_keytab:
|
||||||
|
|
||||||
|
|
||||||
|
#if CONFIG_SCNKEY_TWW_CTR // routine not compatible with legacy SCNKEY
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
|
||||||
// Set initial KEYTAB value
|
// Set initial KEYTAB value
|
||||||
|
|
||||||
lda #<kb_matrix
|
lda #<kb_matrix
|
||||||
@@ -22,6 +31,16 @@ scnkey_set_keytab:
|
|||||||
|
|
||||||
// Retrieve table offset
|
// Retrieve table offset
|
||||||
lda kb_matrix_lookup, x
|
lda kb_matrix_lookup, x
|
||||||
|
cmp #$FF
|
||||||
|
bne scnkey_valid_offset
|
||||||
|
|
||||||
|
// $FF means we shouldn't decode anything, mark this by setting high byte
|
||||||
|
// of KEYTAB to 0 (I don't think anyone would put keyboard decoding table
|
||||||
|
// at zeropage)
|
||||||
|
lda #$00
|
||||||
|
beq !+ // branch always
|
||||||
|
|
||||||
|
scnkey_valid_offset:
|
||||||
|
|
||||||
// Add offset to the vector
|
// Add offset to the vector
|
||||||
clc
|
clc
|
||||||
@@ -29,8 +48,15 @@ scnkey_set_keytab:
|
|||||||
sta KEYTAB+0
|
sta KEYTAB+0
|
||||||
lda #$00
|
lda #$00
|
||||||
adc KEYTAB+1
|
adc KEYTAB+1
|
||||||
|
!:
|
||||||
sta KEYTAB+1
|
sta KEYTAB+1
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
|
|
||||||
|
#endif // no CONFIG_SCNKEY_TWW_CTR
|
||||||
|
|
||||||
|
|
||||||
scnkey_toggle_if_needed: // entry for SCNKEY (TWW/CTR version)
|
scnkey_toggle_if_needed: // entry for SCNKEY (TWW/CTR version)
|
||||||
|
|
||||||
// Check if we should toggle the character set
|
// Check if we should toggle the character set
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ accept_key:
|
|||||||
tax
|
tax
|
||||||
pla
|
pla
|
||||||
and #$3f
|
and #$3f
|
||||||
ora kb_matrix_lookup,x
|
ora kb_matrix_lookup_tww_ctr,x
|
||||||
tax
|
tax
|
||||||
lda kb_matrix,x
|
lda kb_matrix,x
|
||||||
// But don't insert $00 characters
|
// But don't insert $00 characters
|
||||||
|
|||||||
Reference in new issue
Block a user