diff options
author | Torbjörn Andersson | 2012-12-01 11:40:33 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2012-12-01 11:43:51 +0100 |
commit | 5cd7e5d777c7199b3f4d73d0a3d39a9c85d93188 (patch) | |
tree | 8e87e5e9036f88f9561839e7facbcf6c3f6d6489 /audio/softsynth | |
parent | 9d6ab15a3b8121b43e6f410e9f0fad1c69ac8cd8 (diff) | |
download | scummvm-rg350-5cd7e5d777c7199b3f4d73d0a3d39a9c85d93188.tar.gz scummvm-rg350-5cd7e5d777c7199b3f4d73d0a3d39a9c85d93188.tar.bz2 scummvm-rg350-5cd7e5d777c7199b3f4d73d0a3d39a9c85d93188.zip |
AUDIO: Fix AdLib volume regression in pre-iMUSE SCUMM games
This assumes that _scummSmallHeader = 1 means we don't care about
what _opl3Mode is when calculating the volume in mcKeyOn(). I hope
this is correct.
Diffstat (limited to 'audio/softsynth')
-rw-r--r-- | audio/softsynth/adlib.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp index 657eb7846f..00fa9ca88b 100644 --- a/audio/softsynth/adlib.cpp +++ b/audio/softsynth/adlib.cpp @@ -1998,28 +1998,30 @@ void MidiDriver_ADLIB::mcKeyOn(AdLibVoice *voice, const AdLibInstrument *instr, if (voice->_duration != 0) voice->_duration *= 63; + if (!_scummSmallHeader) { #ifdef ENABLE_OPL3 - if (!_opl3Mode) - vol1 = (instr->modScalingOutputLevel & 0x3F) + g_volumeLookupTable[velocity >> 1][instr->modWaveformSelect >> 2]; - else + if (!_opl3Mode) + vol1 = (instr->modScalingOutputLevel & 0x3F) + g_volumeLookupTable[velocity >> 1][instr->modWaveformSelect >> 2]; + else #endif - if (!_scummSmallHeader) vol1 = (instr->modScalingOutputLevel & 0x3F) + (velocity * ((instr->modWaveformSelect >> 3) + 1)) / 64; - else + } else { vol1 = 0x3f - (instr->modScalingOutputLevel & 0x3F); + } if (vol1 > 0x3F) vol1 = 0x3F; voice->_vol1 = vol1; + if (!_scummSmallHeader) { #ifdef ENABLE_OPL3 - if (!_opl3Mode) - vol2 = (instr->carScalingOutputLevel & 0x3F) + g_volumeLookupTable[velocity >> 1][instr->carWaveformSelect >> 2]; - else + if (!_opl3Mode) + vol2 = (instr->carScalingOutputLevel & 0x3F) + g_volumeLookupTable[velocity >> 1][instr->carWaveformSelect >> 2]; + else #endif - if (!_scummSmallHeader) vol2 = (instr->carScalingOutputLevel & 0x3F) + (velocity * ((instr->carWaveformSelect >> 3) + 1)) / 64; - else + } else { vol2 = 0x3f - (instr->carScalingOutputLevel & 0x3F); + } if (vol2 > 0x3F) vol2 = 0x3F; voice->_vol2 = vol2; |