Prev: D68C Up: Map Next: D744
D6DB: Configure note for current channel
Used by the routine at D68C.
Input
IX address pointer to channel data buffer
D6DB LD A,(IX+$00) Return if channel is not active
D6DE CP $FF
D6E0 RET Z
D6E1 CALL $D744 Send channel volume command
D6E4 CALL $D759 Send channel volume command
D6E7 LD L,(IX+$02) Set IY to the address pointer for the sound data
D6EA LD H,(IX+$03)
D6ED PUSH HL
D6EE POP IY
D6F0 DEC (IX+$01) Decrement variation counter
D6F3 JP Z,$D715 If counter is 0 jump to configure next note
D6F6 LD E,(IY+$01) Set BC value of pitch and coarse delta
D6F9 LD C,E
D6FA RL E
D6FC SBC A,A
D6FD LD B,A
D6FE LD L,(IX+$04) Increment pitch and coarse data for tone/noise
D701 LD H,(IX+$05)
D704 ADD HL,BC
D705 LD (IX+$04),L
D708 LD (IX+$05),H
D70B LD A,(IX+$07) Increment/decrement volume
D70E ADD A,(IY+$02)
D711 LD (IX+$07),A
D714 RET
check if there are more tones
D715 DEC (IX+$00) Decrement tones number?
D718 JP Z,$D733 if zero jump to disable channel
D71B INC IY Point IY to the next tone data
D71D INC IY
D71F INC IY
D721 PUSH IY Update address pointer to tone data
D723 POP HL
D724 LD (IX+$02),L
D727 LD (IX+$03),H
D72A LD A,(IY+$00) Set new variation counter
D72D LD (IX+$01),A
D730 JP $D6DB Configure next tone
disable channel
D733 LD A,($D857) Set volume to zero for current channel
D736 ADD A,$07
D738 LD D,A
D739 LD E,$00
D73B CALL $D759 Send volume command
D73E LD A,$FF Disable current channel
D740 LD (IX+$00),A
D743 RET
Prev: D68C Up: Map Next: D744