saving the cursor also saves the SGR

This commit is contained in:
Kelvin Sherlock 2022-01-29 10:43:09 -05:00
parent 71993497ea
commit 9dfc3cc7c9
4 changed files with 20 additions and 8 deletions

View File

@ -83,6 +83,7 @@ mod ds 2
saved_x ds 2
saved_y ds 2
saved_decom ds 2
saved_sgr ds 2
* async read/write pointers.

View File

@ -16,6 +16,7 @@
ext recalc_cursor,recalc_cursor_x,recalc_cursor_y
ext erase_line_0,erase_line_1,erase_line_2
ext erase_screen_0,erase_screen_1,erase_screen_2
ext update_sgr
ext write_modem
@ -472,15 +473,8 @@ csi_m
cpx pcount
blt :loop
* now update - bit 7 indicates inverse.
stz draw_inverse
lda SGR
beq :rts
lda #$80
* and #$80
sta draw_inverse
jmp update_sgr
:rts rts
:and db $00,$ff,$ff,$ff,$ff,$ff,$ff,$ff

View File

@ -12,6 +12,7 @@
ext recalc_cursor,recalc_cursor_x,recalc_cursor_y
ext scroll_up,scroll_down
ext reset
ext update_sgr
vt100_esc ent
* #[()=>cH78DEM
@ -141,6 +142,8 @@ esc_7 ; save cursor position, graphic rendition, and character set.
sta saved_y
lda DECOM
sta saved_decom
lda SGR
sta saved_sgr
rts
esc_8 ; restore cursor position, graphic rendition, and character set.
@ -151,7 +154,10 @@ esc_8 ; restore cursor position, graphic rendition, and character set.
sta y
lda saved_decom
sta DECOM
lda saved_sgr
sta SGR
jsr update_sgr
jmp recalc_cursor
esc_eq ; enter alternate keypad mode

View File

@ -21,6 +21,17 @@
* cursor_state - $80 = disabled, $40 = on
update_sgr ent
stz draw_inverse
lda SGR
beq :rts
lda #$80
sta draw_inverse
:rts rts
text
dw $0400