Fix Tile Store lookup initialization bug

This commit is contained in:
Lucas Scharenbroich 2022-06-01 21:12:54 -05:00
parent a938639c1b
commit 24ebb1f3af
2 changed files with 19 additions and 4 deletions

View File

@ -53,6 +53,8 @@ TileStoreData mac
<<<
; Create a lookup table with two runs of offsets, plus an overlap area on the end (41+41+1 = 83 = TS_LOOKUP_SPAN)
TileStoreLookup ENT
; First copy
]row equ 0
lup TILE_STORE_HEIGHT
TileStoreData ]row*2*TILE_STORE_WIDTH
@ -61,10 +63,20 @@ TileStoreLookup ENT
]row equ ]row+1
--^
; ds {TS_LOOKUP_SPAN*TS_LOOKUP_ROWS*2}
;
;TILE_STORE_WIDTH equ 41
;TILE_STORE_HEIGHT equ 26
; Second copy
]row equ 0
lup TILE_STORE_HEIGHT
TileStoreData ]row*2*TILE_STORE_WIDTH
TileStoreData ]row*2*TILE_STORE_WIDTH
dw ]row*2*TILE_STORE_WIDTH
]row equ ]row+1
--^
; Last row
TileStoreData 0*2*TILE_STORE_WIDTH
TileStoreData 0*2*TILE_STORE_WIDTH
dw 0*2*TILE_STORE_WIDTH
;-------------------------------------------------------------------------------------
;
; Other data tables

View File

@ -78,6 +78,9 @@ VBUFF_ARRAY_ADDR equ {MAX_SPRITES*40} ; Fixed address where this spri
;TILE_STORE_ADDR_10 equ {MAX_SPRITES*30}
; 51 rows by 81 columns + 2 extra rows and columns for sprite sizes
;
; 53 rows = TILE_STORE_HEIGHT + TILE_STORE_HEIGHT + 1
; 83 cols = TILE_STORE_WIDTH + TILE_STORE_WIDTH + 1
TS_LOOKUP_WIDTH equ 81
TS_LOOKUP_HEIGHT equ 51
TS_LOOKUP_BORDER equ 2