Prev: B5EE Up: Map Next: B619
B604: Play Appearing Sound
Used by the routine at HandlePlayerAppearing.
Plays a sound for the sparkles which appear around the player. The length and the pitches depend on the sprite number of the object.
Input
IX The address of the object
Make a beep for each remaining frame.
PlayAppearingSound B604 LD A,(IX+$00) Fetch the sprite number.
B607 RLCA Rotate it twice.
B608 RLCA
B609 AND %00011111 Keep bits 0 to 4.
B60B OR %00000011 Set bits 0 and 1.
B60D LD C,A Keep the number of beeps in C.
PlayAppearingSound_NextBeep B60E LD A,C Copy the number of beeps to A.
B60F RLCA Rotate it twice.
B610 RLCA
B611 LD B,A Keep the pitch in B.
B612 CALL PlaySquareWave Call PlaySquareWave.
B615 DEC C Count down the beeps.
B616 JR NZ,PlayAppearingSound_NextBeep Jump to PlayAppearingSound_NextBeep until all of them have been played.
B618 RET Return.
View the equivalent code in;
Prev: B5EE Up: Map Next: B619