fix for EAL corruption

This commit is contained in:
FeralChild64 committed 2019-11-07 22:05:49 +01:00
1 parent 0e28f89806
commit 54fd24d704
10 files changed
+26 -1

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.
Binary file not shown.
Binary file not shown.
+13 -1
View File
@@ -36,7 +36,13 @@ count_rows_loop:
cpx #0 cpx #0
beq no_copy_down beq no_copy_down
bmi no_copy_down bmi no_copy_down
// Preserve EAL
lda EAL+0
pha
lda EAL+1
pha
// Set pointers to end of screen line, and one line // Set pointers to end of screen line, and one line
// above. (It is always one physical line, because // above. (It is always one physical line, because
// this can only happen when expanding a line from 40 to // this can only happen when expanding a line from 40 to
@@ -105,6 +111,12 @@ cl_inner:
dex dex
bne copy_line_down_loop bne copy_line_down_loop
// Restore EAL
pla
sta EAL+1
pla
sta EAL+0
no_copy_down: no_copy_down:
jsr screen_calculate_line_pointer jsr screen_calculate_line_pointer
@@ -28,6 +28,13 @@ is_last_line:
// FALLTHROUGH // FALLTHROUGH
scroll_screen_up: scroll_screen_up:
// Preserve EAL
lda EAL+0
pha
lda EAL+1
pha
// Now scroll the whole screen up either one or two lines // Now scroll the whole screen up either one or two lines
// based on whether the first screen line is linked or not. // based on whether the first screen line is linked or not.
@@ -88,6 +95,12 @@ scroll_copy_loop2:
dex dex
bne scroll_copy_loop2 bne scroll_copy_loop2
// Restore EAL
pla
sta EAL+1
pla
sta EAL+0
// Fill in scrolled up area // Fill in scrolled up area
ldx SAL+0 ldx SAL+0
scroll_copy_loop3: scroll_copy_loop3: