Prev: 29349 Up: Map Next: 29386
29355: Play Explosion Sound
Used by the routine at UpdateEnemies.
Plays the sound of the explosion of the ship, for each step of the counter at 36691 until it reaches 45. It makes a warble first and then either a falling note (every eighth step), noise (on the odd steps) or nothing.
PlayExplosionSound 29355 LD A,(36691) The ship state.
29358 CP 45 Return if A is 45 or more.
29360 RET NC
29361 SUB 10 Subtract 10 from A.
29363 CALL PlayWarble Call PlayWarble.
29366 LD A,(36691) The ship state.
29369 LD B,A Keep the explosion step.
29370 AND %00000111 Keep the bits of A that are set in 7.
29372 JR Z,PlayExplosionHitSound Jump to PlayExplosionHitSound if the zero flag is set.
29374 BIT 0,B Return if bit 0 of B is clear.
29376 RET Z
29377 LD A,B The pattern comes from the step.
29378 SRL A Shift A right.
29380 LD E,A That is the click pattern.
29381 LD C,11 This step of the explosion is 11 clicks.
29383 JP PlayNoise Jump to PlayNoise.
Prev: 29349 Up: Map Next: 29386