diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index 71f93854..efcb4196 100644 Binary files a/bin/basic_generic.rom and b/bin/basic_generic.rom differ diff --git a/bin/basic_testing.rom b/bin/basic_testing.rom index fe820662..55fd256f 100644 Binary files a/bin/basic_testing.rom and b/bin/basic_testing.rom differ diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index 6a954ce5..a8c2391b 100644 Binary files a/bin/basic_ultimate64.rom and b/bin/basic_ultimate64.rom differ diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index cf7e19a0..1f749203 100644 Binary files a/bin/kernal_generic.rom and b/bin/kernal_generic.rom differ diff --git a/bin/kernal_testing.rom b/bin/kernal_testing.rom index 08620001..f7142493 100644 Binary files a/bin/kernal_testing.rom and b/bin/kernal_testing.rom differ diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 027ac19d..38ef4355 100644 Binary files a/bin/kernal_ultimate64.rom and b/bin/kernal_ultimate64.rom differ diff --git a/bin/mega65.rom b/bin/mega65.rom index 614b20de..f19d079d 100644 Binary files a/bin/mega65.rom and b/bin/mega65.rom differ diff --git a/c64/kernal/screen/chrout_screen_del.s b/c64/kernal/screen/chrout_screen_del.s index 6036228b..4bb659cf 100644 --- a/c64/kernal/screen/chrout_screen_del.s +++ b/c64/kernal/screen/chrout_screen_del.s @@ -13,10 +13,89 @@ chrout_screen_DEL: jmp chrout_screen_quote !: ldy PNTR + beq chrout_screen_del_column_0 + cpy #40 bne chrout_screen_del_column_normal // FALLTROUGH +chrout_screen_del_column_40: + + // First column of the extended line - decrement USER/PNT for copying + +#if HAS_OPCODES_65CE02 + dew USER + dew PNT +#else + lda USER+0 + bne !+ + dec USER+1 + dec PNT+1 +!: + dec USER+0 + dec PNT+0 +#endif + + // Copy characters + ldx #39 + ldy #0 + + jsr chrout_screen_del_copy_loop + + // Finish by moving the cursor left + jmp chrout_screen_CRSR_LEFT + +chrout_screen_del_column_normal: + + // We need to scroll back the rest of the logical line + + // 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 + jsr chrout_screen_del_copy_loop + + dec PNTR + + // FALLTROUGH + +chrout_screen_del_done: + + jmp chrout_screen_calc_lptr_done + +chrout_screen_del_copy_loop: + + iny + lda (USER),y + dey + sta (USER),y + iny + lda (PNT),y + dey + sta (PNT),y + iny + + dex + bpl chrout_screen_del_copy_loop + + // Clear char at end of line (just the character - not color!) + lda #$20 + sta (PNT),y + + rts + chrout_screen_del_column_0: ldy TBLX @@ -38,52 +117,5 @@ chrout_screen_del_column_0: // Finish with recalculating all the variables bne chrout_screen_del_done -chrout_screen_del_column_normal: - - // We need to scroll back the rest of the logical line - - // 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 -!: - iny - lda (USER),y - dey - sta (USER),y - iny - lda (PNT),y - dey - sta (PNT),y - iny - - dex - bpl !- - - // Clear char at end of line (just the character - not color!) - - jsr screen_get_logical_line_end_ptr - lda #$20 - sta (PNT),y - dec PNTR - - // FALLTROUGH - -chrout_screen_del_done: - - jmp chrout_screen_calc_lptr_done - #endif // ROM layout