change for new connection
This commit is contained in:
parent
182b8a2d75
commit
e295c5549a
@ -60,33 +60,33 @@ RBUF_MEM_END = RBUF_MEM_START + KP_BUF_SIZE - 1
|
||||
;********************************************************************************
|
||||
.proc kp_read_on_irq
|
||||
; test each "row" and check which column is 1
|
||||
; todo dont check every column if the value has been found
|
||||
; TODO dont check every column if the value has been found
|
||||
lda #%11100000
|
||||
ldx #$00
|
||||
jsr @kp_read_column
|
||||
lda #%11010000
|
||||
ldx #$08
|
||||
ldx #$04
|
||||
jsr @kp_read_column
|
||||
lda #%10110000
|
||||
ldx #$04
|
||||
ldx #$08
|
||||
jsr @kp_read_column
|
||||
lda #%01110000
|
||||
ldx #$0c
|
||||
jsr @kp_read_column
|
||||
stz KP_IO+IO::RA
|
||||
lda KP_IO+IO::RA ; todo: verify that this is necessary so that rows 1-3 dont refire immediately after they are armed again because of stz
|
||||
lda KP_IO+IO::RA ; clear interrupt flag again beceause it might be set again through the above tests
|
||||
rts
|
||||
@kp_read_column:
|
||||
sta KP_IO+IO::RA
|
||||
lda KP_IO+IO::RA
|
||||
sta _KP_COLUMN ; store result in zeropage so that bbr can be used
|
||||
bbr4 _KP_COLUMN,@kp_write
|
||||
bbr0 _KP_COLUMN,@kp_write ; row 1
|
||||
inx
|
||||
bbr5 _KP_COLUMN,@kp_write
|
||||
bbr1 _KP_COLUMN,@kp_write ; row 3
|
||||
inx
|
||||
bbr6 _KP_COLUMN,@kp_write
|
||||
bbr2 _KP_COLUMN,@kp_write ; row 2
|
||||
inx
|
||||
bbr7 _KP_COLUMN,@kp_write
|
||||
bbr3 _KP_COLUMN,@kp_write ; row 4
|
||||
rts
|
||||
@kp_write:
|
||||
lda _KP_VALUES,x
|
||||
@ -96,6 +96,13 @@ RBUF_MEM_END = RBUF_MEM_START + KP_BUF_SIZE - 1
|
||||
|
||||
.rodata
|
||||
_KP_VALUES:
|
||||
; TODO change to literal
|
||||
.byte "123A", "456B", "789C", "*0#D"
|
||||
.byte "174*"
|
||||
.byte "396#"
|
||||
.byte "2850"
|
||||
.byte "ABCD"
|
||||
; keypad conencted so that
|
||||
; row 1 = PA0
|
||||
; row 2 = PA2
|
||||
; row 3 = PA1
|
||||
; row 4 = PA3
|
||||
.endif
|
||||
|
Loading…
Reference in New Issue
Block a user