From dba7370d6de5b5a9ca55cd24398f89667c8d8e52 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 12 Aug 2017 20:47:55 +0300 Subject: [PATCH] =?UTF-8?q?Turns=20out=20APU=20signal=20is=20inverted.=20T?= =?UTF-8?q?his=20fixes=20Perfect=20Dark=E2=80=99s=20audio.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/apu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/apu.c b/Core/apu.c index 319aadbb..fe5d6b0a 100755 --- a/Core/apu.c +++ b/Core/apu.c @@ -33,7 +33,7 @@ static void update_sample(GB_gameboy_t *gb, unsigned index, uint8_t value, unsig if (gb->io_registers[GB_IO_NR51] & (0x10 << index)) { right_volume = (gb->io_registers[GB_IO_NR50] >> 4) & 7;; } - GB_sample_t output = {value * left_volume, value * right_volume}; + GB_sample_t output = {(0xf - value) * left_volume, (0xf - value) * right_volume}; if (*(uint32_t *)&(gb->apu_output.current_sample[index]) != *(uint32_t *)&output) { refresh_channel(gb, index, cycles_offset); gb->apu_output.current_sample[index] = output;