Prev: 42011 Up: Map Next: 42040
42023: Sounds: Sword
Used by the routine at ThrowSword.
Plays 16 clicks, one straight after the other. The half period of each click is the counter rotated left twice, exclusive ORed with 7 and rotated left twice again.
SoundsSword 42023 LD D,16 D=16 (the counter).
SoundsSword_Loop 42025 LD A,D Fetch the click counter.
42026 RLCA Rotate left twice.
42027 RLCA
42028 XOR %00000111 Flip bits 0-2.
42030 RLCA Rotate left twice.
42031 RLCA
42032 LD B,A Keep the half period in B.
42033 CALL SoundsClick Play a click with SoundsClick.
42036 DEC D Decrease the counter by one and loop back to SoundsSword_Loop until all of the clicks have been played.
42037 JR NZ,SoundsSword_Loop
42039 RET Return.
View the equivalent code in;
Prev: 42011 Up: Map Next: 42040