From 933bcac9781e60fbac488b14adfef52661e04cc4 Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Mon, 22 Apr 2019 00:10:26 +0930 Subject: [PATCH] fix screen scrolling bugs --- c64/kernal/chrout.s | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/c64/kernal/chrout.s b/c64/kernal/chrout.s index 58680503..280a9f76 100644 --- a/c64/kernal/chrout.s +++ b/c64/kernal/chrout.s @@ -234,8 +234,6 @@ scroll_screen_up: ;; Now scroll the whole screen up either one or two lines ;; based on whether the first screen line is linked or not. - jsr hide_cursor_if_visible - ;; Get pointers to start of screen + colour RAM lda HIBASE sta current_screen_line_ptr+1 @@ -279,7 +277,8 @@ scroll_copy_loop: ;; Copy last partial page ;; We need to copy 1000-(3*256)-line length ;; = 232 - line length - lda 232 + lda load_or_scroll_temp_pointer+0 + lda #232 sec sbc load_or_scroll_temp_pointer+0 tax @@ -291,6 +290,17 @@ scroll_copy_loop2: iny dex bne scroll_copy_loop2 + + ;; Fill in scrolled up area + ldx load_or_scroll_temp_pointer+0 +scroll_copy_loop3: + lda #$20 + sta (current_screen_line_ptr),y + lda text_colour + sta (current_screen_line_colour_ptr),y + iny + dex + bne scroll_copy_loop3 ;; Shift line linkage list ldy #0 @@ -304,25 +314,6 @@ link_copy: ;; Clear line link flag of last line stx screen_line_link_table+24 - ;; Now erase last line - lda HIBASE - clc - adc #3 - sta current_screen_line_ptr+1 - lda #>$DBC0 - sta current_screen_line_colour_ptr+1 - lda #$c0 - sta current_screen_line_ptr+0 - sta current_screen_line_colour_ptr+0 -clear_current_physical_line: - ldy #39 -* lda #$20 - sta (current_screen_line_ptr),y - lda text_colour - sta (current_screen_line_colour_ptr),y - dey - bpl - - ;; Restore correct line pointers jsr calculate_screen_line_pointer