[Scummvm-cvs-logs] scummvm master -> 5cd7e5d777c7199b3f4d73d0a3d39a9c85d93188

eriktorbjorn eriktorbjorn at telia.com
Sat Dec 1 11:45:01 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:
5cd7e5d777 AUDIO: Fix AdLib volume regression in pre-iMUSE SCUMM games


Commit: 5cd7e5d777c7199b3f4d73d0a3d39a9c85d93188
    https://github.com/scummvm/scummvm/commit/5cd7e5d777c7199b3f4d73d0a3d39a9c85d93188
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2012-12-01T02:43:51-08:00

Commit Message:
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.

Changed paths:
    audio/softsynth/adlib.cpp



diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp
index 657eb78..00fa9ca 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;






More information about the Scummvm-git-logs mailing list