From ff12835ee2f59ff147b67f9e8d194b46fea02f94 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 8 Oct 2017 18:11:09 +0200 Subject: [PATCH] Adding cgetc --- libsrc/telestrat/cgetc.s | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libsrc/telestrat/cgetc.s b/libsrc/telestrat/cgetc.s index 591f966bc..9bdbf4818 100644 --- a/libsrc/telestrat/cgetc.s +++ b/libsrc/telestrat/cgetc.s @@ -3,9 +3,24 @@ ; .export _cgetc + .import cursor + + .include "telestrat.inc" .proc _cgetc + ; this routine could be quicker if we wrote in page 2 variables, but it's better to use telemon routine in that case, because telemon can manage 4 I/O + lda cursor ; if cursor equal to 0, then switch off cursor + beq switchoff_cursor + + ldx #$00 ; x is the first screen + BRK_TELEMON(XCSSCR) ; display cursor + jmp loop ; could be replaced by a bne/beq but 'jmp' is cleaner than a bne/beq which could expect some + +switchoff_cursor: + ldx #$00 ; x is the first screen + BRK_TELEMON(XCOSCR) ; switch off cursor + loop: BRK_TELEMON XRD0 bcs loop -- 2.39.5