vt52 might be more or less complete now.

This commit is contained in:
Kelvin Sherlock 2021-09-24 21:52:42 -04:00
parent 73722a2c02
commit 63cac578bd
3 changed files with 122 additions and 11 deletions

View File

@ -259,9 +259,13 @@ ctrl_0c ; form feed.
* if LNM mode, need to update cursor as well.
:simple
cmp #23
beq :rts
inc y
jmp recalc_cursor_y
:rts rts
ctrl_0d ; carriage return - cursor to column 0.
stz x
jmp recalc_cursor_x

View File

@ -288,7 +288,12 @@ draw_char ent
rts
* erase screen commands are not affected by origin or scrolling region.
erase_screen ent
erase_screen_2 ent
* erase the entire screen.
mx %11
lda erase_char
* fall through
@ -618,10 +623,99 @@ erase_line_1 ent
:exit plp
rts
erase_screen_0 ent
* erase cursor to end of screen.
mx %11
jsr erase_line_0
php
rep #$30
* erase screen commands are not affected by origin or scrolling region.
* erase screen
* erase start -> cursor
* erase cursor -> end
lda y
inc
cmp #24
bcs :exit
asl
tay
lda erase_char
:loop
sty r0
ldx text,y
ldy #19
:loop0
sta >$000000,x
inx
inx
dey
bpl :loop0
ldy r0
ldx text,y
ldy #19
:loop1
sta >$010000,x
inx
inx
dey
bpl :loop1
ldy r0
iny
iny
cpy #24*2
bcc :loop
:exit
plp
rts
erase_screen_1 ent
* erase beginning of screen to cursor.
mx %11
jsr erase_line_1
php
rep #$30
lda y
dec
bmi :exit
asl
tay
lda erase_char
:loop
sty r0
ldx text,y
ldy #19
:loop0
sta >$000000,x
inx
inx
dey
bpl :loop0
ldy r0
ldx text,y
ldy #19
:loop1
sta >$010000,x
inx
inx
dey
bpl :loop1
ldy r0
dey
dey
bpl :loop
:exit
plp
rts
rts
sav vt100.screen.L

View File

@ -17,7 +17,7 @@
ext write_modem,draw_char
ext advance_x,recalc_cursor,recalc_cursor_x,recalc_cursor_y
ext scroll_up,scroll_down
vt52_esc ent
* ABCDFGHIJKYZ<>=
@ -142,18 +142,31 @@ esc_D ; cursor left
esc_I ; cursor up w/ line scroll
* based on testing, scrolling only occurs within the
* scroll region.
rts
esc_J rts
esc_K rts
lda y
cmp DECTM
beq :scroll
cmp #0
beq :rts
dec y
jmp recalc_cursor_y
:scroll jmp scroll_up
:rts rts
esc_J
* erase cursor to end of screen.
ext erase_screen_0
jmp erase_screen_0
rts
esc_K
* erase cursor to end of line
ext erase_line_0
jmp erase_line_0
esc_H ; cursor home
; based on testing, does not respect scrolling region but does
; respect origin mode.
stz x
* stz y
* bit DECOM
* bpl :go
lda DECTM
sta y