better handling of the cursor, use kernal function to read key, not the UART directly

This commit is contained in:
mrdudz
2025-06-25 21:39:03 +02:00
parent ef1b101538
commit a7e509cd43
7 changed files with 66 additions and 73 deletions

32
libsrc/c65/cgetc.s Normal file
View 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