Prev: A0D8 Up: Map Next: A0F5
A0E4: Sounds: Sword
Used by the routines at Handle_Sabreman_Jumping and Handle_Collectable.
Plays 10 tones of one cycle each. The half period of each tone is the counter multiplied by 10 and exclusive ORed with 1C.
SoundsSword A0E4 LD D,$10 Set the number of tones to 10.
SoundsSword_Loop A0E6 LD A,D Fetch the tone counter, which is used to work out the half period of the tone.
A0E7 RLCA Rotate it left twice.
A0E8 RLCA
A0E9 XOR %00000111 Flip the low three bits.
A0EB RLCA Rotate it left twice again, which makes the half period.
A0EC RLCA
A0ED LD B,A Store the half period in B.
A0EE CALL SoundsClick Play the tone.
A0F1 DEC D Decrease the tone counter and loop back until all of the tones have been played.
A0F2 JR NZ,SoundsSword_Loop
A0F4 RET Return.
View the equivalent code in;
Prev: A0D8 Up: Map Next: A0F5