CHROUT screen output routine split, size and performance optimizations
This commit is contained in:
1 parent
a442bf910f
commit
2cc6587b5c
8 files changed
+627
-521
No files matched your search
@@ -0,0 +1,63 @@
|
||||
|
||||
//
|
||||
// CHROUT routine - screen support, DEL key handling
|
||||
//
|
||||
|
||||
chrout_screen_del:
|
||||
|
||||
// In insert mode it embeds control character
|
||||
ldx INSRT
|
||||
beq !+
|
||||
jmp chrout_screen_quote
|
||||
!:
|
||||
ldx PNTR
|
||||
bne chrout_screen_del_column_non_0
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
chrout_screen_del_column_0:
|
||||
|
||||
ldy TBLX
|
||||
beq chrout_screen_del_done // delete from row 0, col 0 does nothing
|
||||
|
||||
// Column 0 delete just moves us to the end of the
|
||||
// previous line, without actually deleting anything
|
||||
|
||||
dec TBLX
|
||||
jsr get_current_line_logical_length
|
||||
lda LNMX
|
||||
sta PNTR
|
||||
|
||||
jmp chrout_screen_control_calcptr_done
|
||||
|
||||
chrout_screen_del_column_non_0:
|
||||
|
||||
// Copy rest of line down
|
||||
jsr get_current_line_logical_length
|
||||
ldy PNTR
|
||||
cpy LNMX
|
||||
beq !++
|
||||
dey
|
||||
!:
|
||||
iny
|
||||
lda (PNT),y
|
||||
dey
|
||||
sta (PNT),y
|
||||
iny
|
||||
lda (USER),y
|
||||
dey
|
||||
sta (USER),y
|
||||
iny
|
||||
cpy LNMX
|
||||
bne !-
|
||||
|
||||
// Clear char at end of line
|
||||
jsr get_current_line_logical_length
|
||||
tay
|
||||
lda #$20
|
||||
sta (PNT),y
|
||||
!:
|
||||
dec PNTR
|
||||
|
||||
chrout_screen_del_done:
|
||||
jmp chrout_done
|
||||
Reference in new issue
Block a user