From 90b76d20e3396823572646b18fa25a7a142e4f20 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 12 Jul 2023 06:04:37 -0500 Subject: [PATCH] C64: fix reSIDfp muting --- src/engine/platform/sound/c64_fp/SID.cpp | 6 +++--- src/engine/platform/sound/c64_fp/SID.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/engine/platform/sound/c64_fp/SID.cpp b/src/engine/platform/sound/c64_fp/SID.cpp index a996d2230..03c778c90 100644 --- a/src/engine/platform/sound/c64_fp/SID.cpp +++ b/src/engine/platform/sound/c64_fp/SID.cpp @@ -351,7 +351,7 @@ void SID::write(int offset, unsigned char value) break; case 0x04: // Voice #1 control register - voice[0]->writeCONTROL_REG(muted[0] ? 0 : value); + voice[0]->writeCONTROL_REG(value); break; case 0x05: // Voice #1 Attack and Decay length @@ -379,7 +379,7 @@ void SID::write(int offset, unsigned char value) break; case 0x0b: // Voice #2 control register - voice[1]->writeCONTROL_REG(muted[1] ? 0 : value); + voice[1]->writeCONTROL_REG(value); break; case 0x0c: // Voice #2 Attack and Decay length @@ -407,7 +407,7 @@ void SID::write(int offset, unsigned char value) break; case 0x12: // Voice #3 control register - voice[2]->writeCONTROL_REG(muted[2] ? 0 : value); + voice[2]->writeCONTROL_REG(value); break; case 0x13: // Voice #3 Attack and Decay length diff --git a/src/engine/platform/sound/c64_fp/SID.h b/src/engine/platform/sound/c64_fp/SID.h index 85b6a4e4d..77d7706d4 100644 --- a/src/engine/platform/sound/c64_fp/SID.h +++ b/src/engine/platform/sound/c64_fp/SID.h @@ -320,11 +320,11 @@ int SID::output() const int v2 = voice[1]->output(voice[0]->wave()); const int v3 = voice[2]->output(voice[1]->wave()); - lastChanOut[0]=v1; - lastChanOut[1]=v2; - lastChanOut[2]=v3; + lastChanOut[0]=muted[0]?0:v1; + lastChanOut[1]=muted[1]?0:v2; + lastChanOut[2]=muted[2]?0:v3; - return externalFilter->clock(filter->clock(v1, v2, v3)); + return externalFilter->clock(filter->clock(muted[0]?0:v1, muted[1]?0:v2, muted[2]?0:v3)); }