Prev: A0E4 Up: Map Next: A107
A0F5: Play Position Sound
Used by the routine at Check_Sabreman_Contact.
Plays 08 tones of one cycle each. The half period of each tone depends on the y position of the object: it is made from the counter added to the y position, keeping the low four bits, inverted and rotated left.
Input
IX Object record
Play_Position_Sound A0F5 LD D,$08 Set the number of tones to 08.
Play_Position_Sound_Loop A0F7 LD A,D Fetch the tone counter.
A0F8 ADD A,(IX+$03) Add the y position of the object, so that the pitch depends on its position.
A0FB AND %00001111 Keep only the low four bits.
A0FD CPL Invert the bits.
A0FE RLCA Rotate the result left.
A0FF LD B,A Use the result as the half period.
A100 CALL SoundsClick Play the tone.
A103 DEC D Decrease the tone counter and loop back until all of the tones have been played.
A104 JR NZ,Play_Position_Sound_Loop
A106 RET Return.
Prev: A0E4 Up: Map Next: A107