aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-09 16:05:47 +0000
committerMartin Kiewitz2010-07-09 16:05:47 +0000
commiteddd6d0dba563349b1d3a16bf0251ba9f5f194c1 (patch)
tree6d25ff212475775445f8e930b9128c8ec8147ad1 /engines/sci/sound
parentaadf2e976555d08b7f8e773cc4d69882fa1c9d3d (diff)
downloadscummvm-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/sound')
-rw-r--r--engines/sci/sound/soundcmd.cpp38
1 files changed, 19 insertions, 19 deletions
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)