From 882b1414783c07d7b1b04454bc6a59c6e07fb555 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Thu, 21 Sep 2017 18:32:21 +0300 Subject: [PATCH] Fixed dmg_sound-1 --- Core/apu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/apu.c b/Core/apu.c index 8935533..ec4b1d4 100755 --- a/Core/apu.c +++ b/Core/apu.c @@ -491,6 +491,9 @@ void GB_apu_write(GB_gameboy_t *gb, uint8_t reg, uint8_t value) case GB_IO_NR21: { unsigned index = reg == GB_IO_NR21? GB_SQUARE_2: GB_SQUARE_1; gb->apu.square_channels[index].pulse_length = (0x40 - (value & 0x3f)); + if (!gb->apu.global_enable) { + gb->io_registers[reg] &= 0x3f; + } break; }