From 58f542d4342a3dc92e0bb6f7847493d32d1594ea Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 20 Sep 2012 01:32:49 +0200 Subject: SCUMM: Implement support for Monkey Island 2 Mac music. This is a initial RE of the audio output Monkey Island 2 Mac uses. Support for special sound effects is not in there yet. --- engines/scumm/scumm.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index d0f46f3e56..02c2584d46 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -73,6 +73,7 @@ #include "scumm/util.h" #include "scumm/verbs.h" #include "scumm/imuse/pcspk.h" +#include "scumm/imuse/mac_m68k.h" #include "backends/audiocd/audiocd.h" @@ -1841,7 +1842,11 @@ void ScummEngine::setupMusic(int midi) { if (nativeMidiDriver != NULL && _native_mt32) nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); bool multi_midi = ConfMan.getBool("multi_midi") && _sound->_musicType != MDT_NONE && _sound->_musicType != MDT_PCSPK && (midi & MDT_ADLIB); - if (_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS || multi_midi) { + if (_game.platform == Common::kPlatformMacintosh && _game.id == GID_MONKEY2) { + adlibMidiDriver = new MacM68kDriver(_mixer); + // The Mac driver is never MT-32. + _native_mt32 = false; + } else if (_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS || multi_midi) { adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_sound->_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB)); adlibMidiDriver->property(MidiDriver::PROP_OLD_ADLIB, (_game.features & GF_SMALL_HEADER) ? 1 : 0); } else if (_sound->_musicType == MDT_PCSPK) { -- cgit v1.2.3 From c3f37fb1870fb946692b6d67e6d32d2958be2b3a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 20 Sep 2012 03:48:48 +0200 Subject: SCUMM: Always use the Mac sound output for MI2 Mac. Formerly it wasn't used when the user selected a MIDI output in the options. Thanks to clone2727 for noticing. --- engines/scumm/scumm.cpp | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 02c2584d46..7b37517ac0 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1836,21 +1836,31 @@ void ScummEngine::setupMusic(int midi) { } else if (_game.version >= 3 && _game.heversion <= 62) { MidiDriver *nativeMidiDriver = 0; MidiDriver *adlibMidiDriver = 0; - - if (_sound->_musicType != MDT_ADLIB && _sound->_musicType != MDT_TOWNS && _sound->_musicType != MDT_PCSPK) - nativeMidiDriver = MidiDriver::createMidi(dev); - if (nativeMidiDriver != NULL && _native_mt32) - nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); bool multi_midi = ConfMan.getBool("multi_midi") && _sound->_musicType != MDT_NONE && _sound->_musicType != MDT_PCSPK && (midi & MDT_ADLIB); + bool useOnlyNative = false; + if (_game.platform == Common::kPlatformMacintosh && _game.id == GID_MONKEY2) { - adlibMidiDriver = new MacM68kDriver(_mixer); + // We setup this driver as native MIDI driver to avoid playback + // of the Mac music via a selected MIDI device. + nativeMidiDriver = new MacM68kDriver(_mixer); // The Mac driver is never MT-32. _native_mt32 = false; - } else if (_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS || multi_midi) { - adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_sound->_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB)); - adlibMidiDriver->property(MidiDriver::PROP_OLD_ADLIB, (_game.features & GF_SMALL_HEADER) ? 1 : 0); - } else if (_sound->_musicType == MDT_PCSPK) { - adlibMidiDriver = new PcSpkDriver(_mixer); + // Ignore non-native drivers. This also ignores the multi MIDI setting. + useOnlyNative = true; + } else if (_sound->_musicType != MDT_ADLIB && _sound->_musicType != MDT_TOWNS && _sound->_musicType != MDT_PCSPK) { + nativeMidiDriver = MidiDriver::createMidi(dev); + } + + if (nativeMidiDriver != NULL && _native_mt32) + nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); + + if (!useOnlyNative) { + if (_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS || multi_midi) { + adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_sound->_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB)); + adlibMidiDriver->property(MidiDriver::PROP_OLD_ADLIB, (_game.features & GF_SMALL_HEADER) ? 1 : 0); + } else if (_sound->_musicType == MDT_PCSPK) { + adlibMidiDriver = new PcSpkDriver(_mixer); + } } _imuse = IMuse::create(_system, nativeMidiDriver, adlibMidiDriver); -- cgit v1.2.3 From fc6ab89b504e15ea14208301acd727893d113381 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 20 Sep 2012 11:48:00 -0400 Subject: SCUMM: Add support for Indy4 Mac 68k sound --- engines/scumm/scumm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 7b37517ac0..2150bbc4f1 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1839,7 +1839,7 @@ void ScummEngine::setupMusic(int midi) { bool multi_midi = ConfMan.getBool("multi_midi") && _sound->_musicType != MDT_NONE && _sound->_musicType != MDT_PCSPK && (midi & MDT_ADLIB); bool useOnlyNative = false; - if (_game.platform == Common::kPlatformMacintosh && _game.id == GID_MONKEY2) { + if (isMacM68kV5()) { // We setup this driver as native MIDI driver to avoid playback // of the Mac music via a selected MIDI device. nativeMidiDriver = new MacM68kDriver(_mixer); -- cgit v1.2.3 From 2a9d98003e07890dc74694b62bd694d1fc8a19f3 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 20 Sep 2012 11:58:04 -0400 Subject: SCUMM: Restrict the Mac m68k v5 driver to MI2/Indy4 Shouldn't be used with MI1 --- engines/scumm/scumm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 2150bbc4f1..c9c9e991e4 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1839,7 +1839,7 @@ void ScummEngine::setupMusic(int midi) { bool multi_midi = ConfMan.getBool("multi_midi") && _sound->_musicType != MDT_NONE && _sound->_musicType != MDT_PCSPK && (midi & MDT_ADLIB); bool useOnlyNative = false; - if (isMacM68kV5()) { + if (isMacM68kIMuse()) { // We setup this driver as native MIDI driver to avoid playback // of the Mac music via a selected MIDI device. nativeMidiDriver = new MacM68kDriver(_mixer); -- cgit v1.2.3 From 89abab97e3124fa25eb4c7d3e8b38501747a8d17 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 26 Sep 2012 04:17:31 +0200 Subject: JANITORIAL: Remove trailing whitespaces. Powered by: git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//' --- engines/scumm/scumm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index c9c9e991e4..2c79fb8de0 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1986,11 +1986,11 @@ Common::Error ScummEngine::go() { if (delta < 1) // Ensure we don't get into an endless loop delta = 1; // by not decreasing sleepers. - // WORKAROUND: walking speed in the original v0/v1 interpreter + // WORKAROUND: walking speed in the original v0/v1 interpreter // is sometimes slower (e.g. during scrolling) than in ScummVM. // This is important for the door-closing action in the dungeon, - // otherwise (delta < 6) a single kid is able to escape. - if ((_game.version == 0 && isScriptRunning(132)) || + // otherwise (delta < 6) a single kid is able to escape. + if ((_game.version == 0 && isScriptRunning(132)) || (_game.version == 1 && isScriptRunning(137))) delta = 6; -- cgit v1.2.3