]> git.sur5r.net Git - cc65/commitdiff
setcursor now updates OLDADR from COLCRS and ROWCRS
authorcpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 26 Nov 2002 21:31:01 +0000 (21:31 +0000)
committercpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 26 Nov 2002 21:31:01 +0000 (21:31 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1655 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/atari/cgetc.s

index 62e00d2e51960a6d9843546228e301dfcf59db38..2aa4a342c607e2c0b5eb6949df57d4b4eae17f5b 100644 (file)
@@ -6,9 +6,9 @@
 ;
 
        .include "atari.inc"
-       .export _cgetc
-       .import cursor
-       
+       .export _cgetc,setcursor
+       .import cursor,mul40
+
 _cgetc:
        jsr     setcursor
        jsr     @1
@@ -26,8 +26,25 @@ _cgetc:
 
 .proc  setcursor
 
-       lda     OLDCHR          ; get char at current cursor position
-       ldy     #0              ; needed later
+       ldy     #0
+       lda     OLDCHR
+       sta     (OLDADR),y
+
+       lda     ROWCRS
+       jsr     mul40
+       clc
+       adc     SAVMSC          ; add start of screen memory
+       sta     OLDADR
+       txa
+       adc     SAVMSC+1
+       sta     OLDADR+1
+       lda     COLCRS
+       adc     OLDADR
+       sta     OLDADR
+       bcc     nc
+       inc     OLDADR+1
+nc:    lda     (OLDADR),y
+       sta     OLDCHR
 
        ldx     cursor          ; current cursor setting as requested by the user
        beq     off