fixed DEL key on the first column of the second part of logical line

This commit is contained in:
FeralChild64 committed 2020-01-12 12:13:17 +01:00
1 parent 33b8e2537e
commit bb60a10f51
8 files changed
+79 -47

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+79 -47
View File
@@ -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