Restrict _Refresh to only on-screen tiles

This commit is contained in:
Lucas Scharenbroich 2022-07-08 12:36:07 -05:00
parent 552d32d0fa
commit 086f462617

View File

@ -166,13 +166,44 @@ InitTiles
bpl :loop bpl :loop
rts rts
; Put everything on the dirty tile list ; Put everything visible on the dirty tile list
_Refresh _Refresh
ldx #TILE_STORE_SIZE-2 :col equ tmp0
:loop jsr _PushDirtyTileX :row equ tmp1
dex :idx equ tmp2
dex
bpl :loop jsr _OriginToTileStore
clc
txa
adc TileStoreLookupYTable,y
sta :idx
lda ScreenTileWidth
sta :col
lda ScreenTileHeight
sta :row
:oloop ldy :idx
:iloop ldx TileStoreLookup,y
jsr _PushDirtyTileX
iny
iny
dec :col
bne :iloop
lda ScreenTileWidth
sta :col
lda :idx
clc
adc #TS_LOOKUP_SPAN*2
sta :idx
dec :row
bne :oloop
rts rts
; Reset all of the tile proc values in the playfield. ; Reset all of the tile proc values in the playfield.