From b3f1b7fb4121ec4a7c8579a479ee534b369c9b4c Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 9 Jan 2020 17:09:23 +0100 Subject: [PATCH] improved RETURN keyy handling, some documentation update --- c64/kernal/screen/chrout_screen_del.s | 8 ++++---- c64/kernal/screen/chrout_screen_return.s | 15 +++++++++++++++ c64/kernal/screen/screen_grow_logical_line.s | 1 + c64/kernal/screen/screen_preserve_sal_eal.s | 12 ++++++++++-- c64/kernal/screen/screen_restore_sal_eal.s | 12 ++++++++++-- 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/c64/kernal/screen/chrout_screen_del.s b/c64/kernal/screen/chrout_screen_del.s index 4ab5572b..2b02b6af 100644 --- a/c64/kernal/screen/chrout_screen_del.s +++ b/c64/kernal/screen/chrout_screen_del.s @@ -58,15 +58,15 @@ chrout_screen_del_column_normal: ldy PNTR dey !: - iny - lda (PNT),y - dey - sta (PNT),y iny lda (USER),y dey sta (USER),y iny + lda (PNT),y + dey + sta (PNT),y + iny dex bpl !- diff --git a/c64/kernal/screen/chrout_screen_return.s b/c64/kernal/screen/chrout_screen_return.s index b870cd5b..283c4389 100644 --- a/c64/kernal/screen/chrout_screen_return.s +++ b/c64/kernal/screen/chrout_screen_return.s @@ -7,8 +7,23 @@ chrout_screen_RETURN: // RETURN clears quote and insert modes, it also clears reverse flag + lda #$00 sta QTSW sta INSRT sta RVS + + // RETURN key moves cursor two lines down in case + // of first line of the extended logical line + + ldy TBLX + cpy #24 + beq !+ // last line on screen - no need for a double line skip + + lda LDTBL+1, y + bmi !+ // current line is not continued + + inc TBLX + jsr screen_calculate_PNT_USER +!: jmp screen_advance_to_next_line diff --git a/c64/kernal/screen/screen_grow_logical_line.s b/c64/kernal/screen/screen_grow_logical_line.s index 0c8bd8a6..5b5f39ee 100644 --- a/c64/kernal/screen/screen_grow_logical_line.s +++ b/c64/kernal/screen/screen_grow_logical_line.s @@ -1,4 +1,5 @@ +// YYY growing logical line in the last line is unstable screen_grow_logical_line_screen_up: diff --git a/c64/kernal/screen/screen_preserve_sal_eal.s b/c64/kernal/screen/screen_preserve_sal_eal.s index df92288f..175c51bc 100644 --- a/c64/kernal/screen/screen_preserve_sal_eal.s +++ b/c64/kernal/screen/screen_preserve_sal_eal.s @@ -5,11 +5,19 @@ screen_preserve_sal_eal: plx_trash_a ply_trash_a + // Note: While the following routine is obvious to any skilled + // in the art as the most obvious simple and efficient solution, + // it results in a relatively long verbatim stretch of bytes when + // compared to the C64 KERNAL. Thus we have swapped the order, + // just to reduce the potential for any argument of copyright + // infringement, even though we really do not believe that the + // routine can be copyrighted due to the lack of creativity. + lda SAL+0 pha - lda SAL+1 - pha lda EAL+0 + pha + lda SAL+1 pha lda EAL+1 pha diff --git a/c64/kernal/screen/screen_restore_sal_eal.s b/c64/kernal/screen/screen_restore_sal_eal.s index b2d95a52..cfa85fd9 100644 --- a/c64/kernal/screen/screen_restore_sal_eal.s +++ b/c64/kernal/screen/screen_restore_sal_eal.s @@ -5,13 +5,21 @@ screen_restore_sal_eal: plx_trash_a ply_trash_a + // Note: While the following routine is obvious to any skilled + // in the art as the most obvious simple and efficient solution, + // it results in a relatively long verbatim stretch of bytes when + // compared to the C64 KERNAL. Thus we have swapped the order, + // just to reduce the potential for any argument of copyright + // infringement, even though we really do not believe that the + // routine can be copyrighted due to the lack of creativity. + pla sta EAL+1 pla - sta EAL+0 - pla sta SAL+1 pla + sta EAL+0 + pla sta SAL+0 jmp screen_common_sal_eal