]> 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 3ff3f0858b05346750b6a6fa016ee2c6719ee02b..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?
@@ -45,15 +45,8 @@ 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
-l1:    inc     COLCRS
+       inc     COLCRS
        lda     COLCRS
        cmp     #40
        bcc     plot
@@ -68,7 +61,8 @@ newline:
        bne     plot
        lda     #0
        sta     ROWCRS
-plot:  ldy     COLCRS
+plot:  jsr     setcursor
+       ldy     COLCRS
        ldx     ROWCRS
        rts
 
@@ -81,32 +75,21 @@ putchar:
        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
 
-       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
+       jmp     setcursor
 
        .rodata
 ataint:        .byte   64,0,32,96
-