From 2c71ca789f66b25910bd729d202948ed3e3fb78e Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sun, 9 Jan 2022 15:36:01 +0200 Subject: [PATCH] Fixed a regression caused by a recent optimization --- Core/apu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/apu.c b/Core/apu.c index ce775fb..2708113 100644 --- a/Core/apu.c +++ b/Core/apu.c @@ -1002,7 +1002,9 @@ void GB_apu_write(GB_gameboy_t *gb, uint8_t reg, uint8_t value) /* These registers affect the output of all 4 channels (but not the output of the PCM registers).*/ /* We call update_samples with the current value so the APU output is updated with the new outputs */ for (unsigned i = GB_N_CHANNELS; i--;) { - update_sample(gb, i, gb->apu.samples[i], 0); + int8_t sample = gb->apu.samples[i]; + gb->apu.samples[i] = 0x10; // Invalidate to force update + update_sample(gb, i, sample, 0); } break; case GB_IO_NR52: {