Prev: B3FB Up: Map Next: B419
B403: Play Sparkle Sound
Used by the routines at HandleDeathSparkles and CycleColoursWithSound.
Plays a burst of noise for the sparkles of a dying player. The pitch of each cycle comes from the bytes of the ROM, starting at 1234, and the number of cycles depends on the sprite number of the sparkle, so each stage of the sparkles sounds different.
Input
IX Address of the sparkle object
Play a beep for each remaining frame.
PlaySparkleSound B403 LD A,(IX+$00) Fetch the graphic number of the sparkle.
B406 CPL Invert it.
B407 AND %00011111 Keep the lowest five bits to get the number of notes to play.
B409 LD E,A Set E to the number of notes.
B40A LD HL,$1234 Point HL at the ROM bytes that are used as noise.
PlaySparkleSound_NextBeep B40D LD A,(HL) Fetch the next byte of noise.
B40E INC HL Move on to the next one.
B40F LD B,A Use it as the pitch.
B410 LD C,$02 Set the number of cycles to play.
B412 CALL PlayWaveSequence Play the tone.
B415 DEC E Decrease the note counter and loop back to PlaySparkleSound_NextBeep until all of the notes have been played.
B416 JR NZ,PlaySparkleSound_NextBeep
B418 RET Return.
View the equivalent code in;
Prev: B3FB Up: Map Next: B419