From 0348ca3e65292784126920eae38c9376aa113f8a Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Sun, 22 Aug 2010 20:37:48 +0000 Subject: SCUMM: fix CD audio regression in Monkey Island 1 DOS/CD svn-id: r52287 --- engines/scumm/sound.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'engines/scumm/sound.cpp') diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index f12625c9e3..708faa5687 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -314,6 +314,30 @@ void Sound::playSound(int soundID) { stream = Audio::makeRawStream(sound, size, rate, Audio::FLAG_UNSIGNED); _mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID); } + else if (_vm->_game.platform != Common::kPlatformFMTowns && READ_BE_UINT32(ptr) == MKID_BE('SOUN')) { + if (_vm->_game.version != 3) + ptr += 2; + + int type = *(ptr + 0x0D); + + if (type == 2) { + // CD track resource + ptr += 0x16; + if (soundID == _currentCDSound && pollCD() == 1) + return; + + int track = ptr[0]; + int loops = ptr[1]; + int start = (ptr[2] * 60 + ptr[3]) * 75 + ptr[4]; + int end = (ptr[5] * 60 + ptr[6]) * 75 + ptr[7]; + + playCDTrack(track, loops == 0xff ? -1 : loops, start, end <= start ? 0 : end - start); + _currentCDSound = soundID; + } else { + // All other sound types are ignored + warning("Scumm::Sound::playSound: encountered audio resoure with chunk type 'SOUN' and sound type %d", type); + } + } else if ((_vm->_game.id == GID_LOOM) && (_vm->_game.platform == Common::kPlatformMacintosh)) { // Mac version of Loom uses yet another sound format /* -- cgit v1.2.3