From 02afdec2658fe6ea10210761cd0a0953e300d185 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 8 Jan 2020 23:24:39 +0100 Subject: [PATCH] bugfixed character delete --- c64/kernal/screen/chrout_screen_del.s | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/c64/kernal/screen/chrout_screen_del.s b/c64/kernal/screen/chrout_screen_del.s index 0eac4831..4ab5572b 100644 --- a/c64/kernal/screen/chrout_screen_del.s +++ b/c64/kernal/screen/chrout_screen_del.s @@ -12,7 +12,7 @@ chrout_screen_DEL: jmp chrout_screen_quote !: ldy PNTR - bne chrout_screen_del_column_non_0 + bne chrout_screen_del_column_normal // FALLTROUGH @@ -35,18 +35,26 @@ chrout_screen_del_column_0: sta (PNT),y // Finish with recalculating all the variables - jmp chrout_screen_calc_lptr_done + bne chrout_screen_del_done -chrout_screen_del_column_non_0: +chrout_screen_del_column_normal: // We need to scroll back the rest of the logical line - // YYY does not work properly when cursor crosses physical line boundary - // YYY possibly it should remove the 'continuaed line' mark in some cases, test on original ROMs + // First reduce PNTR to 0-39 range + jsr screen_get_clipped_PNTR + sty PNTR + // Now get the offset to the last logical line character jsr screen_get_logical_line_end_ptr tya + + // Substract the PNTR value, this will tell us how many characters we need to move + sec + sbc PNTR tax + + // Perform the character copy (scroll back) in a loop ldy PNTR dey !: @@ -61,9 +69,8 @@ chrout_screen_del_column_non_0: iny dex - cpx PNTR - bne !- -!: + bpl !- + // Clear char at end of line (just the character - not color!) jsr screen_get_logical_line_end_ptr @@ -75,4 +82,4 @@ chrout_screen_del_column_non_0: chrout_screen_del_done: - jmp chrout_screen_done + jmp chrout_screen_calc_lptr_done