From 9dfc3cc7c97a7f2416501144794bbe4c5b7abf39 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 29 Jan 2022 10:43:09 -0500 Subject: [PATCH] saving the cursor also saves the SGR --- vt.equ.S | 1 + vt100.csi.S | 10 ++-------- vt100.esc.S | 6 ++++++ vt100.screen.S | 11 +++++++++++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/vt.equ.S b/vt.equ.S index 2883419..8fc9caa 100644 --- a/vt.equ.S +++ b/vt.equ.S @@ -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. diff --git a/vt100.csi.S b/vt100.csi.S index e0a8649..1a080fc 100644 --- a/vt100.csi.S +++ b/vt100.csi.S @@ -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 diff --git a/vt100.esc.S b/vt100.esc.S index 5349ec7..dc6943b 100644 --- a/vt100.esc.S +++ b/vt100.esc.S @@ -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 diff --git a/vt100.screen.S b/vt100.screen.S index d9cba64..cd87b80 100644 --- a/vt100.screen.S +++ b/vt100.screen.S @@ -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