fix screen scrolling bugs

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-22 00:10:26 +09:30
1 parent d18d8c30c3
commit 933bcac978
1 file changed
+13 -22
+13 -22
View File
@@ -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