aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-12-01 11:48:51 +0100
committerTorbjörn Andersson2012-12-01 11:48:51 +0100
commit8881f71ac5ae68422f27703928911e246b38c4b6 (patch)
tree75c730e962876503f95dafa9ec28122b98a211ce /audio/softsynth
parent5cd7e5d777c7199b3f4d73d0a3d39a9c85d93188 (diff)
downloadscummvm-rg350-8881f71ac5ae68422f27703928911e246b38c4b6.tar.gz
scummvm-rg350-8881f71ac5ae68422f27703928911e246b38c4b6.tar.bz2
scummvm-rg350-8881f71ac5ae68422f27703928911e246b38c4b6.zip
AUDIO: Fix AdLib volume when ENABLE_OPL3 is not defined
This should ensure that when ENABLE_OPL3 is not defined, the old code (using a lookup table) is used for calculating vol1 and vol2 (unless, of course, _scummSmallHeader is true). I hope I got it right this time.
Diffstat (limited to 'audio/softsynth')
-rw-r--r--audio/softsynth/adlib.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp
index 00fa9ca88b..0cadea7f22 100644
--- a/audio/softsynth/adlib.cpp
+++ b/audio/softsynth/adlib.cpp
@@ -2000,11 +2000,11 @@ void MidiDriver_ADLIB::mcKeyOn(AdLibVoice *voice, const AdLibInstrument *instr,
if (!_scummSmallHeader) {
#ifdef ENABLE_OPL3
- if (!_opl3Mode)
- vol1 = (instr->modScalingOutputLevel & 0x3F) + g_volumeLookupTable[velocity >> 1][instr->modWaveformSelect >> 2];
+ if (_opl3Mode)
+ vol1 = (instr->modScalingOutputLevel & 0x3F) + (velocity * ((instr->modWaveformSelect >> 3) + 1)) / 64;
else
#endif
- vol1 = (instr->modScalingOutputLevel & 0x3F) + (velocity * ((instr->modWaveformSelect >> 3) + 1)) / 64;
+ vol1 = (instr->modScalingOutputLevel & 0x3F) + g_volumeLookupTable[velocity >> 1][instr->modWaveformSelect >> 2];
} else {
vol1 = 0x3f - (instr->modScalingOutputLevel & 0x3F);
}
@@ -2014,11 +2014,11 @@ void MidiDriver_ADLIB::mcKeyOn(AdLibVoice *voice, const AdLibInstrument *instr,
if (!_scummSmallHeader) {
#ifdef ENABLE_OPL3
- if (!_opl3Mode)
- vol2 = (instr->carScalingOutputLevel & 0x3F) + g_volumeLookupTable[velocity >> 1][instr->carWaveformSelect >> 2];
+ if (_opl3Mode)
+ vol2 = (instr->carScalingOutputLevel & 0x3F) + (velocity * ((instr->carWaveformSelect >> 3) + 1)) / 64;
else
#endif
- vol2 = (instr->carScalingOutputLevel & 0x3F) + (velocity * ((instr->carWaveformSelect >> 3) + 1)) / 64;
+ vol2 = (instr->carScalingOutputLevel & 0x3F) + g_volumeLookupTable[velocity >> 1][instr->carWaveformSelect >> 2];
} else {
vol2 = 0x3f - (instr->carScalingOutputLevel & 0x3F);
}