Prev: 46075 Up: Map Next: 46105
46083: 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 4660, 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 46083 LD A,(IX+0) Fetch the graphic number of the sparkle.
46086 CPL Invert it.
46087 AND %00011111 Keep the lowest five bits to get the number of notes to play.
46089 LD E,A Set E to the number of notes.
46090 LD HL,4660 Point HL at the ROM bytes that are used as noise.
PlaySparkleSound_NextBeep 46093 LD A,(HL) Fetch the next byte of noise.
46094 INC HL Move on to the next one.
46095 LD B,A Use it as the pitch.
46096 LD C,2 Set the number of cycles to play.
46098 CALL PlayWaveSequence Play the tone.
46101 DEC E Decrease the note counter and loop back to PlaySparkleSound_NextBeep until all of the notes have been played.
46102 JR NZ,PlaySparkleSound_NextBeep
46104 RET Return.
View the equivalent code in;
Prev: 46075 Up: Map Next: 46105