diff --git a/028.bs/Makefile b/028.bs/Makefile index 2113540..98d283b 100644 --- a/028.bs/Makefile +++ b/028.bs/Makefile @@ -31,6 +31,14 @@ IMAGES=foreground.png \ sprite_robot-5.png \ sprite_robot-6.png \ sprite_robot-7.png \ + sprite_tank-0.png \ + sprite_tank-1.png \ + sprite_tank-2.png \ + sprite_tank-3.png \ + sprite_tank-4.png \ + sprite_tank-5.png \ + sprite_tank-6.png \ + sprite_tank-7.png \ sprite_coin-0.png \ sprite_coin-1.png \ sprite_coin-2.png \ @@ -45,6 +53,11 @@ IMAGES=foreground.png \ sprite_fallingRobot-2.png \ sprite_fallingRobot-3.png \ sprite_fallingRobot-4.png \ + sprite_fallingTank-0.png \ + sprite_fallingTank-1.png \ + sprite_fallingTank-2.png \ + sprite_fallingTank-3.png \ + sprite_fallingTank-4.png \ font8x8.png\ splash.png @@ -81,12 +94,19 @@ out/sprite_pig-%.bin: out/sprite_pig-%.png out/sprite_robot-%.bin: out/sprite_robot-%.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_robot-$* --palette-offset 16 --use-palette=assets/robot.pal +out/sprite_tank-%.bin: out/sprite_tank-%.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_tank-$* --palette-offset 16 --use-palette=assets/tank.pal + + out/sprite_fallingPig-%.bin: out/sprite_fallingPig-%.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_fallingPig-$* --palette-offset 16 --use-palette=assets/pig.pal out/sprite_fallingRobot-%.bin: out/sprite_fallingRobot-%.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_fallingRobot-$* --palette-offset 16 --use-palette=assets/robot.pal +out/sprite_fallingTank-%.bin: out/sprite_fallingTank-%.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_fallingTank-$* --palette-offset 16 --use-palette=assets/tank.pal + 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 @@ -96,12 +116,18 @@ out/sprite_pig%.png: assets/assets.png out/sprite_robot%.png: assets/assets.png ../tools/croppa/out/croppa --input=assets/assets.png --output=out/sprite_robot --width=16 --height=16 --rows=1 --cols=8 --dx=16 --dy=16 --x=192 --y=176 +out/sprite_tank%.png: assets/assets.png + ../tools/croppa/out/croppa --input=assets/assets.png --output=out/sprite_tank --width=16 --height=16 --rows=1 --cols=8 --dx=16 --dy=16 --x=192 --y=208 + out/sprite_fallingPig%.png: assets/assets.png ../tools/croppa/out/croppa --input=assets/assets.png --output=out/sprite_fallingPig --width=16 --height=16 --rows=1 --cols=5 --dx=16 --dy=16 --x=192 --y=128 out/sprite_fallingRobot%.png: assets/assets.png ../tools/croppa/out/croppa --input=assets/assets.png --output=out/sprite_fallingRobot --width=16 --height=16 --rows=1 --cols=5 --dx=16 --dy=16 --x=192 --y=192 +out/sprite_fallingTank%.png: assets/assets.png + ../tools/croppa/out/croppa --input=assets/assets.png --output=out/sprite_fallingTank --width=16 --height=16 --rows=1 --cols=5 --dx=16 --dy=16 --x=192 --y=224 + 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 diff --git a/028.bs/assets/assets.png b/028.bs/assets/assets.png index d81164c..0c052b2 100644 Binary files a/028.bs/assets/assets.png and b/028.bs/assets/assets.png differ diff --git a/028.bs/assets/panel.pal b/028.bs/assets/panel.pal index 20b214e..77e6679 100644 --- a/028.bs/assets/panel.pal +++ b/028.bs/assets/panel.pal @@ -1,16 +1,17 @@ -000 153 238 255 -255 255 204 255 238 187 153 255 051 136 136 255 +255 255 255 255 255 238 187 255 +255 255 221 255 068 187 170 255 000 000 000 255 +170 238 238 255 255 221 000 255 -255 255 255 255 +000 034 051 255 255 136 000 255 000 068 119 255 085 221 204 255 +255 000 064 255 170 187 153 255 -170 238 238 255 -000 000 000 255 -255 255 204 255 \ No newline at end of file +255 255 204 255 + diff --git a/028.bs/assets/panel.png b/028.bs/assets/panel.png index 61eaf25..9e1dfa5 100644 Binary files a/028.bs/assets/panel.png and b/028.bs/assets/panel.png differ diff --git a/028.bs/assets/tank.pal b/028.bs/assets/tank.pal new file mode 100644 index 0000000..a7814e5 --- /dev/null +++ b/028.bs/assets/tank.pal @@ -0,0 +1,4 @@ +000 000 000 255 +135 137 068 255 +054 102 002 255 +052 038 026 255 diff --git a/028.bs/background.s b/028.bs/background.s index f734d1f..c507966 100644 --- a/028.bs/background.s +++ b/028.bs/background.s @@ -4,6 +4,7 @@ xdef RenderNextBackgroundFrame xdef backgroundScrollX xdef backgroundOnscreen + xdef backgroundOffscreen InitialiseBackground: @@ -36,6 +37,14 @@ RenderBackgroundTile: lsr.b #BACKGROUND_SCROLL_SHIFT_CONVERT,d2 ; convert to pixels andi.w #$f,d2 ; find the shift component jsr BlitTile + cmp.l #backgroundBitplanes1,backgroundOffscreen + bne .offsetSub + add.l #IMAGESIZE*2,a0 + bra .doBlit +.offsetSub: + sub.l #IMAGESIZE*2,a0 +.doBlit: + jsr BlitTile rts RenderNextBackgroundFrame: @@ -62,11 +71,13 @@ backgroundMap: backgroundOnscreen: dc.l backgroundBitplanes1 backgroundOffscreen: - dc.l backgroundBitplanes1 + dc.l backgroundBitplanes2 section .bss backgroundBitplanes1: ds.b IMAGESIZE*2 +backgroundBitplanes2: + ds.b IMAGESIZE*2 \ No newline at end of file diff --git a/028.bs/foreground.tmx b/028.bs/foreground.tmx index b2711d6..ddbdb26 100644 --- a/028.bs/foreground.tmx +++ b/028.bs/foreground.tmx @@ -8,15 +8,15 @@ - eJxjZ2BgsGTEjtlH5eguZwekmYBYDAs9Kkd/OS0c8qNyAyNHSXxWkqlvVA5//tiNJ86WUxDXo3L0zR+jcrTJH4MtjYxkOWkG3G0wWsgNxjbmYJIDAGX6U4Q= + eJxjZ2BgsGTEjtlH5eguZwekmYBYDAtNidxWPHKVNLBvuMhp4ZAflRsYOUriczSd0yZ/7MYTZ8spiOtROfrmj1E52uSPwZZGRrKcNAPuNhgt5AZjG3MwyQEArppUrg== - eJxjYBgFo2AUkAvOA/HHgXbECAbo4c/KyMDADcQngWxjIK3LCKFHAW0BLJwlgfgxlA8DsDhBByB1o3mH/gAUF6w48sRonNAf3AVieTxlFCw/wcqzUTAKhgsAAErmDLs= + eJxjYBgFIwUYMzIw6DKi0qOAMnAeiD9S2UxuRoTZoHj6TmXzhxNAD39WRkj4nWSgXjpnZcROjwIEgIWzJBA/hvJhABYn6ACkjpy8AzMLnR4FxAFQeOFKw+TEyWj+oAzcBWJ5PGEGy0+w8owQgKmHmYmeH0fBKBgsAADYaBI9 - + eJxjYBgFgw04MuLnE1JPCDgRqZ5YdcMdgMKX2DBGV+dKhD6QHucREtbUSFOwMMYVJy6MqGph6lxItJtU9SMduDISjhv0vERK3oLZQW0wlMs5kNuRMQiQU3/A1LiRERbk6KEmICX+Bktck1pnu1NRPal2j4JRQCsAAIdJC5A= diff --git a/028.bs/game1.s b/028.bs/game1.s index 6caac27..bf7513a 100644 --- a/028.bs/game1.s +++ b/028.bs/game1.s @@ -47,7 +47,8 @@ Entry: jsr StartMusic jsr ShowSplash - + jsr BlueFill + ;; d0 - fg bitplane pointer offset ;; d1 - bg bitplane pointer offset move.l #0,d0 @@ -55,7 +56,7 @@ Entry: jsr SwitchBuffers move.w #(DMAF_BLITTER|DMAF_SETCLR!DMAF_MASTER),DMACON(a6) - + lea panelCopperListBpl1Ptr,a0 lea panel,a1 jsr PokePanelBitplanePointers @@ -68,10 +69,11 @@ Entry: lea mpanelCopperListBpl1Ptr,a0 lea mpanel,a1 jsr PokePanelBitplanePointers - + bsr ShowMessagePanel - jsr Init ; enable the playfield + + jsr Init ; enable the playfield jsr InstallSpriteColorPalette @@ -88,6 +90,7 @@ Reset: move.l startForegroundMapPtr,foregroundMapPtr move.l startPathwayMapPtr,pathwayMapPtr move.w #0,pathwayRenderPending + move.w #0,pathwayClearPending move.w #0,moving move.l #playareaFade,playareaFadePtr move.l #panelFade,panelFadePtr @@ -198,17 +201,17 @@ GameLoop: jsr RenderNextBackgroundFrame + cmp.w #0,pathwayClearPending + beq .dontClearPathway + bsr ClearPathway +.dontClearPathway: + cmp.w #0,pathwayRenderPending beq .dontRenderPathway jsr InstallTilePalette jsr RenderPathway .dontRenderPathway: - cmp.w #0,pathwayClearPending - beq .dontClearPathway - bsr ClearPathway -.dontClearPathway: - if 0 @@ -406,8 +409,6 @@ RenderNextForegroundFrame: rts RenderPathway: - ;; only render when scroll complete - move.w #0,pathwayFadeCount sub.w #1,pathwayRenderPending move.w pathwayXIndex,d5 ; x index @@ -442,7 +443,7 @@ RenderPathway: jsr BlitTile bra .next .dontBlit: - cmp.w pathwayXIndex,d5 + cmp.w pathwayXIndex,d5 ; skip the start column beq .next add.w #1,d7 cmp.w #7,d7 @@ -450,6 +451,8 @@ RenderPathway: .next: dbra d6,.loopY add.w #1,d5 + cmp.w #(FOREGROUND_PLAYAREA_WIDTH_WORDS/2)-1,d5 ; don't render pathways off the play area + beq .skip bra .loopX .skip: diff --git a/028.bs/image.s b/028.bs/image.s index 95768f6..9a63254 100644 --- a/028.bs/image.s +++ b/028.bs/image.s @@ -14,6 +14,7 @@ SwitchBuffers: move.l foregroundOnscreen,foregroundOffscreen move.l a0,foregroundOnscreen move.l a0,a1 + lea copperListBpl1Ptr,a0 bsr.s PokeBitplanePointers @@ -21,18 +22,19 @@ SwitchBuffers: bsr.s PokeBitplanePointers add.l #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH*(96-1),d0 - ;; lea copperListBpl1Ptr2,a0 - ;; bsr.s PokeBitplanePointers - lea copperListBpl1Ptr2_MP,a0 bsr.s PokeBitplanePointers - ;; background is not double buffered move.l backgroundScrollX,d0 lsr.w #BACKGROUND_SCROLL_SHIFT_CONVERT,d0 ; convert to pixels lsr.w #3,d0 ; bytes to scroll - move.l backgroundOnscreen,a1 + + move.l backgroundOffscreen,a0 + move.l backgroundOnscreen,backgroundOffscreen + move.l a0,backgroundOnscreen + move.l a0,a1 + lea copperListBpl2Ptr,a0 bsr.s PokeBitplanePointers @@ -40,9 +42,6 @@ SwitchBuffers: bsr.s PokeBitplanePointers add.l #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH*(96-48+16),d0 - ;; lea copperListBpl2Ptr2,a0 - ;; bsr.s PokeBitplanePointers - lea copperListBpl2Ptr2_MP,a0 bsr.s PokeBitplanePointers diff --git a/028.bs/player.s b/028.bs/player.s index c2cf3a6..a7ffe9d 100644 --- a/028.bs/player.s +++ b/028.bs/player.s @@ -226,7 +226,11 @@ InstallPigColorPalette: InstallRobotColorPalette: include "out/sprite_robot-0-palette.s" - rts + rts + +InstallTankColorPalette: + include "out/sprite_tank-0-palette.s" + rts CheckPlayerMiss: @@ -289,6 +293,9 @@ CheckPlayerMiss: ;; a3 now points at the tile under the sprite move.w (a3),d0 + + cmp.w #$7098,d0 ; empty tile + beq .doBigBang cmp.w #$78e,d0 bge .noBigBang @@ -405,9 +412,10 @@ CheckDirection: SelectNextPlayerSprite: - cmp.l #pigPlayerSpriteConfig,playerSpriteConfig - bne .s1 - move.l #robotPlayerSpriteConfig,playerSpriteConfig + cmp.l #tankPlayerSpriteConfig,playerSpriteConfig + beq .s1 + ;; move.l #robotPlayerSpriteConfig,playerSpriteConfig + add.l #3*4,playerSpriteConfig bra .done .s1: move.l #pigPlayerSpriteConfig,playerSpriteConfig @@ -425,6 +433,11 @@ robotPlayerSpriteConfig: dc.l spriteRobot dc.l spriteFallingRobot1 +tankPlayerSpriteConfig: + dc.l InstallTankColorPalette + dc.l spriteTank + dc.l spriteFallingTank1 + playerSpriteConfig: dc.l pigPlayerSpriteConfig diff --git a/028.bs/splash.s b/028.bs/splash.s index 04d1603..2d09020 100644 --- a/028.bs/splash.s +++ b/028.bs/splash.s @@ -43,7 +43,7 @@ ShowSplash: move.w #(INTF_SETCLR|INTF_VERTB|INTF_INTEN),INTENA(a6) .wait: jsr WaitVerticalBlank - jsr ProcessJoystick + jsr ReadJoystick btst.b #0,joystick beq .wait rts diff --git a/028.bs/sprite_data.i b/028.bs/sprite_data.i index ab6480d..0b352f3 100644 --- a/028.bs/sprite_data.i +++ b/028.bs/sprite_data.i @@ -82,6 +82,48 @@ spriteRobotRightJump: dc.w 0,0 incbin "out/sprite_robot-2.bin" ; 7, right jump dc.l 0 + +spriteTank: +spriteTankUp: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_tank-1.bin" ; 0, up + dc.l 0 +spriteTankUpJump: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_tank-0.bin" ; 1, up jump + dc.l 0 +spriteTankDown: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_tank-5.bin" ; 2, down + dc.l 0 +spriteTankDownJump: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_tank-4.bin" ; 3, down jump + dc.l 0 +spriteTankLeft: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_tank-7.bin" ; 4, left + dc.l 0 +spriteTankLeftJump: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_tank-6.bin" ; 5, left jump + dc.l 0 +spriteTankRight: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_tank-3.bin" ; 6, right + dc.l 0 +spriteTankRightJump: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_tank-2.bin" ; 7, right jump + dc.l 0 spriteFalling0: dc.w 0,0 @@ -134,4 +176,31 @@ spriteFallingRobot4: dc.w 0,0 dc.w 0,0 incbin "out/sprite_fallingRobot-4.bin" + dc.l 0 + + +spriteFallingTank0: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_fallingTank-0.bin" + dc.l 0 +spriteFallingTank1: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_fallingTank-1.bin" + dc.l 0 +spriteFallingTank2: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_fallingTank-2.bin" + dc.l 0 +spriteFallingTank3: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_fallingTank-3.bin" + dc.l 0 +spriteFallingTank4: + dc.w 0,0 + dc.w 0,0 + incbin "out/sprite_fallingTank-4.bin" dc.l 0 \ No newline at end of file