Prev: D424 Up: Map Next: D4DC
D473: Configure note for current channel
Used by the routine at D424.
Input
IX address pointer to channel data buffer
D473 LD A,(IX+$00) Return if channel is not active
D476 CP $FF
D478 RET Z
D479 CALL $D4DC Send channel volume command
D47C CALL $D4F1 Send channel volume command
D47F LD L,(IX+$02) Set IY to the address pointer for the sound da
D482 LD H,(IX+$03)
D485 PUSH HL
D486 POP IY
D488 DEC (IX+$01) Decrement variation counter
D48B JP Z,$D4AD If counter is 0 jump to configure next note
D48E LD E,(IY+$01) Set BC value of pitch and coarse delta
D491 LD C,E
D492 RL E
D494 SBC A,A
D495 LD B,A
D496 LD L,(IX+$04) Increment pitch and coarse data for tone/noise
D499 LD H,(IX+$05)
D49C ADD HL,BC
D49D LD (IX+$04),L
D4A0 LD (IX+$05),H
D4A3 LD A,(IX+$07) Increment/decrement volume
D4A6 ADD A,(IY+$02)
D4A9 LD (IX+$07),A
D4AC RET
check if there are more tones
D4AD DEC (IX+$00) Decrement tones number?
D4B0 JP Z,$D4CB if zero jump to disable channel
D4B3 INC IY Point IY to the next tone data
D4B5 INC IY
D4B7 INC IY
D4B9 PUSH IY Update address pointer to tone data
D4BB POP HL
D4BC LD (IX+$02),L
D4BF LD (IX+$03),H
D4C2 LD A,(IY+$00) Set new variation counter
D4C5 LD (IX+$01),A
D4C8 JP $D473 Configure next tone
disable channel
D4CB LD A,($D5EF) Set volume to zero for current channel
D4CE ADD A,$07
D4D0 LD D,A
D4D1 LD E,$00
D4D3 CALL $D4F1 Send volume command
D4D6 LD A,$FF Disable current channel
D4D8 LD (IX+$00),A
D4DB RET
Prev: D424 Up: Map Next: D4DC