include "includes.i" xdef SetupItemSpriteData xdef ScrollItemSprites xdef RenderItemSprite ScrollItemSprites: ;; sub.w #1,itemX move.l foregroundScrollPixels,d0 sub.w d0,itemX rts SetupItemSpriteData: move.l currentItemSprite,a0 cmp.w #13<<3,itemIndex ble .dontResetIndex move.l #0,itemIndex .dontResetIndex: cmp.l #deadSprite,a0 bne .setupSprite bra .c1 .setupSprite: move.l #0,d0 move.w itemIndex,d0 lsr.l #3,d0 mulu.w #64+12,d0 add.l d0,a0 move.w itemLagX,d0 lsr.w #FOREGROUND_SCROLL_SHIFT_CONVERT,d0 ; convert to pixels move.w itemX,itemLagX add.w #32,d0 move.w d0,d1 andi #1,d1 move.b d1,3(a0) ;spriteControl lsr.l #1,d0 move.b d0,1(a0) ;spriteHStart move.w itemLagY,d0 move.w itemY,itemLagY move.b d0,(a0) ;spriteVStart move.w itemLagYEnd,d0 move.w itemYEnd,itemLagYEnd move.b d0,2(a0) ;spriteVStop .c1: move.l a0,SPR2PTH(a6) add.w #1,itemIndex rts RenderItemSprite: ;; d2 - y tile index ? movem.l d2-d3,-(sp) move.l foregroundScrollX,d0 lsr.w #FOREGROUND_SCROLL_SHIFT_CONVERT,d0 ; convert to pixels andi.w #$f,d0 cmp.b #$f,d0 bne .dontAddSprite move.l a2,a3 add.l mapSize,a3 cmpi.w #0,(a3) beq .dontAddSprite move.l #deadSprite,currentItemSprite move.w #337<