diff options
author | Filippos Karapetis | 2010-11-24 14:21:31 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-11-24 14:21:31 +0000 |
commit | 364d37b302af3fec94b2a9cb441df3e960803446 (patch) | |
tree | 5d8f947a04c84910db3e6786fcc74b12f3cf51b8 /engines/sci/sound/soundcmd.cpp | |
parent | 642d15e43f8f6d1b989eb4e64edc095e74da5a61 (diff) | |
download | scummvm-rg350-364d37b302af3fec94b2a9cb441df3e960803446.tar.gz scummvm-rg350-364d37b302af3fec94b2a9cb441df3e960803446.tar.bz2 scummvm-rg350-364d37b302af3fec94b2a9cb441df3e960803446.zip |
SCI: some changes to the way reverb is handled
- "Invalid" SCI reverb values (127) are properly handled now
- SCI kDoSound(reverb) sets the global reverb (renamed it accordingly)
- kDoSound(reverb) can also return the current reverb if no parameter is sent
svn-id: r54457
Diffstat (limited to 'engines/sci/sound/soundcmd.cpp')
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index d8cfa672ce..644e2a43d7 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -491,9 +491,21 @@ reg_t SoundCommandParser::kDoSoundSendMidi(int argc, reg_t *argv, reg_t acc) { return acc; } -reg_t SoundCommandParser::kDoSoundReverb(int argc, reg_t *argv, reg_t acc) { - debugC(2, kDebugLevelSound, "doSoundReverb: %d", argv[0].toUint16() & 0xF); +reg_t SoundCommandParser::kDoSoundGlobalReverb(int argc, reg_t *argv, reg_t acc) { + if (argc == 0) + return make_reg(0, _music->getReverb()); + + debugC(2, kDebugLevelSound, "doSoundGlobalReverb: %d", argv[0].toUint16() & 0xF); + + // This is a bit different than SSCI, but the end result should be the same. + // SSCI checks the first entry in the playlist for its current reverb value. + // If it's 127 (invalid), it sets the reverb parameter of this call to the + // driver, otherwise it doesn't, to preserve the song's reverb. When we modify + // the global reverb, we send its value to the soundcard, if it isn't 127 (invalid). + // This assumes that the currently set reverb in the driver will be the reverb + // value sent from the last song, which should be the one at the top of the list. _music->setReverb(argv[0].toUint16() & 0xF); + return acc; } |