palette switching

This commit is contained in:
alpine9000
2016-05-08 19:51:22 +10:00
parent b6cb6484c9
commit da9275a736
9 changed files with 103 additions and 15 deletions
+5 -1
View File
@@ -203,9 +203,13 @@ out/whoosh.raw: assets/whoosh.wav
out/chaching.raw: assets/chaching.wav
sox -v 0.98 assets/chaching.wav -c 1 -r 13000 -b 8 out/chaching.raw
out/yay.raw: assets/yay.wav
sox -v 2.0 assets/yay.wav -c 1 -r 4000 -b 8 out/yay.raw
out/main.o: $(IMAGEDATA) out/background-map.s out/foreground-map.s Makefile link.script.x\
out/paletteA_playarea_fade.s out/paletteA_flags_fade.s out/paletteA_foreground-palette-table.s out/paletteA_tileFade.s\
out/panelFade.s out/jump.raw out/falling.raw out/chaching.raw out/whoosh.raw
out/paletteB_playarea_fade.s out/paletteB_flags_fade.s out/paletteB_foreground-palette-table.s out/paletteB_tileFade.s\
out/panelFade.s out/jump.raw out/falling.raw out/chaching.raw out/whoosh.raw out/yay.raw
setuptiming:
$(eval VASM_EXTRA_ARGS=-DTIMING_TEST=1 -DSFX=1)
@@ -0,0 +1,8 @@
000 000 000 255
066 000 001 255
115 000 015 255
210 000 039 255
210 000 100 255
251 000 154 255
231 070 213 255
016 132 233 255
@@ -0,0 +1,8 @@
000 153 238 255
253 174 017 255
233 216 100 255
210 000 039 255
210 000 100 255
251 000 154 255
231 070 213 255
016 132 233 255
Binary file not shown.
+1 -1
View File
@@ -18,7 +18,7 @@
</layer>
<layer name="items" width="100" height="8">
<data encoding="base64" compression="zlib">
eJztVcsOgjAQpJ+myENRIEjx//9ESGxSS/dZQjgwxzIzOzt7IMtOHAlXI9dcmJrByGY43kORifLcC1vMW/rFOs7NP1fj73u8CY8mcad8g060Hhwdtb/rONb1aNZcx7sBvk/gHeKHuCO8MI8EsVwpfhyttgs7fy9+Xdcet0fuYZE7QigYXOtxOPwXY7cUpOoxLPuF+ak+a+Qm4b04KAmNxnMSaKD5beSdyooh5qf1lP4npB1WCF9zjz3REfk+B89/go8vj84Udg==
eJztVVsOgzAMo9fZLRiDsfe0rdv9b7IhrVKoSOOkFeIDf4LtJPZHq2rFkrB1ek0Nah5ONyPwjoadJM+5UGLekG8q48aNuRZ/6vEUPE6ZNzUFMrF6IDrp/pAxkjXtbsfwz8x3jh/jkOC9MrKe2ivHD9Fas/C//+0/655w75GO9uEVPQa0ANcTDsK/ALflQKPfKL2H++L9pTz7RCdxXwg6QWPxfCs03Pxr4beG85Pun4L2ndBmuE/wLX3MiZuw32fh+6/A8QXUoxQE
</data>
</layer>
</map>
+58 -9
View File
@@ -81,7 +81,6 @@ Entry:
move.w #(DMAF_SPRITE|DMAF_BLITTER|DMAF_SETCLR|DMAF_COPPER|DMAF_RASTER|DMAF_MASTER),DMACON(a6)
jsr InitialiseItems
Reset:
lea livesCounterText,a0
bsr DecrementCounter
@@ -302,7 +301,8 @@ GameOver:
lea gameOverMessage,a1
move.w #128,d0
jsr Message
jsr InstallPaletteA
move.l #100,d0
.pause:
jsr WaitVerticalBlank
@@ -322,15 +322,30 @@ GameOver:
LevelComplete:
PlaySound Yay
jsr ResetItems
jsr ResetPlayer
jsr ResetPlayer
jsr SelectNextPlayerSprite
move.l nextPaletteInstaller,a0
cmp.l #0,(a0)
bne .dontResetPaletteInstaller
move.l #paletteInstallers,nextPaletteInstaller
move.l nextPaletteInstaller,a0
.dontResetPaletteInstaller:
move.l (a0),a1
jsr (a1)
add.l #4,a0
move.l a0,nextPaletteInstaller
lea levelCompleteMessage,a1
move.w #100,d0
jsr Message
jsr Message
move.l #100,d0
.pause:
jsr WaitVerticalBlank
jsr WaitVerticalBlank
jsr PlayNextSound
dbra d0,.pause
.waitForJoystick:
@@ -686,7 +701,6 @@ stopScrolling:
PostMissedTile:
jsr SelectNextPlayerSprite
bra Reset
@@ -703,7 +717,8 @@ BigBang:
jsr Update
bsr RenderNextForegroundFrame
jsr RenderNextBackgroundFrame
jsr WaitVerticalBlank
jsr WaitVerticalBlank
jsr PlayNextSound
bsr HoriScrollPlayfield
jsr SwitchBuffers
bra .finishScrollLoop
@@ -1384,6 +1399,19 @@ InstallFlagGreyPalette:
rts
InstallPaletteA:
move.l #paletteA_playAreaPalette,playAreaPalette
move.l #paletteA_playareaFade,playareaFade
move.l #paletteA_flagsFade,flagsFade
move.l #paletteA_tileFade,tileFade
rts
InstallPaletteB:
move.l #paletteB_playAreaPalette,playAreaPalette
move.l #paletteB_playareaFade,playareaFade
move.l #paletteB_flagsFade,flagsFade
move.l #paletteB_tileFade,tileFade
rts
foregroundOnscreen:
dc.l foregroundBitplanes1
@@ -1551,7 +1579,20 @@ paletteA_flagsFade:
include "out/paletteA_flags_fade.s"
paletteA_tileFade:
include "out/paletteA_tileFade.s"
include "out/paletteA_tileFade.s"
paletteB_playAreaPalette:
include "out/paletteB_foreground-palette-table.s"
include "out/background-palette-table.s"
paletteB_playareaFade:
include "out/paletteB_playarea_fade.s"
paletteB_flagsFade:
include "out/paletteB_flags_fade.s"
paletteB_tileFade:
include "out/paletteB_tileFade.s"
playAreaPalette:
dc.l paletteA_playAreaPalette
@@ -1562,6 +1603,14 @@ flagsFade:
tileFade:
dc.l paletteA_tileFade
paletteInstallers:
dc.l InstallPaletteA
dc.l InstallPaletteB
dc.l 0
nextPaletteInstaller:
dc.l paletteInstallers+4
panelFade:
include "out/panelFade.s"
+1 -1
View File
@@ -192,7 +192,7 @@ _SetupItemSpriteData:
bra .done
.done:
add.w #1,ITEM_INDEX(a1)
;; add.w #1,ITEM_INDEX(a1)
.spriteIsNotEnabled:
move.l (sp)+,d0
rts
+5 -2
View File
@@ -13,14 +13,17 @@ KillSound: macro
lea $dff006,a0
move.w #4,d2
.nTimes:
move.w (a0),d0
lsr.w #8,d0
add.w #4,d0
.loop:
move.l (a0),d1
lsr.w #8,d1
cmp.w d0,d1
ble .loop
beq .loop
dbra d2,.nTimes
move.w #(DMAF_AUD3|DMAF_SETCLR),DMACON(a6)
endif
+17 -1
View File
@@ -14,6 +14,7 @@ PlayNextSound:
xdef PlayFallingSound
xdef PlayChachingSound
xdef PlayWhooshSound
xdef PlayYaySound
PlayJumpSound:
lea jump(pc),a1
@@ -53,7 +54,17 @@ PlayChachingSound:
move.w #64,AUD3VOL(a6)
move.w #(endChaching-chaching)/2,AUD3LEN(a6) ;Set length in words
move.w #(DMAF_AUD3|DMAF_SETCLR),DMACON(a6)
rts
rts
PlayYaySound:
KillSound
lea yay,a1
move.l a1,AUD3LCH(a6)
move.w #423,AUD3PER(a6)
move.w #64,AUD3VOL(a6)
move.w #(endYay-yay)/2,AUD3LEN(a6) ;Set length in words
move.w #(DMAF_AUD3|DMAF_SETCLR),DMACON(a6)
rts
align 4
jump:
@@ -67,9 +78,14 @@ endFalling:
chaching:
incbin "out/chaching.raw"
endChaching:
align 4
whoosh:
incbin "out/whoosh.raw"
endWhoosh:
align 4
yay:
incbin "out/yay.raw"
endYay:
align 2
emptySound: