Skip to content

Commit

Permalink
Check end-of-line and end-of-screen before EL/ED clear, fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
maccasoft committed Aug 19, 2021
1 parent 4ef5539 commit 05537ba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vt100.spin
Original file line number Diff line number Diff line change
Expand Up @@ -1083,10 +1083,10 @@ _ed cmp args, #2 wz ' clear entire screen
if_z jmp #:ed0
jmp #_done
:ed0 mov t3, txt_bcnt
sub t3, t2
sub t1, #2 ' clear screen from cursor down
wrword a, t1
djnz t3, #$-2
sub t3, t2 wz
if_nz sub t1, #2 ' clear screen from cursor down
if_nz wrword a, t1
if_nz djnz t3, #$-2
jmp #_done
:ed1 mov t3, t2 ' clear screen from cursor up
add t3, #1
Expand Down Expand Up @@ -1198,10 +1198,10 @@ _el mov t1, y ' t1 := y * 80
:el0 sub t1, x ' clear line from cursor right
sub t1, x
mov t3, #scrn_columns
sub t3, x
sub t1, #2
wrword a, t1
djnz t3, #$-2
sub t3, x wz
if_nz sub t1, #2
if_nz wrword a, t1
if_nz djnz t3, #$-2
jmp #_done
:el1 mov t3, x ' clear line from cursor left
add t3, #1
Expand Down

0 comments on commit 05537ba

Please sign in to comment.