refactor keyboard scanner somewhat, and have no variables in ROM(!)
This commit is contained in:
1 parent
99b06b843e
commit
67b2f3fc7d
2 files changed
+22
-13
No files matched your search
@@ -27,5 +27,14 @@ default_irq_handler:
|
|||||||
|
|
||||||
jsr blink_cursor
|
jsr blink_cursor
|
||||||
jsr scan_keyboard
|
jsr scan_keyboard
|
||||||
|
|
||||||
|
lda KeyQuantity
|
||||||
|
sta $0400
|
||||||
|
lda Buffer+0
|
||||||
|
sta $0401
|
||||||
|
lda Buffer+1
|
||||||
|
sta $0402
|
||||||
|
lda Buffer+2
|
||||||
|
sta $0403
|
||||||
|
|
||||||
jmp return_from_interrupt
|
jmp return_from_interrupt
|
||||||
+13
-13
@@ -156,6 +156,15 @@
|
|||||||
.alias TempZP $B6 ;// 1 byte
|
.alias TempZP $B6 ;// 1 byte
|
||||||
.alias SimultaneousKeys $F7 ;// 1 byte
|
.alias SimultaneousKeys $F7 ;// 1 byte
|
||||||
|
|
||||||
|
;; Reuse RS232 variables, since they should not be used
|
||||||
|
;; by other things
|
||||||
|
;; These are initialised in cinit all to $FF
|
||||||
|
.alias BufferOld $293 ; 3 bytes
|
||||||
|
.alias Buffer $297 ; 4 bytes
|
||||||
|
.alias BufferQuantity $29B ; 1 byte
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;// Operational Variables
|
;// Operational Variables
|
||||||
.alias MaxKeyRollover 3
|
.alias MaxKeyRollover 3
|
||||||
|
|
||||||
@@ -180,7 +189,8 @@ KeyInRow:
|
|||||||
asl
|
asl
|
||||||
bcs nokey0
|
bcs nokey0
|
||||||
jsr KeyFound
|
jsr KeyFound
|
||||||
nokey0:
|
nokey0:
|
||||||
|
inx
|
||||||
asl
|
asl
|
||||||
bcs nokey1
|
bcs nokey1
|
||||||
jsr KeyFound
|
jsr KeyFound
|
||||||
@@ -233,11 +243,10 @@ KeyFound:
|
|||||||
;; was: ldy KeyTable,x
|
;; was: ldy KeyTable,x
|
||||||
pha
|
pha
|
||||||
txa
|
txa
|
||||||
tay
|
|
||||||
pla
|
|
||||||
|
|
||||||
ldx KeyQuantity
|
ldx KeyQuantity
|
||||||
sty BufferNew,x
|
sta BufferNew,x
|
||||||
|
pla
|
||||||
ldx TempZP
|
ldx TempZP
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@@ -536,12 +545,3 @@ TooManyNewKeys:
|
|||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
BufferOld:
|
|
||||||
.byte $ff, $ff, $ff
|
|
||||||
|
|
||||||
Buffer:
|
|
||||||
.byte $ff, $ff, $ff, $ff
|
|
||||||
|
|
||||||
BufferQuantity:
|
|
||||||
.byte $ff
|
|
||||||
|
|
||||||
Reference in new issue
Block a user