bug fixes.

This commit is contained in:
Kelvin Sherlock 2021-09-25 11:05:06 -04:00
parent 63cac578bd
commit 121673badb
3 changed files with 135 additions and 85 deletions

20
debug.S
View File

@ -1,24 +1,8 @@
debug mac debug mac
brl ]eom brl eom
dw $7771 dw $7771
str ']1' str ']1'
]eom eom
<<< <<<
*debuglab mac
*]1
* brl ]eom
* dw $7771
* str ']1'
*]eom
* <<<
*debugent mac
*]1 ent
* brl ]eom
* dw $7771
* str ']1'
*]eom
* <<<

View File

@ -1,6 +1,6 @@
lst off * lst off
cas se cas se
rel rel
@ -8,6 +8,7 @@
xc xc
use vt.equ use vt.equ
use debug
mx %11 mx %11
@ -15,6 +16,8 @@
ext recalc_cursor,recalc_cursor_x,recalc_cursor_y ext recalc_cursor,recalc_cursor_x,recalc_cursor_y
vt100_csi ent vt100_csi ent
debug vt100_csi
* 0123456789;ycnlhgrqJKmABCDHf * 0123456789;ycnlhgrqJKmABCDHf
* based on testing - * based on testing -
@ -153,6 +156,7 @@ vt100_csi_bad ent
vt100_csi_2 ent vt100_csi_2 ent
debug vt100_csi_2
cmp #:MIN cmp #:MIN
blt :end blt :end
@ -160,6 +164,8 @@ vt100_csi_2 ent
bge :end bge :end
sec sec
sbc #:MIN sbc #:MIN
asl
tax
jmp (:table,x) jmp (:table,x)
:badmod :badmod
@ -478,6 +484,10 @@ csi_D
csi_f csi_f
csi_H ; direct cursor addressing csi_H ; direct cursor addressing
debug csi_H
* honors origin * honors origin
* large numbers are clamped * large numbers are clamped
* 0 or 1 treated as 1 (1-based counting) * 0 or 1 treated as 1 (1-based counting)

View File

@ -9,10 +9,14 @@
mx %11 mx %11
ext recalc_cursor,recalc_cursor_x,recalc_cursor_y
ext scroll_up,scroll_down
vt100_esc ent vt100_esc ent
* #[()=>cH78DEM * #[()=>cH78DEM
* based on testing, unspecified chars in the 0x20-0x2f range cause it to gobble * based on testing, unspecified chars in the 0x20-0x2f range cause it
* chars until 0x30- terminator (which ends the sequence but does not take an action) * to gobble chars until 0x30- terminator (which ends the sequence but
* does not take an action)
* esc 1 -> hangs? [undocumented] * esc 1 -> hangs? [undocumented]
@ -95,7 +99,7 @@ vt100_esc ent
dw :rts ; X dw :rts ; X
dw :rts ; Y dw :rts ; Y
dw :rts ; Z dw :rts ; Z
dw :rts ; [ dw :csi ; [
dw :rts ; \ dw :rts ; \
dw :rts ; ] dw :rts ; ]
dw :rts ; ^ dw :rts ; ^
@ -122,6 +126,11 @@ vt100_esc ent
stx state stx state
rts rts
:csi
ldx #st_vt100_csi
stx state
rts
esc_7 ; save cursor position, graphic rendition, and character set. esc_7 ; save cursor position, graphic rendition, and character set.
rts rts
@ -144,13 +153,45 @@ esc_H ; set tab stop
:rts rts :rts rts
esc_E ; next line esc_E ; next line
* This sequence causes the active position to move to the first position
* on the next line downward. If the active position is at the bottom
* margin, a scroll up is performed.
stz x stz x
jsr recalc_cursor_x
; drop through ; drop through
esc_D ; index esc_D ; index
rts * This sequence causes the active position to move downward one line
* without changing the column position. If the active position is at the
* bottom margin, a scroll up is performed.
lda y
cmp DECBM
beq :scroll
cmp #23
beq :rts
inc y
jmp recalc_cursor_y
:scroll jmp scroll_down
:rts rts
esc_M ; reverse index esc_M ; reverse index
rts * Move the active position to the same horizontal position on the
* preceding line. If the active position is at the top margin, a scroll
* down is performed.
lda y
cmp DECTM
beq :scroll
cmp #0
beq :rts
dec y
jmp recalc_cursor_y
:scroll jmp scroll_up
:rts rts
esc_c ; reset terminal. esc_c ; reset terminal.
rts rts
@ -174,23 +215,27 @@ vt100_esc_pound ent
* esc # 6 - make line double width * esc # 6 - make line double width
* esc # 8 - screen alignment - fill screen with E (SGR not honored) * 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, 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 * based on testing, 0+ are term characters, 0x20-0x2f puts it in
* esc_bad state
ldx #st_vt100 ldx #st_vt100
sta state stx state
cmp #:MIN ; must be 0. cmp #:MIN
blt :bad blt :bad
cmp #:MAX+1 cmp #:MAX+1
bge :rts bge :rts
sec
sbc #:MIN
asl asl
tax tax
jmp (:table,x) jmp (:table,x)
:bad ldx #st_vt100_esc_bad :bad ldx #st_vt100_esc_bad
sta state stx state
:rts rts :rts rts
:MIN equ 48 :MIN equ 48
@ -208,7 +253,18 @@ vt100_esc_pound ent
dw :e ; 8 dw :e ; 8
dw :rts ; 9 dw :rts ; 9
:e rts :e
* TODO - does this reset DECOM?
ext fill_screen
stz x
stz y
stz DECTM
lda #23
sta DECBM
jsr recalc_cursor
lda #"E"
jmp fill_screen
vt100_esc_lparen ent vt100_esc_lparen ent
@ -227,14 +283,14 @@ vt100_esc_rparen ent
* not currently supported. * not currently supported.
ldx #st_vt100 ldx #st_vt100
sta state stx state
cmp #'0' cmp #'0'
blt :bad blt :bad
rts rts
:bad ldx #st_vt100_esc_bad :bad ldx #st_vt100_esc_bad
sta state stx state
:rts rts :rts rts
sav vt100.esc.L sav vt100.esc.L