scale dma b with dma b volume instead of dma a volume

This commit is contained in:
Matthew Berry 2021-01-10 12:33:18 -08:00
parent 2c87495836
commit 4f1218cf54

View file

@ -117,9 +117,9 @@ class APU
vol_a = ((100 >> (1 - @soundcnt_h.dma_sound_a_volume)) / 100).to_f32
vol_b = ((100 >> (1 - @soundcnt_h.dma_sound_b_volume)) / 100).to_f32
dma_left = ((dma_a * @soundcnt_h.dma_sound_a_left * vol_a) +
(dma_b * @soundcnt_h.dma_sound_b_left * vol_a)) / 2
(dma_b * @soundcnt_h.dma_sound_b_left * vol_b)) / 2
dma_right = ((dma_a * @soundcnt_h.dma_sound_a_right * vol_a) +
(dma_b * @soundcnt_h.dma_sound_b_right * vol_a)) / 2
(dma_b * @soundcnt_h.dma_sound_b_right * vol_b)) / 2
@buffer[@buffer_pos] = (psg_left + 2*dma_left) / 3
@buffer[@buffer_pos + 1] = (psg_right + 2*dma_right) / 3