diff options
author | Martin Kiewitz | 2010-07-09 16:05:47 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-07-09 16:05:47 +0000 |
commit | eddd6d0dba563349b1d3a16bf0251ba9f5f194c1 (patch) | |
tree | 6d25ff212475775445f8e930b9128c8ec8147ad1 /engines/sci | |
parent | aadf2e976555d08b7f8e773cc4d69882fa1c9d3d (diff) | |
download | scummvm-rg350-eddd6d0dba563349b1d3a16bf0251ba9f5f194c1.tar.gz scummvm-rg350-eddd6d0dba563349b1d3a16bf0251ba9f5f194c1.tar.bz2 scummvm-rg350-eddd6d0dba563349b1d3a16bf0251ba9f5f194c1.zip |
SCI: actually all sound-sci0 games used a completely different kDoSoundPause logic, implement it - fixes all sorts of games not pausing when going to restore menu and more
svn-id: r50760
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 38 |
2 files changed, 20 insertions, 20 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 99c2ba1d5d..3e30480b99 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -260,7 +260,7 @@ static const SciKernelMapSubEntry kDoSound_subops[] = { { SIG_SOUNDSCI0, 3, MAP_CALL(DoSoundDispose), "o", NULL }, { SIG_SOUNDSCI0, 4, MAP_CALL(DoSoundMute), "(i)", NULL }, { SIG_SOUNDSCI0, 5, MAP_CALL(DoSoundStop), "o", NULL }, - { SIG_SOUNDSCI0, 6, MAP_CALL(DoSoundPause), "[o0i]", NULL }, + { SIG_SOUNDSCI0, 6, MAP_CALL(DoSoundPause), "i", NULL }, { SIG_SOUNDSCI0, 7, MAP_CALL(DoSoundResume), "o", NULL }, { SIG_SOUNDSCI0, 8, MAP_CALL(DoSoundMasterVolume), "(i)", NULL }, { SIG_SOUNDSCI0, 9, MAP_CALL(DoSoundUpdate), "o", NULL }, diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index b23aed4745..26fbfb6c7c 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -209,30 +209,30 @@ void SoundCommandParser::processStopSound(reg_t obj, bool sampleFinishedPlaying) } reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) { + if (_soundVersion <= SCI_VERSION_0_LATE) { + uint16 value = argv[0].toUint16(); + MusicEntry *musicSlot = _music->getActiveSci0MusicSlot(); + switch (value) { + case 1: + if ((musicSlot) && (musicSlot->status == kSoundPlaying)) + _music->soundPause(musicSlot); + return make_reg(0, 0); + case 0: + if ((musicSlot) && (musicSlot->status == kSoundPaused)) { + _music->soundResume(musicSlot); + return make_reg(0, 1); + } + return make_reg(0, 0); + default: + error("kDoSoundPause: parameter 0 is invalid for sound-sci0"); + } + } + reg_t obj = argv[0]; uint16 value = argc > 1 ? argv[1].toUint16() : 0; - if (!obj.segment) { // pause the whole playlist // SCI0 games (up to including qfg1) give us 0/1 for either resuming or pausing the current music // this one doesn't count, so pausing 2 times and resuming once means here that we are supposed to resume - if (_soundVersion <= SCI_VERSION_0_LATE) { - // TODO: this code doesn't work right currently - return make_reg(0, 0); - MusicEntry *musicSlot = _music->getActiveSci0MusicSlot(); - switch (obj.offset) { - case 1: - if ((musicSlot) && (musicSlot->status == kSoundPlaying)) - _music->soundPause(musicSlot); - return make_reg(0, 0); - case 0: - if ((musicSlot) && (musicSlot->status == kSoundPaused)) - _music->soundResume(musicSlot); - return make_reg(0, 1); - return make_reg(0, 0); - default: - error("kDoSoundPause: parameter 0 is invalid for sound-sci0"); - } - } // Pausing/Resuming the whole playlist was introduced in the SCI1 late sound scheme. if (_soundVersion <= SCI_VERSION_1_EARLY) |