Prev: 47346 Up: Map Next: 47384
47359: Sounds: Explosion
Falling pitch played when an explosion animation ends.
Play a falling-pitch explosion, stepping D down from 7.
SoundsExplosion 47359 LD D,7 D=7.
SoundsExplosion_Loop 47361 LD A,D Copy the step into A.
47362 DAA Convert it to packed BCD.
47363 XOR %11110000 Flip bits 4-7.
47365 RLCA Rotate it left.
47366 LD C,A Copy it into the pitch.
Mix two bits of GameTimer into the pitch to add noise.
47367 LD A,(24130) Fetch GameTimer.
47370 RRCA Rotate it right three times.
47371 RRCA
47372 RRCA
47373 AND %01100000 Keep only bits 5-6.
47375 XOR C Flip the bits from the pitch.
47376 LD C,A Write the mixed pitch.
Play the note, then repeat for the next step.
47377 CALL PlaySquareWave Call PlaySquareWave.
47380 DEC D Decrease the step by one.
47381 JR NZ,SoundsExplosion_Loop Jump back to SoundsExplosion_Loop until it is zero.
47383 RET Return.
View the equivalent code in;
Prev: 47346 Up: Map Next: 47384