DECCOLM 132 support (partial).

I still don't support 132 mode but switching clears the screen, homes the cursor,
and clears any scrolling regions, so it's necessary for passing the vttest suite.
This commit is contained in:
Kelvin Sherlock 2022-01-30 15:52:32 -05:00
parent 04113c4725
commit 80edada6e9
3 changed files with 46 additions and 11 deletions

View File

@ -36,6 +36,7 @@ DECOM ds 2 ; origin
DECSCNM ds 2 ; screen mode
DECAWM ds 2 ; wrap
DECARM ds 2 ; auto repeat
DECCOLM ds 2 ; character per line (80/132)
LNM ds 2 ; new line
@ -46,7 +47,6 @@ SGR ds 2 ; graphics, bit 1 = bold, 4 = underscore, 5 = blink, 7 = inverse
*CHARSET ds 2 ;
*GRAPHICS ds 2 ;
*DECCOLM ds 2 ; character per line (80/132)
*DECINLM ds 2 ; interlace
*DECSCLM ds 2 ; scroll mode

View File

@ -284,6 +284,7 @@ variables
jsr decawm
jsr decarm
jsr decscnm
jsr deccolm
jsr lnm
jsr sgr
jsr dectm
@ -384,11 +385,22 @@ decscnm
:str asc "DECSCNM: ",00
lnm
deccolm
mx %10
ldy #line_12+4
ldx #:str
jsr print_xy_str
lda DPAGE+DECCOLM
jmp print_on_off
:str asc "DECCOLM: ",00
lnm
mx %10
ldy #line_13+4
ldx #:str
jsr print_xy_str
lda DPAGE+LNM
jmp print_on_off
@ -397,7 +409,7 @@ lnm
sgr
mx %10
ldy #line_13+4
ldy #line_14+4
ldx #:str
jsr print_xy_str
lda DPAGE+SGR
@ -408,7 +420,7 @@ sgr
dectm
mx %10
ldy #line_14+4
ldy #line_15+4
ldx #:str
jsr print_xy_str
lda DPAGE+DECTM
@ -419,7 +431,7 @@ dectm
decbm
mx %10
ldy #line_15+4
ldy #line_16+4
ldx #:str
jsr print_xy_str
lda DPAGE+DECBM
@ -431,7 +443,7 @@ decbm
decx
mx %10
ldy #line_16+4
ldy #line_17+4
ldx #:str
jsr print_xy_str
lda DPAGE+x
@ -443,7 +455,7 @@ decx
decy
mx %10
ldy #line_17+4
ldy #line_18+4
ldx #:str
jsr print_xy_str
lda DPAGE+y

View File

@ -354,7 +354,7 @@ mode_common
dw :rts ; error
dw mode_DECCKM
dw mode_DECANM
dw :rts ; DECCOLM
dw mode_DECCOLM ; DECCOLM
dw :rts ; DECSCLM
dw mode_DECSCNM
dw mode_DECOM
@ -396,10 +396,33 @@ mode_DECANM
:rts rts
*mode_DECCOLM
* sty DECCOLM
* rts
mode_DECCOLM
* 80/132 mode.
* vt102 guide states:
* NOTE: When you change the number of columns per line, the screen is erased.
* This also sets the scrolling region for full screen (24 lines).
*
* based on testing, this always clears the screen and resets x/y, regardless of current mode.
*
bit pmod
bpl :rts
sty DECCOLM
lda #0
sta DECTM
lda #23
sta DECBM
stz x
stz y
phy
jsr recalc_cursor
jsr erase_screen_2
ply
:rts rts
mode_DECSCNM
bit pmod