begin implementing chrin to read from keyboard buffer
This commit is contained in:
1 parent
f37e32f856
commit
8a4f4928e5
1 file changed
+21
-2
+21
-2
@@ -5,8 +5,27 @@
|
|||||||
;; Repeated calls after that read out the successive bytes of the line of input.
|
;; Repeated calls after that read out the successive bytes of the line of input.
|
||||||
chrin:
|
chrin:
|
||||||
;; XXX - Not yet implemented, so infinite loop for now
|
;; XXX - Not yet implemented, so infinite loop for now
|
||||||
inc $d020
|
lda keys_in_key_buffer
|
||||||
jmp chrin
|
beq chrin
|
||||||
|
|
||||||
|
;; Print character
|
||||||
|
lda keyboard_buffer
|
||||||
|
jsr chrout
|
||||||
|
|
||||||
|
;; Pop key out of keyboard buffer
|
||||||
|
;; Disable interrupts while reading from keyboard buffer
|
||||||
|
;; so that no race conditions can occur
|
||||||
|
sei
|
||||||
|
ldx #$00
|
||||||
|
ldy #$01
|
||||||
|
* lda keyboard_buffer,y
|
||||||
|
sta keyboard_buffer,x
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
cpy keys_in_key_buffer
|
||||||
|
bne -
|
||||||
|
dec keys_in_key_buffer
|
||||||
|
cli
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
clc
|
clc
|
||||||
|
|||||||
Reference in new issue
Block a user