stuff newly read keys into the keyboard buffer

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-20 02:02:45 +09:30
1 parent 1e37babbb7
commit f37e32f856
3 files changed
+36

No files matched your search

+1
View File
@@ -49,6 +49,7 @@
; "Compute's Mapping the 64" book
.alias keyboard_buffer $0277
.alias MEMSTR $0281
.alias MEMSIZ $0283 ; NOTE: Mapping the 64 erroniously has the hex as $282, while the DEC is correct
.alias text_colour $0286 ; p55
+23
View File
@@ -0,0 +1,23 @@
;; Key board matrixes:
;; unshifted, shifted, control and C= modified
;; 64 bytes for each
keyboard_matrixes:
;; Unshifted matrix built by refering to
;; Compute's Mapping the 64 p38-39
;; and C64 PRG pages 379-381
.byte 20,13,29,136,133,134,15
.byte $33,87,$41,$34,90,83,$45,$00
.byte $35,$52,$44,$36,$43,$46,$54,88
.byte $37,89,$47,$38,$42,$48,$55,$56
.byte $39,$49,$4A,$30,$4D,$4B,$4F,$4E
.byte 43,$50,$4C,45,46,58,$40,44
.byte $23,42,59,$13,$00,61,94,47
.byte $31,95,$00,$32,$20,$00,$51,3
;; XXX - Implement shifted
;; XXX - Implement control modified
;; XXX - Implement C= modified
+12
View File
@@ -72,6 +72,18 @@ scan_keyboard:
beq +
;; Got a key, turn it from matrix position to key value,
;; and stuff it in the keyboard buffer
;; Convert matrix position to key code
;; XXX - Add offset of $40, $80 or $C0 if shift, CONTROL or C= are held down
tax
lda keyboard_matrixes,x
;; Stash key into keyboard buffer
ldx keys_in_key_buffer
cpx key_buffer_size
beq +
sta keyboard_buffer,x
inc keys_in_key_buffer
*