play sfx consistently

This commit is contained in:
alpine9000
2016-05-07 16:24:07 +10:00
parent 484fd760f2
commit 741a111a46
4 changed files with 42 additions and 14 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
</layer>
<layer name="items" width="100" height="8">
<data encoding="base64" compression="zlib">
eJztlVsKgCAQRXVpPSzoCYXtfyklJEyRzihGVh7ox65TnCvIWCJmco5nMkJGMXH6TJhriPmvovzaHBf8mPWZD2fMyIz2xX1Qz54N7ZjiGnZXGvKdYd2Up+7/E3JzIHbXvcUH7EM69KgRhKzt+1eEOJNPof4dPgrM53J6DzupPFxge4ab/br0F0vXrvdEHTA/RuIgkVgBbswOFg==
eJztlVsKgCAQRXVpvaEnFLb/pZSQMEnqjBhZeaCfuqNyrhBjiZjIOX0mQ87MnLaHyrUeZ/oS0q/NccHPWZ/14RqLY43uxX343G8d5RjjGnZXGvK94b0pj53/E2J3UB2uB4sP2Icg9KioEFnb/leEuJNPIc8OH4nL56p9h53UHi5cM+PNfin9xdI19T/RBMxPkThIJDZy/A4W
</data>
</layer>
</map>
+4 -13
View File
@@ -196,11 +196,6 @@ GameLoop:
move.l #FOREGROUND_SCROLL_PIXELS,foregroundScrollPixels
jsr WaitVerticalBlank
if SFX=1
move.w #2,AUD3LEN(a6) ; set the empty sound for the next sample to be played
move.l #emptySound,AUD3LCH(a6)
endif
if TIMING_TEST=1
move.l #4000,d0
@@ -255,6 +250,7 @@ GameLoop:
move.w #$f00,COLOR02(a6)
endif
jsr PlayNextSound
bra GameLoop
Update:
@@ -663,14 +659,13 @@ PostMissedTile:
BigBang:
PlaySound Falling
jsr WaitVerticalBlank
move.w #2,AUD3LEN(a6) ; set the empty sound for the next sample to be played
move.l #emptySound,AUD3LCH(a6)
jsr PlayNextSound
jsr ResetItems
move.w #0,moving
move.l #0,frameCount
.bigBangLoop:
add.l #1,frameCount
cmp.l #BIGBANG_POST_DELAY,frameCount
beq PostMissedTile
@@ -1493,10 +1488,6 @@ panelFade:
tileFade:
include "out/tileFade.s"
align 2
emptySound:
dc.l 0
section .bss
foregroundBitplanes1:
+20
View File
@@ -4,6 +4,26 @@ PlaySound: macro
endif
endm
KillSound: macro
if SFX=1
move.w #(DMAF_AUD3),DMACON(a6)
move.w #1,AUD3PER(a6)
move.w #2,AUD3LEN(a6) ; set the empty sound for the next sample to be played
move.l #emptySound,AUD3LCH(a6)
lea $dff004,a0
move.l (a0),d0
add.l #1<<8,d0
.loop:
move.l (a0),d1
cmp.l d0,d1
ble .loop
move.w #(DMAF_AUD3|DMAF_SETCLR),DMACON(a6)
endif
endm
WaitBlitter: macro
tst DMACONR(a6) ;for compatibility
.\@:
+17
View File
@@ -1,4 +1,14 @@
include "includes.i"
xdef PlayNextSound
PlayNextSound:
if SFX=1
move.w #2,AUD3LEN(a6) ; set the empty sound for the next sample to be played
move.l #emptySound,AUD3LCH(a6)
endif
rts
if SFX=1
xdef PlayJumpSound
xdef PlayFallingSound
@@ -15,6 +25,7 @@ PlayJumpSound:
rts
PlayWhooshSound:
KillSound
lea whoosh,a1
move.l a1,AUD3LCH(a6)
move.w #256,AUD3PER(a6)
@@ -25,6 +36,7 @@ PlayWhooshSound:
PlayFallingSound:
KillSound
lea falling(pc),a1
move.l a1,AUD3LCH(a6)
move.w #256,AUD3PER(a6)
@@ -34,6 +46,7 @@ PlayFallingSound:
rts
PlayChachingSound:
KillSound
lea chaching,a1
move.l a1,AUD3LCH(a6)
move.w #256,AUD3PER(a6)
@@ -57,4 +70,8 @@ endChaching:
whoosh:
incbin "out/whoosh.raw"
endWhoosh:
align 2
emptySound:
dc.l 0
endif