Prev: 8B60 Up: Map Next: 8BB1
8B80: A note on the speaker
Used by the routine at RUN_SCRIPT.
Input
A The note, an index into TONES
TONE 8B80 AND $1F HL = the note's entry.
8B82 RLA
8B83 ADD A,$B1
8B85 LD L,A
8B86 LD H,$8B
8B88 LD A,(BORDER) The border colour, with the MIC and speaker bits set.
8B8B AND $07
8B8D OR $18
8B8F LD C,A
8B90 LD E,(HL) E = the pitch, B = the half-cycles.
8B91 INC HL
8B92 LD B,(HL)
TONE_0 8B93 LD A,E The pitch delay...
TONE_1 8B94 DEC A
8B95 JP NZ,TONE_1
8B98 NOP
8B99 NOP
8B9A NOP
8B9B NOP
8B9C NOP
8B9D NOP
8B9E NOP
8B9F NOP
8BA0 NOP
8BA1 NOP
8BA2 LD A,C ...then flip the speaker.
8BA3 XOR $10
8BA5 LD C,A
8BA6 OUT ($FE),A
8BA8 DEC B
8BA9 JP NZ,TONE_0
8BAC AND $EF Speaker off.
8BAE OUT ($FE),A
8BB0 RET
Prev: 8B60 Up: Map Next: 8BB1