From 02cac2d5aadaf73385ea979afdf6222a72b026cf Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Fri, 9 Jul 2010 21:36:59 +0000 Subject: KYRA/PC98: fix music volume svn-id: r50772 --- engines/kyra/sound_towns.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index f6d71f8549..8003ca25f3 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -2788,16 +2788,15 @@ void TownsPC98_OpnSquareSineSource::nextTick(int32 *buffer, uint32 bufferSize) { int32 finOut = 0; for (int ii = 0; ii < 3; ii++) { - if ((_channels[ii].vol >> 4) & 1) - finOut += _tleTable[_channels[ii].out ? _pReslt : 0]; - else - finOut += _tlTable[_channels[ii].out ? (_channels[ii].vol & 0x0f) : 0]; + int32 finOutTemp = ((_channels[ii].vol >> 4) & 1) ? _tleTable[_channels[ii].out ? _pReslt : 0] : _tlTable[_channels[ii].out ? (_channels[ii].vol & 0x0f) : 0]; if ((1 << ii) & _volMaskA) - finOut = (finOut * _volumeA) / Audio::Mixer::kMaxMixerVolume; + finOutTemp = (finOutTemp * _volumeA) / Audio::Mixer::kMaxMixerVolume; if ((1 << ii) & _volMaskB) - finOut = (finOut * _volumeB) / Audio::Mixer::kMaxMixerVolume; + finOutTemp = (finOutTemp * _volumeB) / Audio::Mixer::kMaxMixerVolume; + + finOut += finOutTemp; } finOut /= 3; -- cgit v1.2.3