TalkingCat
Member
Perhaps someone will come in handy. Doesn't draw empty tiles for gameObject tile #$7F and Monster graphic tile #$FF
Code snippet for inserting into MetroidvaniaMod [4.5.9] script doDrawSprites_PlatformBase.asm
Code snippet for inserting into MetroidvaniaMod [4.5.9] script doDrawSprites_PlatformBase.asm
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
doDrawSpritesLoop:
LDA (temp16),y
clc
ADC temp3
STA tempC ;; the calculated table position, with offest.
;; tempC becomes the "tile to draw".
INY
LDA (temp16),y
STA tempD ;; the next value is the attribute to draw.
INY ;; increasing again sets us up for the next sprite.
;; now we can use tempA-D to draw our sprite using the macro.
LDA tempC
CMP #$7F
BEQ +
CMP #$FF
BEQ +
;;;;;;;;;;;; Here, we need to evaluate if this tile should be drawn
;;;;;;;;;;;; based on the comparison to camX.
JSR evaluateTileAgainstCameraPosition
BEQ thisTileIsInCamRange
JMP thisTileIsOffScreen
thisTileIsInCamRange
DrawSprite tempA, tempB, tempC, tempD
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
thisTileIsOffScreen: