mirror of
https://github.com/cc65/cc65.git
synced 2024-12-22 12:30:41 +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:
parent
b304f04cc0
commit
e8afafce78
@ -44,9 +44,16 @@ 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
|
||||
inc COLCRS
|
||||
l1: inc COLCRS
|
||||
lda COLCRS
|
||||
cmp #40
|
||||
bcc plot
|
||||
@ -65,8 +72,14 @@ plot: 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
|
||||
@ -76,9 +89,22 @@ L3: clc
|
||||
adc SAVMSC+1
|
||||
sta ptr4+1
|
||||
pla ; get char again
|
||||
|
||||
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
|
||||
|
||||
.rodata
|
||||
|
Loading…
Reference in New Issue
Block a user