From 4f1218cf54d5dce03a0a9c17829479303828aa87 Mon Sep 17 00:00:00 2001 From: Matthew Berry Date: Sun, 10 Jan 2021 12:33:18 -0800 Subject: [PATCH] scale dma b with dma b volume instead of dma a volume --- src/crab/apu.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crab/apu.cr b/src/crab/apu.cr index 88b5aac..89ca4b2 100644 --- a/src/crab/apu.cr +++ b/src/crab/apu.cr @@ -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