Prev: 6AAD Up: Map Next: 6AD7
6AC4: Action: Beep
Used by the routine at WaitForKey.
Turns A and B into a duration and a pitch and hands them to the ROM beeper. The key click uses A equal to 1E. Action 0 of the bytecode jumps straight to the same ROM routine, whose address is the operand of the jump below.
Input
A Duration
B Pitch
Beep 6AC4 AND A Carry is clear.
6AC5 LD L,A Put the duration in L.
6AC6 LD A,B Copy the pitch into A.
6AC7 LD D,$00 The high byte of the duration, and D, start at zero.
6AC9 LD H,D
6ACA ADD A,A Shift the pitch two places, keeping the overflow in D.
6ACB ADD A,A
6ACC RL D
6ACE LD E,A Put the pitch in E.
6ACF PUSH DE Stash it on the stack.
6AD0 CALL $30A9 Call HL_HLxDE to scale the duration by the pitch.
6AD3 POP DE Restore the pitch for the beeper from the stack.
6AD4 JP $03B5 Jump to BEEPER.
Prev: 6AAD Up: Map Next: 6AD7