git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit f52152b2c9c34ae7624de5eda2e28ecfe034751d
parent 586459bb74d961f982e5e4b867e3dd42b20e738e
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Wed, 23 Feb 2022 20:34:50 +0200

Fix the Preserve Waveforms setting

Diffstat:
MCore/apu.c13+++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/Core/apu.c b/Core/apu.c @@ -243,25 +243,22 @@ static void render(GB_gameboy_t *gb) unsigned left_volume = 0; unsigned right_volume = 0; unrolled for (unsigned i = GB_N_CHANNELS; i--;) { - if (gb->apu.is_active[i]) { + if (GB_apu_is_DAC_enabled(gb, i)) { if (mask & 1) { - left_volume += (gb->io_registers[GB_IO_NR50] & 7) * CH_STEP * 0xF; + left_volume += ((gb->io_registers[GB_IO_NR50] & 7) + 1) * CH_STEP * 0xF; } if (mask & 0x10) { - right_volume += ((gb->io_registers[GB_IO_NR50] >> 4) & 7) * CH_STEP * 0xF; + right_volume += (((gb->io_registers[GB_IO_NR50] >> 4) & 7) + 1) * CH_STEP * 0xF; } } - else { - left_volume += gb->apu_output.current_sample[i].left * CH_STEP; - right_volume += gb->apu_output.current_sample[i].right * CH_STEP; - } mask >>= 1; } gb->apu_output.highpass_diff = (GB_double_sample_t) {left_volume * (1 - gb->apu_output.highpass_rate) + gb->apu_output.highpass_diff.left * gb->apu_output.highpass_rate, right_volume * (1 - gb->apu_output.highpass_rate) + gb->apu_output.highpass_diff.right * gb->apu_output.highpass_rate}; - case GB_HIGHPASS_MAX:; + case GB_HIGHPASS_MAX: + unreachable(); } }

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.