]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/cputc.s
The spans do now contain the size of a span, no longer the end offset.
[cc65] / libsrc / atari / cputc.s
index 652c6589dd88c145b654629383ba09c2bb855e3c..906a79282ee5727d32f0a68f6ee747f48ff5a885 100644 (file)
@@ -9,7 +9,7 @@
        .export         plot, cputdirect, putchar
        .import         popa, _gotoxy, mul40
        .importzp       tmp4,ptr4
-       .import         _revflag
+       .import         _revflag,setcursor
 
        .include        "atari.inc"
 
@@ -25,7 +25,7 @@ _cputc:
        lda     #0
        sta     COLCRS
        beq     plot            ; return
-       
+
 L4:    cmp     #$0A            ; LF
        beq     newline
        cmp     #ATEOL          ; Atari-EOL?
@@ -44,7 +44,7 @@ L4:   cmp     #$0A            ; LF
 
 cputdirect:                    ; accepts screen code
        jsr     putchar
-       
+
 ; advance cursor
        inc     COLCRS
        lda     COLCRS
@@ -61,26 +61,35 @@ newline:
        bne     plot
        lda     #0
        sta     ROWCRS
-plot:  ldy     COLCRS
+plot:  jsr     setcursor
+       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
+       jsr     mul40           ; destroys tmp4
+       clc
        adc     SAVMSC          ; add start of screen memory
        sta     ptr4
-       lda     tmp4
+       txa
        adc     SAVMSC+1
        sta     ptr4+1
        pla                     ; get char again
+
        ora     _revflag
+       sta     OLDCHR
+
        ldy     COLCRS
        sta     (ptr4),y
-       rts
+       jmp     setcursor
 
        .rodata
 ataint:        .byte   64,0,32,96
-