1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

always use setcursor to update cursor settings

git-svn-id: svn://svn.cc65.org/cc65/trunk@1657 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cpg 2002-11-26 21:34:13 +00:00
parent ef36bbfd82
commit 93f6ee340d

View File

@ -9,7 +9,7 @@
.export plot, cputdirect, putchar .export plot, cputdirect, putchar
.import popa, _gotoxy, mul40 .import popa, _gotoxy, mul40
.importzp tmp4,ptr4 .importzp tmp4,ptr4
.import _revflag .import _revflag,setcursor
.include "atari.inc" .include "atari.inc"
@ -25,7 +25,7 @@ _cputc:
lda #0 lda #0
sta COLCRS sta COLCRS
beq plot ; return beq plot ; return
L4: cmp #$0A ; LF L4: cmp #$0A ; LF
beq newline beq newline
cmp #ATEOL ; Atari-EOL? cmp #ATEOL ; Atari-EOL?
@ -45,18 +45,6 @@ L4: cmp #$0A ; LF
cputdirect: ; accepts screen code cputdirect: ; accepts screen code
jsr putchar jsr putchar
; update cursor position pointer
ldy #0
lda OLDCHR
sta (OLDADR),y
inc OLDADR
bne L1
inc OLDADR+1
L1: lda (OLDADR),y
sta OLDCHR
ora _revflag
sta (OLDADR),y
; advance cursor ; advance cursor
inc COLCRS inc COLCRS
lda COLCRS lda COLCRS
@ -73,7 +61,8 @@ newline:
bne plot bne plot
lda #0 lda #0
sta ROWCRS sta ROWCRS
plot: ldy COLCRS plot: jsr setcursor
ldy COLCRS
ldx ROWCRS ldx ROWCRS
rts rts
@ -86,32 +75,21 @@ putchar:
sta (OLDADR),y sta (OLDADR),y
lda ROWCRS lda ROWCRS
jsr mul40 jsr mul40 ; destroys tmp4
L3: clc clc
adc SAVMSC ; add start of screen memory adc SAVMSC ; add start of screen memory
sta ptr4 sta ptr4
lda tmp4 txa
adc SAVMSC+1 adc SAVMSC+1
sta ptr4+1 sta ptr4+1
pla ; get char again pla ; get char again
ora _revflag
sta OLDCHR sta OLDCHR
ora _revflag
ldy COLCRS ldy COLCRS
sta (ptr4),y sta (ptr4),y
jmp setcursor
; update OLDADR (maybe ROWCRS and COLCRS were changed)
sty tmp4
lda ptr4
clc
adc tmp4
sta OLDADR
lda ptr4+1
adc #0
sta OLDADR+1
rts
.rodata .rodata
ataint: .byte 64,0,32,96 ataint: .byte 64,0,32,96