Prev: 41188 Up: Map Next: 41223
41205: Play Position Sound
Used by the routine at Check_Sabreman_Contact.
Plays 8 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 41205 LD D,8 Set the number of tones to 8.
Play_Position_Sound_Loop 41207 LD A,D Fetch the tone counter.
41208 ADD A,(IX+3) Add the y position of the object, so that the pitch depends on its position.
41211 AND %00001111 Keep only the low four bits.
41213 CPL Invert the bits.
41214 RLCA Rotate the result left.
41215 LD B,A Use the result as the half period.
41216 CALL SoundsClick Play the tone.
41219 DEC D Decrease the tone counter and loop back until all of the tones have been played.
41220 JR NZ,Play_Position_Sound_Loop
41222 RET Return.
Prev: 41188 Up: Map Next: 41223