prep for multiple items and background scroll in

This commit is contained in:
alpine9000
2016-05-05 16:11:11 +10:00
parent 3b77fd8eaf
commit ee864ec385
10 changed files with 76 additions and 31 deletions
+11
View File
@@ -43,6 +43,10 @@ IMAGES=foreground.png \
sprite_coin-1.png \
sprite_coin-2.png \
sprite_coin-3.png\
sprite_arrow-0.png \
sprite_arrow-1.png \
sprite_arrow-2.png \
sprite_arrow-3.png\
sprite_fallingPig-0.png \
sprite_fallingPig-1.png \
sprite_fallingPig-2.png \
@@ -110,6 +114,10 @@ out/sprite_fallingTank-%.bin: out/sprite_fallingTank-%.png
out/sprite_coin%.bin: out/sprite_coin%.png
$(IMAGECON) --input $< $(IMAGECON_ARGS) --colors 4 --output-bitplanes --output-palette --full-color-palette-file --output-palette-asm --output-palette --output-png --output-copperlist --output out/sprite_coin$* --palette-offset 20 --use-palette=assets/coin.pal
out/sprite_arrow%.bin: out/sprite_arrow%.png
$(IMAGECON) --input $< $(IMAGECON_ARGS) --colors 4 --output-bitplanes --output-palette --full-color-palette-file --output-palette-asm --output-palette --output-png --output-copperlist --output out/sprite_arrow$* --palette-offset 24 --use-palette=assets/arrow.pal
out/sprite_pig%.png: assets/assets.png
../tools/croppa/out/croppa --input=assets/assets.png --output=out/sprite_pig --width=16 --height=16 --rows=1 --cols=8 --dx=16 --dy=16 --x=192 --y=112
@@ -131,6 +139,9 @@ out/sprite_fallingTank%.png: assets/assets.png
out/sprite_coin%.png: assets/assets.png
../tools/croppa/out/croppa --input=assets/assets.png --output=out/sprite_coin --width=16 --height=15 --rows=1 --cols=4 --dx=16 --dy=16 --x=192 --y=144
out/sprite_arrow%.png: assets/assets.png
../tools/croppa/out/croppa --input=assets/assets.png --output=out/sprite_arrow --width=16 --height=15 --rows=1 --cols=4 --dx=16 --dy=16 --x=192 --y=160
out/font%.bin: assets/font%.png
$(IMAGECON) --input $< $(IMAGECON_ARGS) --output-bitplanes --output-grey-palette-asm --output-palette-asm --output-palette --output out/font$* --colors=16 --use-palette assets/mpanel.pal --full-color-palette-file --output-mask --transparent-color=0,0,0 --output-png
+4
View File
@@ -0,0 +1,4 @@
000 000 000 255
004 050 117 255
020 155 173 255
030 236 255 255
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

