implement core of delete char in chrout

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-21 21:59:06 +09:30
1 parent 07f1a649c5
commit c23f8cef4f
2 files changed
+32 -8

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@
.alias current_screen_line_ptr $D1
.alias current_screen_x $D3
.alias quote_mode_flag $D4
.alias max_logical_line_length $D5
.alias logical_line_length $D5
.alias current_screen_y $D6
.alias last_printed_character_ascii $D7
.alias insert_mode $D8
+31 -7
View File
@@ -88,17 +88,31 @@ delete_at_column_0:
jmp chrout_done
not_row_0:
dec current_screen_y
lda screen_line_link_table,y
bpl line_not_linked_del
lda #79
.byte $2c ; BIT absolute mode, which we use to skip the next two instruction bytes
line_not_linked_del:
lda #39
jsr get_current_line_logical_length
sta current_screen_x
jsr calculate_screen_line_pointer
jmp chrout_done
delete_non_zero_column:
delete_non_zero_column:
;; Copy rest of line down
jsr get_current_line_logical_length
ldy current_screen_x
*
lda (current_screen_line_ptr),y
dey
sta (current_screen_line_ptr),y
iny
lda (current_screen_line_colour_ptr),y
dey
sta (current_screen_line_colour_ptr),y
iny
iny
cpy logical_line_length
bne -
dec current_screen_x
jmp chrout_done
not_14:
@@ -167,6 +181,16 @@ screen_grow_logical_line:
;; XXX - Scroll screen down to make space
rts
get_current_line_logical_length:
ldy current_screen_y
lda screen_line_link_table,y
bpl line_not_linked_del
lda #79
.byte $2c ; BIT absolute mode, which we use to skip the next two instruction bytes
line_not_linked_del:
lda #39
rts
screen_advance_to_next_line:
;; Go to start of line