From 51be9b825d5669bf2496dcfd71b437a066b026aa Mon Sep 17 00:00:00 2001 From: Souryo Date: Wed, 26 Apr 2017 22:24:38 -0400 Subject: [PATCH] MMC5: Reduced square channel volume (to match APU's square channels) --- Core/MMC5Audio.h | 4 +++- Core/SoundMixer.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/MMC5Audio.h b/Core/MMC5Audio.h index 2771bdf9..976ddab3 100644 --- a/Core/MMC5Audio.h +++ b/Core/MMC5Audio.h @@ -76,7 +76,9 @@ protected: _square2.TickEnvelope(); } - int16_t summedOutput = (_square1.GetOutput() + _square2.GetOutput()) * 4 + _pcmOutput; + //"The sound output of the square channels are equivalent in volume to the corresponding APU channels" + //"The polarity of all MMC5 channels is reversed compared to the APU." + int16_t summedOutput = -(_square1.GetOutput() + _square2.GetOutput() + _pcmOutput); if(summedOutput != _lastOutput) { APU::AddExpansionAudioDelta(AudioChannel::MMC5, summedOutput - _lastOutput); _lastOutput = summedOutput; diff --git a/Core/SoundMixer.cpp b/Core/SoundMixer.cpp index c9426c1b..de6cb0b0 100644 --- a/Core/SoundMixer.cpp +++ b/Core/SoundMixer.cpp @@ -206,7 +206,7 @@ int16_t SoundMixer::GetOutputVolume(bool forRightChannel) return (int16_t)(squareVolume + tndVolume + GetChannelOutput(AudioChannel::FDS, forRightChannel) * 20 + - GetChannelOutput(AudioChannel::MMC5, forRightChannel) * 40 + + GetChannelOutput(AudioChannel::MMC5, forRightChannel) * 43 + GetChannelOutput(AudioChannel::Namco163, forRightChannel) * 20 + GetChannelOutput(AudioChannel::Sunsoft5B, forRightChannel) * 15 + GetChannelOutput(AudioChannel::VRC6, forRightChannel) * 75 +