Fix nasty RTable initialization bug

This commit is contained in:
Lucas Scharenbroich 2022-05-22 23:52:54 -05:00
parent 8582ecb320
commit d27b10b6fd

View File

@ -244,7 +244,7 @@ SetScreenRect sty ScreenHeight ; Save the screen height and
lda ScreenY0 ; Calculate the address of the first byte lda ScreenY0 ; Calculate the address of the first byte
asl ; of the right side of the playfield asl ; of the right side of the playfield
tax tax
lda ScreenAddr,x ; This is the address for the left edge of the physical screen lda ScreenAddr,x ; This is the address for the edge of the physical screen
clc clc
adc ScreenX1 adc ScreenX1
dec dec
@ -252,9 +252,6 @@ SetScreenRect sty ScreenHeight ; Save the screen height and
ldx #0 ldx #0
ldy ScreenHeight ldy ScreenHeight
jsr :loop
pla ; Reset the address and continue filling in the
ldy ScreenHeight ; second half of the table
:loop clc :loop clc
sta RTable,x sta RTable,x
adc #160 adc #160
@ -263,6 +260,16 @@ SetScreenRect sty ScreenHeight ; Save the screen height and
dey dey
bne :loop bne :loop
ldy ScreenHeight
pla ; Reset the address and continue filling in the
:loop2 clc
sta RTable,x
adc #160
inx
inx
dey
bne :loop2
; Calculate the screen locations for each tile corner ; Calculate the screen locations for each tile corner
lda ScreenY0 ; Calculate the address of the first byte lda ScreenY0 ; Calculate the address of the first byte