![]() |
Routines |
| Prev: 46843 | Up: Map | Next: 46866 |
|
Used by the routines at PlayAppearingSound, PlayJumpSound, PlaySoundFromObjectNumber, PlayMovingSound and PlayWaveSequence.
Plays a single beep by switching the speaker on, waiting, switching it off and waiting again. The bigger the pitch, the longer the beep.
|
||||||||
|
Hold the speaker on, then off.
|
||||||||
| PlaySquareWave | 46850 | LD A,16 | Turn the speaker on. | |||||
| 46852 | OUT (254),A | |||||||
| 46854 | LD A,B | Keep the pitch in A. | ||||||
| PlaySquareWave_FirstDelay | 46855 | DJNZ PlaySquareWave_FirstDelay | Wait for the first half of the beep. | |||||
| 46857 | LD B,A | Restore the pitch. | ||||||
| 46858 | XOR A | Turn the speaker off. | ||||||
| 46859 | OUT (254),A | |||||||
| 46861 | LD A,B | Keep the pitch in A. | ||||||
| PlaySquareWave_SecondDelay | 46862 | DJNZ PlaySquareWave_SecondDelay | Wait for the second half of the beep. | |||||
| 46864 | LD B,A | Restore the pitch. | ||||||
| 46865 | RET | Return. | ||||||
|
View the equivalent code in;
|
||||||||
| Prev: 46843 | Up: Map | Next: 46866 |