[Scummvm-cvs-logs] scummvm master -> 8881f71ac5ae68422f27703928911e246b38c4b6
eriktorbjorn
eriktorbjorn at telia.com
Sat Dec 1 11:53:10 CET 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8881f71ac5 AUDIO: Fix AdLib volume when ENABLE_OPL3 is not defined
Commit: 8881f71ac5ae68422f27703928911e246b38c4b6
https://github.com/scummvm/scummvm/commit/8881f71ac5ae68422f27703928911e246b38c4b6
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2012-12-01T02:48:51-08:00
Commit Message:
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.
Changed paths:
audio/softsynth/adlib.cpp
diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp
index 00fa9ca..0cadea7 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);
}
More information about the Scummvm-git-logs
mailing list