new SCNKEY is functionning, but probably needs different matrix format

This commit is contained in:
FeralChild64 committed 2019-10-13 20:39:05 +02:00
1 parent 7e2a2f8e5d
commit bb2b4981b8
3 files changed
+48 -11

No files matched your search

+3 -3
View File
@@ -62,7 +62,7 @@ Note: vectors at `$0300` are not supported yet - for now only the locations belo
| `(00306)` | `$A71A` | `QPLOP` | NOT DONE | some implementation exists, but not connected here |
| `(00308)` | `$A7E4` | `GONE` | NOT DONE | some implementation exists, but not connected here |
| `(0030A)` | `$AE86` | `EVAL` | NOT DONE | some implementation exists, but not connected here |
| `($A000)` | | cold start | PARTIAL | |
| `($A000)` | `$E394` | cold start | PARTIAL | |
| `($A002)` | | warm start | PARTIAL | |
<br />
@@ -109,7 +109,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
| `$FF96` | | `TKSA` | DONE | |
| `$FF99` | | `MEMTOP` | DONE | |
| `$FF9C` | | `MEMBOT` | DONE | |
| `$FF9F` | | `SCNKEY` | DONE | could be better integrated with ROM (aliases) |
| `$FF9F` | | `SCNKEY` | PARTIAL | future complete version has compatibility problems |
| `$FFA2` | | `SETTMO` | DONE | |
| `$FFA5` | | `ACPTR` | DONE | |
| `$FFA8` | | `CIOUT` | DONE | |
@@ -138,7 +138,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
| `$FFE7` | `$F32F` | `CLALL` | DONE | |
| `$FFEA` | | `UDTIM` | DONE | |
| `$FFED` | | `SCREEN` | DONE | |
| `$FFF0` | `$E50A` | `PLOT` | PARTIAL | |
| `$FFF0` | `$E50A` | `PLOT` | DONE | |
| `$FFF3` | | `IOBASE` | DONE | |
| `($FFFA)` | | NMI vec | PARTIAL | |
| `($FFFC)` | | RESET vec | PARTIAL | |
+2 -2
View File
@@ -17,16 +17,16 @@ PLOT:
// - 'Duotris' game calls $E50C during startup screen initialization
plot_set:
sty PNTR
stx TBLX
jsr screen_calculate_line_pointer
// XXX cursor blink might need to be handled too
// FALLTROUGH to save one byte on RTS
plot_get:
ldy PNTR
ldx TBLX
rts
+43 -6
View File
@@ -20,6 +20,7 @@
// - MODE - flag, whether charset toggle (SHIFT+VENDOR) is allowed
// XXX add RPTFLG support
// XXX add Commodore 128 keyboard support
// XXX add Commodore 65 keybopard support
// XXX add support for using joystick to move sursor keys
@@ -58,7 +59,7 @@ scnkey_bucky_loop:
sta CIA1_PRA
lda kb_matrix_bucky_testmask, y
and CIA1_PRB
bne !+ // not pressed
bne !+ // not pressed
lda SHFLAG
ora kb_matrix_bucky_shflag, y
sta SHFLAG
@@ -68,9 +69,14 @@ scnkey_bucky_loop:
// Set KEYTAB vector
jsr scnkey_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
lda NDX
cmp XMAX
bcs scnkey_no_keys // no space in keyboard buffer - do not waste time
// XXX check if there is space in keyboard buffer
// XXX check for joystick activity
// Scan the keyboard matrix
@@ -113,7 +119,7 @@ scnkey_matrix_loop_next:
scnkey_no_keys:
// XXX
// Mark no key press
lda #$40 // XXX adapt value for C128 and C65 keyboards
sta LSTX
@@ -122,18 +128,49 @@ scnkey_no_keys:
scnkey_got_key: // .X should now contain the key offset in matrix pointed by KEYTAB
cpx LSTX
beq scnkey_handle_repeat // branch if the same key as previously
stx LSTX
// Reset key repeat counters - see [CM64] page 58
lda #$04
sta KOUNT
lda #$10
sta DELAY
// FALLTROUGH
scnkey_output_key:
// Output PETSCII code to the keyboard buffer
txa // XXX switch registers!!!
tay
lda (KEYTAB), y
beq scnkey_no_keys // branch if we have no PETSCII code for this key
ldy NDX
sta KEYD, y
inc NDX
rts
scnkey_handle_repeat:
// Handle repeat timer
.break
lda KOUNT
beq !+
dec KOUNT
!:
// XXX
rts
scnkey_via_keylog:
via_keylog:
jmp (KEYLOG)
#endif // no CONFIG_SCNKEY_TWW_CTR