Prev: 9B0D Up: Map Next: 9B87
9B59: Increase attenuation for all tune channels
Used by the routine at sound_player.
dampen_all_tune_channels 9B59 LD IX,tune_data_buffer_1 First tune data data buffer
9B5D LD B,$04 4 channels
9B5F LD DE,$000A Size of sound data
9B62 LD A,(tune_index) Get tune index
9B65 CP $03 If < 3
9B67 JR C,dampen_all_tune_channels_0 Then skip ahead
9B69 LD A,$FF Else set first byte
9B6B LD (tune_data_buffer_1),A of buffer to $FF (mute)
9B6E JR dampen_all_tune_channels_1 and skip first channel
dampen_all_tune_channels_0 9B70 LD A,(IX+$07) Get countdown for when to increase attenuation
9B73 DEC A and decrement
9B74 JP M,dampen_all_tune_channels_1 If it was 0 then move to next channel
9B77 LD (IX+$07),A Else save new value
9B7A LD A,(IX+$04) Get attenuation in bits 4-7
9B7D ADD A,$10 Add 1
9B7F LD (IX+$04),A Save again
dampen_all_tune_channels_1 9B82 ADD IX,DE Next channel
9B84 DJNZ dampen_all_tune_channels_0 Loop for 4 channels
9B86 RET
Prev: 9B0D Up: Map Next: 9B87