![]() |
Routines |
| Prev: 71D3 | Up: Map | Next: 71F0 |
|
Used by the routines at PlayArrivalSound, PlayWarble, PlayFlutterSound, PlayHitSound and PlayBumpSound.
Makes one cycle of a square wave with the speaker. The speaker is on for as long as it is off, which is set by B: the higher it is, the lower the note.
|
||||||||||||
| PlaySquareWave | 71E0 | LD A,$10 | Turn the speaker on. | |||||||||
| 71E2 | OUT ($FE),A | Send that to the speaker. | ||||||||||
| 71E4 | LD A,B | Keep the half-period. | ||||||||||
| PlaySquareWave_Delay | 71E5 | DJNZ PlaySquareWave_Delay | Hold this half of the cycle. | |||||||||
| 71E7 | LD B,A | Restore the half-period. | ||||||||||
| 71E8 | XOR A | Turn the speaker off. | ||||||||||
| 71E9 | OUT ($FE),A | Send that to the speaker. | ||||||||||
| 71EB | LD A,B | Keep the half-period again. | ||||||||||
| PlaySquareWave_Wait | 71EC | DJNZ PlaySquareWave_Wait | Hold the other half of the cycle. | |||||||||
| 71EE | LD B,A | Restore the half-period. | ||||||||||
| 71EF | RET | Return. | ||||||||||
|
View the equivalent code in;
|
||||||||||||
| Prev: 71D3 | Up: Map | Next: 71F0 |