From e8afafce780914cbd2c01a6ff4441eda2269dc1d Mon Sep 17 00:00:00 2001 From: cpg Date: Sun, 3 Nov 2002 22:54:52 +0000 Subject: [PATCH] improved handling of cursor display and position git-svn-id: svn://svn.cc65.org/cc65/trunk@1483 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/atari/cputc.s | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/libsrc/atari/cputc.s b/libsrc/atari/cputc.s index 652c6589d..3ff3f0858 100644 --- a/libsrc/atari/cputc.s +++ b/libsrc/atari/cputc.s @@ -44,9 +44,16 @@ L4: cmp #$0A ; LF cputdirect: ; accepts screen code jsr putchar + + lda OLDADR ; update cursor position pointer + clc + adc #1 + sta OLDADR + bcc l1 + inc OLDADR+1 ; advance cursor - inc COLCRS +l1: inc COLCRS lda COLCRS cmp #40 bcc plot @@ -65,8 +72,14 @@ plot: ldy COLCRS ldx ROWCRS rts +; turn off cursor, update screen, turn on cursor putchar: pha ; save char + + ldy #0 + lda OLDCHR + sta (OLDADR),y + lda ROWCRS jsr mul40 L3: clc @@ -76,9 +89,22 @@ L3: clc adc SAVMSC+1 sta ptr4+1 pla ; get char again + + sta OLDCHR + ora _revflag ldy COLCRS sta (ptr4),y + + sty tmp4 + lda ptr4 + clc + adc tmp4 + sta OLDADR + lda ptr4+1 + adc #0 + sta OLDADR+1 + rts .rodata -- 2.39.5