better handling of the cursor, use kernal function to read key, not the UART directly
This commit is contained in:
32
libsrc/c65/cgetc.s
Normal file
32
libsrc/c65/cgetc.s
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
.include "cbm_kernal.inc"
|
||||
.import cursor
|
||||
.export _cgetc
|
||||
_cgetc:
|
||||
|
||||
lda cursor
|
||||
beq nocursor
|
||||
|
||||
; enable the cursor
|
||||
clc
|
||||
jsr CURSOR
|
||||
|
||||
nocursor:
|
||||
; wait for a key
|
||||
; FIXME: is $d610 mega65 specific?
|
||||
:
|
||||
lda $d610
|
||||
beq :-
|
||||
|
||||
jsr KBDREAD
|
||||
|
||||
pha
|
||||
; disable the cursor
|
||||
sec
|
||||
jsr CURSOR
|
||||
|
||||
pla
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user