![]() |
Routines |
| Prev: 27309 | Up: Map | Next: 27351 |
|
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 30. Action 0 of the bytecode jumps straight to the same ROM routine, whose address is the operand of the jump below.
|
||||
| Beep | 27332 | AND A | Duration A is the low byte of HL, and B is the pitch. | |
| 27333 | LD L,A | |||
| 27334 | LD A,B | |||
| 27335 | LD D,0 | The high byte of the duration, and D, start at zero. | ||
| 27337 | LD H,D | |||
| 27338 | ADD A,A | Shift the pitch two places, keeping the overflow in D. | ||
| 27339 | ADD A,A | |||
| 27340 | RL D | |||
| 27342 | LD E,A | Save that pitch. | ||
| 27343 | PUSH DE | |||
| 27344 | CALL 12457 | Call HL=HL*DE to scale the duration by the pitch. | ||
| 27347 | POP DE | Restore the pitch for the beeper from the stack. | ||
| 27348 | JP 949 | Jump to BEEPER. | ||
| Prev: 27309 | Up: Map | Next: 27351 |