diff --git a/028.bs/constants.i b/028.bs/constants.i index 9b24710..f15f094 100644 --- a/028.bs/constants.i +++ b/028.bs/constants.i @@ -53,6 +53,7 @@ ITEM_SPRITE_NUM_VERTICAL_SPRITES equ 6 ITEM_SPRITE_VERTICAL_BYTES equ ((ITEM_SPRITE_HEIGHT*4)+4) ITEM_SPRITE_VERTICAL_BYTES_SHIFT_CONVERT equ 6 ITEM_SPRITE_BYTES equ (ITEM_SPRITE_NUM_VERTICAL_SPRITES*ITEM_SPRITE_VERTICAL_BYTES)+4 +ITEM_SINGLE_SPRITE_BYTES equ (ITEM_SPRITE_VERTICAL_BYTES)+4 ITEM_SPRITE_VSTART equ 149 ITEM_NUM_BEES equ 2 ITEM_NUM_SLOTS equ ((8*3)+ITEM_NUM_BEES) diff --git a/028.bs/items.s b/028.bs/items.s index 725b608..c168129 100644 --- a/028.bs/items.s +++ b/028.bs/items.s @@ -25,9 +25,10 @@ DeleteItemSprite: move.w ITEM_Y(a1),d2 rts + VerticalScrollBees: bsr VerticalScrollDownBee - bsr VerticalScrollUpBee + bsr VerticalScrollUpBee rts VerticalScrollDownBee: @@ -345,8 +346,24 @@ _SetupItemSpriteData: move.w ITEM_INDEX(a1),d0 lsr.l #3,d0 + + cmp.l #item25,a1 + beq .singleSprite + cmp.l #item26,a1 + beq .singleSprite mulu.w #ITEM_SPRITE_BYTES*2,d0 add.w spriteBufferIndex,d0 + bra .continueSingleSprite +.singleSprite: + mulu.w #ITEM_SINGLE_SPRITE_BYTES*2,d0 + cmp.w #0,spriteBufferIndex + beq .continueSingleSprite + add.w #ITEM_SINGLE_SPRITE_BYTES,d0 + + +.continueSingleSprite: + + adda.w d0,a0 lsl.w #ITEM_SPRITE_VERTICAL_BYTES_SHIFT_CONVERT,d2 @@ -400,9 +417,9 @@ _SetupItemSpriteData: sub.l d3,a0 ;#1*ITEM_SPRITE_VERTICAL_BYTES,a0 or 0 for bee cmp.b #ITEM_SPRITE_BEE_UP_INDEX,d4 - bge .beeUpSprite + beq .beeUpSprite cmp.b #ITEM_SPRITE_BEE_DOWN_INDEX,d4 - bge .beeDownSprite + beq .beeDownSprite cmp.b #ITEM_SPRITE_ARROW_INDEX,d4 bge .arrowSprite cmp.b #ITEM_SPRITE_COINB_INDEX,d4 @@ -432,7 +449,7 @@ _SetupItemSpriteData: bsr InstallBeePalette bra .dontAnimateUpBee .dontAnimateDownBee: - cmp.w #1,beeDownMovingDown + cmp.w #1,beeDownMovingDown beq .setBeeDown bra .setBeeUp .dontAnimateUpBee: @@ -585,11 +602,11 @@ beeDownMovingDown: ItemSprite spriteArrow7,sprite_arrow-1.bin ItemSprite spriteArrow8,sprite_arrow-1.bin - ItemSprite spriteBeeDown1,sprite_bee-1.bin - ItemSprite spriteBeeDown2,sprite_bee-0.bin - - ItemSprite spriteBeeUp1,sprite_bee-0.bin - ItemSprite spriteBeeUp2,sprite_bee-1.bin + ItemSingleSprite spriteBeeDown1,sprite_bee-1.bin + ItemSingleSprite spriteBeeDown2,sprite_bee-0.bin + + ItemSingleSprite spriteBeeUp1,sprite_bee-0.bin + ItemSingleSprite spriteBeeUp2,sprite_bee-1.bin nextSpriteSlot: dc.w 0 diff --git a/028.bs/macros.i b/028.bs/macros.i index b58e9f9..3e80ccc 100644 --- a/028.bs/macros.i +++ b/028.bs/macros.i @@ -78,6 +78,20 @@ _ItemSprite: macro endm +ItemSingleSprite: macro + _ItemSingleSprite \1,\2 + _ItemSingleSprite \1_1,\2 + endm + +_ItemSingleSprite: macro +\1: + dc.b ITEM_SPRITE_VSTART ; vstart + dc.b 0 ; hstart + dc.b ITEM_SPRITE_VSTART+ITEM_SPRITE_HEIGHT; vstop + dc.b 0 + incbin "out/\2" + dc.l 0 + endm ItemControl: macro align 4