From a39b314378f67ce56eff97d606b7e8b9ea93708e Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 3 Nov 2018 14:33:12 +0200 Subject: [PATCH] Fixed silly APU regression (Noise volume envelope ran too fast) Fixes #121 --- Core/apu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/apu.c b/Core/apu.c index ff1cb5c..f9aabd7 100644 --- a/Core/apu.c +++ b/Core/apu.c @@ -274,7 +274,7 @@ void GB_apu_div_event(GB_gameboy_t *gb) } } - if (gb->apu.is_active[GB_NOISE] && gb->apu.noise_channel.volume_countdown && (gb->io_registers[GB_IO_NR42] & 7)) { + if (gb->apu.is_active[GB_NOISE] && gb->apu.noise_channel.volume_countdown == 0 && (gb->io_registers[GB_IO_NR42] & 7)) { tick_noise_envelope(gb); } }