mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-06-18 06:29:27 +00:00
Clean up constants and fix bad addressing mode
This commit is contained in:
parent
4f557230c6
commit
e6251f05a3
|
@ -95,9 +95,9 @@ ToolNum equ 114 ; Tool number assigned to us
|
|||
LastKey equ 116
|
||||
LastTick equ 118
|
||||
ForceSpriteFlag equ 120
|
||||
SpriteRemovedFlag equ 122 ; Indicate if any sprites were removed this frame
|
||||
|
||||
|
||||
;VBuffArrayPtr equ 122
|
||||
SpriteRemovedFlag equ 126 ; Indicate if any sprites were removed this frame
|
||||
|
||||
activeSpriteList equ 128 ; 32 bytes for the active sprite list (can persist across frames)
|
||||
; tiletmp equ 178 ; 16 bytes of temp storage for the tile renderers
|
||||
|
@ -206,8 +206,8 @@ SPRITE_HFLIP equ $0200
|
|||
VBUFF_STRIDE_BYTES equ {12*4} ; Each line has 4 slots of 16 pixels + 8 buffer pixels
|
||||
VBUFF_TILE_ROW_BYTES equ {8*VBUFF_STRIDE_BYTES} ; Each row is comprised of 8 lines
|
||||
VBUFF_TILE_COL_BYTES equ 4
|
||||
VBUFF_SPRITE_STEP equ {VBUFF_TILE_ROW_BYTES*3} ; Allocate space fo 16 rows + 8 rows of buffer
|
||||
VBUFF_SPRITE_START equ {8*VBUFF_TILE_ROW_BYTES}+4 ; Start at an offset so $0000 can be used as an empty value
|
||||
VBUFF_SPRITE_STEP equ {VBUFF_TILE_ROW_BYTES*3} ; Allocate space for 16 rows + 8 rows of buffer
|
||||
VBUFF_SPRITE_START equ {VBUFF_TILE_ROW_BYTES+4} ; Start at an offset so $0000 can be used as an empty value
|
||||
VBUFF_SLOT_COUNT equ 48 ; Have space for this many stamps
|
||||
|
||||
; This is 13 blocks wide
|
||||
|
|
|
@ -42,8 +42,8 @@ InitSprites
|
|||
bcc :loop4
|
||||
|
||||
; Precalculate some bank values
|
||||
jsr _CacheSpriteBanks
|
||||
rts
|
||||
jsr _CacheSpriteBanks
|
||||
rts
|
||||
|
||||
; _RenderSprites
|
||||
;
|
||||
|
@ -585,7 +585,7 @@ _PrecalcAllSpriteInfo
|
|||
lda _Sprites+VBUFF_ADDR,x
|
||||
clc
|
||||
adc _stamp_step,y
|
||||
sta _Sprites+SPRITE_DISP,y
|
||||
sta _Sprites+SPRITE_DISP,x
|
||||
|
||||
; Set the sprite's width and height
|
||||
lda #4
|
||||
|
|
|
@ -171,9 +171,9 @@ _CalcDirtySprite
|
|||
mdsOut rts
|
||||
|
||||
|
||||
; NOTE: The VBuffArrayAddr lookup table is set up so that each sprite's vbuff address is stored in a
|
||||
; parallel structure to the Tile Store. This allows up to use the same TileStoreLookup offset
|
||||
; to index into the array of 16 sprite VBUFF addresses that are bound to a given tile
|
||||
; NOTE: The VBuffArray table is set up so that each sprite's vbuff address is stored in a
|
||||
; parallel structure to the Tile Store. This allows up to use the same TileStoreLookup
|
||||
; offset to index into the array of 16 sprite VBUFF addresses that are bound to a given tile
|
||||
_MarkDirtySpriteTiles
|
||||
lda _SpriteBits,y
|
||||
sta SpriteBit
|
||||
|
@ -224,8 +224,8 @@ COL equ 2 ; This many bytes for each e
|
|||
|
||||
:mark1x1
|
||||
ldx _Sprites+VBUFF_ARRAY_ADDR,y ; get the address of this sprite's vbuff values
|
||||
lda _Sprites+TS_VBUFF_BASE,y ; get the starting vbuff address
|
||||
sta: {0*ROW}+{0*COL},x ; Put in the vbuff address
|
||||
lda _Sprites+TS_VBUFF_BASE,y ; get the starting vbuff address
|
||||
sta: {0*ROW}+{0*COL},x ; Put in the vbuff address
|
||||
|
||||
ldx _Sprites+TS_LOOKUP_INDEX,y
|
||||
TSSetSprite 0*{TS_LOOKUP_SPAN*2}
|
||||
|
|
|
@ -412,7 +412,7 @@ ScreenModeHeight ENT
|
|||
; we allocate 8 sprites in the first row and 8 more sprites in the 4th row. So we need to allocate a
|
||||
; total of 6 rows of TileStore space
|
||||
;
|
||||
; It is *critical* that this array be placed in a memory location that is greated than the largest
|
||||
; It is *critical* that this array be placed in a memory location that is greater than the largest
|
||||
; TileStore offset.
|
||||
VBuffArray ENT
|
||||
ds 6*{TILE_STORE_WIDTH*2}
|
||||
|
|
Loading…
Reference in New Issue
Block a user