1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-10 03:30:05 +00:00

improved handling of cursor display and position

git-svn-id: svn://svn.cc65.org/cc65/trunk@1483 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cpg 2002-11-03 22:54:52 +00:00
parent b304f04cc0
commit e8afafce78

View File

@ -45,8 +45,15 @@ L4: cmp #$0A ; LF
cputdirect: ; accepts screen code cputdirect: ; accepts screen code
jsr putchar jsr putchar
lda OLDADR ; update cursor position pointer
clc
adc #1
sta OLDADR
bcc l1
inc OLDADR+1
; advance cursor ; advance cursor
inc COLCRS l1: inc COLCRS
lda COLCRS lda COLCRS
cmp #40 cmp #40
bcc plot bcc plot
@ -65,8 +72,14 @@ plot: ldy COLCRS
ldx ROWCRS ldx ROWCRS
rts rts
; turn off cursor, update screen, turn on cursor
putchar: putchar:
pha ; save char pha ; save char
ldy #0
lda OLDCHR
sta (OLDADR),y
lda ROWCRS lda ROWCRS
jsr mul40 jsr mul40
L3: clc L3: clc
@ -76,9 +89,22 @@ L3: clc
adc SAVMSC+1 adc SAVMSC+1
sta ptr4+1 sta ptr4+1
pla ; get char again pla ; get char again
sta OLDCHR
ora _revflag ora _revflag
ldy COLCRS ldy COLCRS
sta (ptr4),y sta (ptr4),y
sty tmp4
lda ptr4
clc
adc tmp4
sta OLDADR
lda ptr4+1
adc #0
sta OLDADR+1
rts rts
.rodata .rodata