+1 -1
View File
@@ -5,7 +5,7 @@
</tileset>
<layer name="background" width="200" height="16">
<data encoding="base64" compression="zlib">
eJztmssNwjAMQLsANxYA8VsAym8FPgvADrD/AfeAhKKS2olLi/oO74CUhuRZTWI326Ioxh/Mgt/f2CrbVcyFhbAUVsr+bsK9YWyWMaTMCRe4aKJ06GMn7IWDcFQ+8xCeTmN++9PEAxe4yJ1XxUSYKtuehLNwEa5O//+reOBi2C5S35e1sOlwThXW9z4WjxIXuKhx4bl2eKLZv73XQFzgIqTLfS0X7/0ZF7iwUlcvGCq4wEVITr3gk1EP5oILXPwT2jzKUhOJ4dUPLnChJacOrs2jLDWR2HrUdm0FF7jwpC/17z6AC1z0CfJLXFhcpJzB2vgu3xbh/hrLL3GBi7BdyhnM+h3GOw9qKw64wIUH1nNiTh5Ul1/F4qC9b4oLXOSSWouw3DNOuZPcFIfQhcc9aFwMy8ULfVgzRw==
eJztmssNwjAMhrsA4sICIF4LQMtjBR4LwA6w/wH3gFRFJbEdhwbyH74DUhqSz2oSu2mqqpp0mDu/P9Ew27UsiCWxItbM/m7EPTA2yRg0c4ILuAhRG/SxI/bEgTgyn3kQT6Mxv/1x4gEXcBE7r5YpMWO2PRFn4kJcjf7/W/GAi7JdjJV9bojtgHNqkb73vnjUzD7goiwX2vcjNZz923oNtFxH4eI/XAy5r8VivT/DBVxI6asXlApcwIVLTL2gyyiDucAFXPwS3DxKUhPxYdUPXMAFl5g6ODePktREfOtR6toKXMCFJbnUv3MALuAiJ5BfwoXEheYMluK7fCrc/dWXX8IFXLjtNGcw6XcY6zwoVRzgAi4skJ4TY/KgvvzKFwfufVO4gItYtLUIyT1jzZ3kUBxcFxb3oOGiLBcv7ZMzAQ==
</data>
</layer>
</map>
+3 -4
View File
@@ -34,7 +34,7 @@ ITEM_SPRITE_NUM_VERTICAL_SPRITES equ 6
ITEM_SPRITE_VERTICAL_BYTES equ ((ITEM_SPRITE_HEIGHT*4)+4)
ITEM_SPRITE_BYTES equ (ITEM_SPRITE_NUM_VERTICAL_SPRITES*ITEM_SPRITE_VERTICAL_BYTES)+4
ITEM_SPRITE_VSTART equ 149
ITEM_NUM_SLOTS equ 8
ITEM_NUM_SLOTS equ 16
ITEM_SPRITE_HORIZONTAL_START_PIXELS equ 32
ITEM_SPRITE_Y_COLLISION_OFFSET equ 1
@@ -43,9 +43,8 @@ ITEM_X equ 0
ITEM_LAGX equ 2
ITEM_Y equ 4
ITEM_SPRITE equ 6
ITEM_YEND equ 8
ITEM_LAGYEND equ 10
ITEM_INDEX equ 12
ITEM_INDEX equ 8
ITEM_SPRITE_ADDRESS equ 12
ITEM_STRUCT_SIZE equ 16
ITEM_STRUCT_MULU_SHIFT equ 4
ITEM_NUM_COIN_ANIMS equ 7
+1 -1
View File
@@ -18,7 +18,7 @@
</layer>
<layer name="items" width="100" height="8">
<data encoding="base64" compression="zlib">
eJxjYBgFgw04MuLnE1JPCDgRqZ5YdcMdgMKX2DBGV+dKhD6QHucREtbUSFOwMMYVJy6MqGpJzR/YzBkFhIErI+G4QY8PUuOHmPxEKhjK5RzI7cgYBMipP2Bq3MgIC3L0UBOQEn+DJa5JLZPcqaie3PJwFIwCagMAfEgLSw==
eJxjYBgFgxk4MTIwODLiV0NIHpuZ1FQ33IEjgThwZkRVS475ziMkrKmRpmBhTExYI8edC4l2k6p+pANXRsJxg56XCOUtbHZQGwzlcg7kdmQMAujhSUz9AVPjRkZYkKOHmoCU+BsscU1qPeFORfXk1FGjYBTQAgAAcsgLSg==
</data>
</layer>
</map>
+12 -1
View File
@@ -129,7 +129,17 @@ SetupBoardLoop:
move.l foregroundScrollX,d0
move.w #1,moving
bsr Update
bsr RenderNextForegroundFrame
jsr RenderNextForegroundFrame
move.w #15,d5
sub.l #BACKGROUND_SCROLL_PIXELS,backgroundScrollX
.renderNextBackgroundFrameLoop:
add.l #BACKGROUND_SCROLL_PIXELS,backgroundScrollX
jsr RenderNextBackgroundFrame
jsr SwitchBackgroundBuffers
dbra d5,.renderNextBackgroundFrameLoop
cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS,frameCount
bge .gotoGameLoop
bra SetupBoardLoop
@@ -1149,6 +1159,7 @@ playAreaCopperPalettePtr4_MP:
InstallSpriteColorPalette:
jsr InstallPlayerColorPalette
include "out/sprite_coin-1-palette.s"
include "out/sprite_arrow-1-palette.s"
rts
InstallColorPalette:
+6 -2
View File
@@ -1,7 +1,10 @@
include "includes.i"
xdef SwitchBuffers
xdef SwitchBackgroundBuffers
xdef PokePanelBitplanePointers
SwitchBuffers:
;; offscreen - bitplane address
@@ -23,8 +26,9 @@ SwitchBuffers:
add.l #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH*(96-1),d0
lea copperListBpl1Ptr2_MP,a0
bsr.s PokeBitplanePointers
bsr.s PokeBitplanePointers
SwitchBackgroundBuffers:
move.l backgroundScrollX,d0
lsr.w #BACKGROUND_SCROLL_SHIFT_CONVERT,d0 ; convert to pixels
@@ -41,7 +45,7 @@ SwitchBuffers:
lea copperListBpl2Ptr_MP,a0
bsr.s PokeBitplanePointers
add.l #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH*(96-48+16),d0
add.l #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH*(96-1),d0
lea copperListBpl2Ptr2_MP,a0
bsr.s PokeBitplanePointers
+31 -15
View File
@@ -93,6 +93,7 @@ ResetItems:
rts
ClearItemSpriteData:
rts
;; move.w #ITEM_SPRITE_NUM_VERTICAL_SPRITES-1,d4
;; sub.w d2,d4 ; this is because of the upside board at the moment
;; move.w d4,d2
@@ -125,7 +126,7 @@ SetupItemSpriteData:
move.w ITEM_Y(a1),d2
;; move.l #5,d2
move.l currentItemSprite,a0
move.l ITEM_SPRITE_ADDRESS(a1),a0
cmp.w #(ITEM_NUM_COIN_ANIMS-1)<<3,ITEM_INDEX(a1)
ble .dontResetIndex
@@ -194,7 +195,7 @@ GetSpriteSlot:
lea item1,a1
add.l d0,a1
move.l #deadSprite,currentItemSprite
;; move.l #deadSprite,ITEM_SPRITE_ADDRESS(a1)
move.w #336<<FOREGROUND_SCROLL_SHIFT_CONVERT,ITEM_X(a1)
sub.l #1,d2
move.w d2,ITEM_Y(a1)
@@ -203,7 +204,7 @@ GetSpriteSlot:
add.w #1,d1
move.w d1,ITEM_SPRITE(a1)
move.l #spriteCoin1,currentItemSprite
;; move.l #spriteCoin1,ITEM_SPRITE_ADDRESS(a1)
dontAddSprite:
movem.l (sp)+,d2-d3
rts
@@ -214,18 +215,26 @@ EnableItemSprites:
itemSpritesEnabled:
dc.l 0
;; used for animation
currentItemSprite:
dc.l deadSprite
ItemControl item1
ItemControl item2
ItemControl item3
ItemControl item4
ItemControl item5
ItemControl item6
ItemControl item7
ItemControl item8
;; coin1
ItemControl item1,spriteCoin1
ItemControl item2,spriteCoin1
ItemControl item3,spriteCoin1
ItemControl item4,spriteCoin1
ItemControl item5,spriteCoin1
ItemControl item6,spriteCoin1
ItemControl item7,spriteCoin1
ItemControl item8,spriteCoin1
;; arrow1
ItemControl item9,spriteArrow1
ItemControl item10,spriteArrow1
ItemControl item11,spriteArrow1
ItemControl item12,spriteArrow1
ItemControl item13,spriteArrow1
ItemControl item14,spriteArrow1
ItemControl item15,spriteArrow1
ItemControl item16,spriteArrow1
ItemSprite spriteCoin1,sprite_coin-0.bin
ItemSprite spriteCoin2,sprite_coin-0.bin
@@ -233,8 +242,15 @@ currentItemSprite:
ItemSprite spriteCoin4,sprite_coin-2.bin
ItemSprite spriteCoin5,sprite_coin-3.bin
ItemSprite spriteCoin6,sprite_coin-2.bin
ItemSprite spriteCoin7,sprite_coin-1.bin
ItemSprite spriteCoin7,sprite_coin-1.bin
ItemSprite spriteArrow1,sprite_arrow-0.bin
ItemSprite spriteArrow2,sprite_arrow-0.bin
ItemSprite spriteArrow3,sprite_arrow-1.bin
ItemSprite spriteArrow4,sprite_arrow-2.bin
ItemSprite spriteArrow5,sprite_arrow-3.bin
ItemSprite spriteArrow6,sprite_arrow-2.bin
ItemSprite spriteArrow7,sprite_arrow-1.bin
nextSpriteSlot:
dc.w 0
+7 -7
View File
@@ -48,7 +48,9 @@ ItemSprite: macro
endm
ItemControl: macro
align 4
\1:
.itemX:
dc.w 0
@@ -56,14 +58,12 @@ ItemControl: macro
dc.w 0
.itemY:
dc.w 0
.itemLagY:
dc.w 0
.itemYEnd:
dc.w 0
.itemLagYEnd:
.itemSprite:
dc.w 0
.itemIndex:
dc.w 0
.pad ; make the control word 16 bytes
dc.w 0
.pad: ; make the control word 16 bytes
dc.w 0
.spriteAddress:
dc.l \2
endm