Prev: B676 Up: Map Next: B6A9
B690: A warble for the remote-controlled robots
Used by the routines at REMOTE_ROBOT and SLOW_CHASER.
A few single waves, their pitch scrambled from the turn counter and the step count with an XOR. How many is read from a table at HL, indexed by the turn counter's low two bits: REMOTE_ROBOT passes WARBLE_COUNTS, SLOW_CHASER the fifth byte of it, so the two run through different parts of the same rise and fall.
Input
HL the table of wave counts (WARBLE_COUNTS, or four bytes into it)
WARBLE_SOUND B690 LD A,(TURNS) C = the table's entry for the turn counter's low two bits
B693 AND $03
B695 CALL ADD_HL_A
B698 LD C,(HL)
WARBLE_SOUND_0 B699 LD A,(TURNS) one wave at half-wave count 64 + ((turns XOR C) AND 31)
B69C XOR C
B69D AND $1F
B69F OR $40
B6A1 LD B,A
B6A2 CALL CLICK
B6A5 DEC C until C runs out
B6A6 JR NZ,WARBLE_SOUND_0
B6A8 RET
Prev: B676 Up: Map Next: B6A9