aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound/audio32.cpp
diff options
context:
space:
mode:
authorColin Snover2017-09-09 15:52:45 -0500
committerColin Snover2017-09-09 23:29:57 -0500
commite137d01967021d8fceef45c727615c797a9cdd91 (patch)
treeaec2b3ee6f832a215d439e4cb0a332695b75ec8c /engines/sci/sound/audio32.cpp
parent29465fd116ac120d1710a3e3967d07a9823fc526 (diff)
downloadscummvm-rg350-e137d01967021d8fceef45c727615c797a9cdd91.tar.gz
scummvm-rg350-e137d01967021d8fceef45c727615c797a9cdd91.tar.bz2
scummvm-rg350-e137d01967021d8fceef45c727615c797a9cdd91.zip
SCI32: Fix Phant2 movie-vs-game playback volumes
This update should give the game the default mix it receives in Windows. If necessary, the half-volume audio bug in the DOS interpreter can be added as an additional hack for this game, since there are still some sub-par audio mixes that might need additional correction (like Curtis talking to Blob when taking her out of the cage in his apartment at the start of the game) which were also bad in the Windows version of the game. Fixes Trac#10165.
Diffstat (limited to 'engines/sci/sound/audio32.cpp')
-rw-r--r--engines/sci/sound/audio32.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp
index c3f9eb4098..ad9af4ebf6 100644
--- a/engines/sci/sound/audio32.cpp
+++ b/engines/sci/sound/audio32.cpp
@@ -359,6 +359,17 @@ int Audio32::readBuffer(Audio::st_sample_t *const buffer, const int numSamples)
} else if (volume > 84 && volume < kMaxVolume) {
volume = 63;
}
+ } else if (getSciVersion() == SCI_VERSION_3 && volume != kMaxVolume) {
+ // In SCI3, granularity of the non-maximum volumes is 1/32
+ volume &= ~4;
+
+ // NOTE: In the SSCI DOS interpreter, non-maximum volumes are
+ // divided by 8 which puts them in a range of [0, 16). That
+ // reduced volume range gets passed into a volume function which
+ // expects values [0, 32). So, effectively, all non-maximum
+ // volumes are half-volume in DOS in SCI3. In Windows, volumes
+ // [120, 124) are the same as 127 due to a programming bug.
+ // We do not emulate either of these incorrect behaviors.
}
leftVolume = rightVolume = volume * Audio::Mixer::kMaxChannelVolume / kMaxVolume;