more updates.

This commit is contained in:
Kelvin Sherlock 2021-09-05 17:04:52 -04:00
parent 1eaaf3aaaf
commit 073813c199
5 changed files with 205 additions and 15 deletions

View File

@ -57,4 +57,10 @@ pmod ds 2
r0 ds 2 r0 ds 2
* saved character for cursor
cursor_saved_char ds 2
do *>256
err "too big"
fin
dend dend

View File

@ -475,10 +475,95 @@ csi_D
csi_f csi_f
csi_H ; direct cursor addressing csi_H ; direct cursor addressing
rts * honors origin
* large numbers are clamped
* 0 or 1 treated as 1 (1-based counting)
* based on testing, esc [ 253-255 H will position outside the scrolling
* region when DECOM is active (to first 3 lines, respectively)
* this is not emulated.
* y
lda parms
beq :yy
dec
:yy bit DECOM
bmi :org
cmp #23
blt :yyy
lda #23
:yyy sta y
bra :x
:org
clc
adc DECTM
cmp DECBM
blt :org1
lda DECBM
:org1 sta y
* x
:x
ldx parms+1
beq :xx
dex
:xx
cpx #79
blt :xxx
ldx #79
:xxx stx x
jmp update_cursor
csi_r ; scrolling region csi_r ; scrolling region
rts * based on testing
* esc [ n r (no second parmeter) is equivalent to esc [ n ; 24 r
* esc [ r sets scrolling region to 1 ; 24 ( in accordince with above )
* 24 is assumed value for second parameter
* invalid parameters exit without updating
lda parms
beq :p1
dec parms
:p1
lda parms+1
beq :p2
dec parms+1
bra :check
:p2 lda #23
sta parms+1
:check
* 23 max
ldx parms+0
cmp #23+1
bge :rts
ldx parms+1
cmp #23+1
bge :rts
* must be at least 1 line
lda parms+1
sec
sbc parms
beq :rts
bmi :rts
lda parms
sta DECTM
sta y
lda parms+1
sta DECBM
stz x
jmp update_cursor
:rts rts
csi_J ; erase csi_J ; erase
rts rts

View File

@ -1,4 +1,12 @@
lst off
cas se
rel
xc
xc
use vt.equ
*control chars *control chars
ext draw_char,update_cursor ext draw_char,update_cursor
@ -87,6 +95,11 @@ cr
stz x stz x
jmp update_cursor jmp update_cursor
so ; G1 character set
si ; G0 character set
rts
xon xon
xoff xoff
* flow control... * flow control...

View File

@ -1,5 +1,5 @@
lst off
rel rel
xc xc
xc xc
@ -161,4 +161,76 @@ vt100_esc_bad ent
rts rts
vt100_esc_pound ent
* esc # 3 - make line double height (top half)
* esc # 4 - make line double height (bottom half)
* esc # 5 - make line single width, single height
* esc # 6 - make line double width
* esc # 8 - screen alignment - fill screen with E (SGR not honored)
* based on testing, this also resets the scrolling region and homes the cursor.
* based on testing, 0+ are term characters, 0x20-0x2f puts it in esc_bad state
ldx #st_vt100
sta state
cmp #:MIN ; must be 0.
blt :bad
cmp #:MAX+1
bge :rts
asl
tax
jmp (:table,x)
:bad ldx #st_vt100_esc_bad
sta state
:rts rts
:MIN equ 48
:MAX equ 57
:table
dw :rts ; 0
dw :rts ; 1
dw :rts ; 2
dw :rts ; 3
dw :rts ; 4
dw :rts ; 5
dw :rts ; 6
dw :rts ; 7
dw :e ; 8
dw :rts ; 9
:e rts
vt100_esc_lparen ent
vt100_esc_rparen ent
* ( sets G0, ) sets G1
* A - UK set
* B - ASCII set
* 0 - Special Graphics
* 1 - Alternate Char ROM Standard Char Set
* 2 - Alternate Char ROM Special Graphics
* SO, aka Control-N aka 0x0e set the G1 char set
* SI, aka Control-O aka 0x0f set the G0 char set
* not currently supported.
ldx #st_vt100
sta state
cmp #'0'
blt :bad
rts
:bad ldx #st_vt100_esc_bad
sta state
:rts rts
sav vt100.esc.L sav vt100.esc.L

View File

@ -1,3 +1,14 @@
lst off
cas se
rel
xc
xc
use vt.equ
ext update_cursor,scroll_down
vt100 vt100
mx %11 mx %11
and #$7f and #$7f
@ -16,6 +27,8 @@ vt100
ext vt52_esc,vt52_dca_1,vt52_dca_2 ext vt52_esc,vt52_dca_1,vt52_dca_2
ext vt100_esc,vt100_csi,vt100_csi_2 ext vt100_esc,vt100_csi,vt100_csi_2
ext vt100_esc_pound,vt100_esc_lparen,vt100_esc_rparen ext vt100_esc_pound,vt100_esc_lparen,vt100_esc_rparen
ext vt100_esc_bad,vt100_csi_bad
ext char
dw char dw char
dw vt52_esc dw vt52_esc
@ -28,6 +41,8 @@ vt100
dw vt100_esc_pound dw vt100_esc_pound
dw vt100_esc_lparen dw vt100_esc_lparen
dw vt100_esc_rparen dw vt100_esc_rparen
dw vt100_esc_bad
dw vt100_csi_bad
:ctrl_table :ctrl_table
@ -100,24 +115,20 @@ ctrl_1a
sta state sta state
rts rts
ctrl_08 ; back space
ldx x
beq :rts
dec x
jmp update_cursor
:rts
ctrl_09 ; tab ctrl_09 ; tab
* vt100 has adjustable tabs. * vt100 has adjustable tabs.
ext tab_table ext next_tab_stop
ldx x ldx x
lp: jsr next_tab_stop
cpx #79
bcs :rts
lda tab_table,x
bne :hit
inx
bra :lp
stx x stx x
jmp update_cursor jmp update_cursor
:rts rts
ctrl_0a ; line feed - cursor down w/ scroll ctrl_0a ; line feed - cursor down w/ scroll
ctrl_0b ; vertical tab ctrl_0b ; vertical tab
@ -145,3 +156,6 @@ ctrl_0c ; form feed.
ctrl_0d ; carriage return - cursor to column 0. ctrl_0d ; carriage return - cursor to column 0.
stz x stz x
jmp update_cursor jmp update_cursor
sav vt100.main.L