Prev: 46574 Up: Map Next: 46617
46596: 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 46596 LD A,(IX+0) Fetch the sprite number.
46599 RLCA Rotate it twice.
46600 RLCA
46601 AND %00011111 Keep bits 0 to 4.
46603 OR %00000011 Set bits 0 and 1.
46605 LD C,A Keep the number of beeps in C.
PlayAppearingSound_NextBeep 46606 LD A,C Copy the number of beeps to A.
46607 RLCA Rotate it twice.
46608 RLCA
46609 LD B,A Keep the pitch in B.
46610 CALL PlaySquareWave Call PlaySquareWave.
46613 DEC C Count down the beeps.
46614 JR NZ,PlayAppearingSound_NextBeep Jump to PlayAppearingSound_NextBeep until all of them have been played.
46616 RET Return.
View the equivalent code in;
Prev: 46574 Up: Map Next: 46617