![]() |
Routines |
| Prev: C026 | Up: Map | Next: C041 |
|
Used by the routine at TUNE_PLAY_NOTE.
A note is a number of semitones, -12 to 40, or 41 for a rest. Twelve is added to it to index the table of pitches at offset 8 of TUNE_VOICES (TUNE_NOTES), which gives the number of turns of the player's loop between two toggles of the speaker bit. The rest's entry is 1: a toggle every turn, about 18 kHz, too high to be heard as a note; when both voices rest, TUNE_PLAY_NOTE plays nothing at all.
|
||||||||||||||
| TUNE_PITCH | C033 | LD A,(HL) | The table, indexed by the note plus 12. | |||||||||||
| C034 | ADD A,$0C | |||||||||||||
| C036 | LD E,A | |||||||||||||
| C037 | LD D,$00 | |||||||||||||
| C039 | LD HL,TUNE_NOTES | |||||||||||||
| C03C | ADD HL,DE | |||||||||||||
| C03D | LD H,(HL) | H: the pitch; L: 1, so that the voice toggles on the first turn. | ||||||||||||
| C03E | LD L,$01 | |||||||||||||
| C040 | RET | |||||||||||||
| Prev: C026 | Up: Map | Next: C041 |