[Scummvm-cvs-logs] scummvm master -> fc6ab89b504e15ea14208301acd727893d113381

clone2727 clone2727 at gmail.com
Thu Sep 20 17:50:38 CEST 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
fc6ab89b50 SCUMM: Add support for Indy4 Mac 68k sound


Commit: fc6ab89b504e15ea14208301acd727893d113381
    https://github.com/scummvm/scummvm/commit/fc6ab89b504e15ea14208301acd727893d113381
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-09-20T08:48:00-07:00

Commit Message:
SCUMM: Add support for Indy4 Mac 68k sound

Changed paths:
    engines/scumm/detection.cpp
    engines/scumm/imuse/imuse_part.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/sound.cpp



diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 5404c7f..156d1fb 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -242,6 +242,10 @@ static Common::String generateFilenameForDetection(const char *pattern, Filename
 	return result;
 }
 
+bool ScummEngine::isMacM68kV5() const {
+	return _game.platform == Common::kPlatformMacintosh && _game.version == 5 && !(_game.features & GF_MAC_CONTAINER);
+}
+
 struct DetectorDesc {
 	Common::FSNode node;
 	Common::String md5;
@@ -473,6 +477,11 @@ static void computeGameSettingsFromMD5(const Common::FSList &fslist, const GameF
 				if (dr.language == UNK_LANG) {
 					dr.language = detectLanguage(fslist, dr.game.id);
 				}
+
+				// HACK: Detect between 68k and PPC versions
+				if (dr.game.platform == Common::kPlatformMacintosh && dr.game.version >= 5 && dr.game.heversion == 0 && strstr(gfp->pattern, "Data"))
+					dr.game.features |= GF_MAC_CONTAINER;
+
 				break;
 			}
 		}
diff --git a/engines/scumm/imuse/imuse_part.cpp b/engines/scumm/imuse/imuse_part.cpp
index d4e4740..bb319df 100644
--- a/engines/scumm/imuse/imuse_part.cpp
+++ b/engines/scumm/imuse/imuse_part.cpp
@@ -372,7 +372,7 @@ void Part::set_instrument(uint b) {
 	// We emulate this by introducing a special instrument, which sets
 	// the instrument via sysEx_customInstrument. This seems to be
 	// exclusively used for special sound effects like the "spit" sound.
-	if (g_scumm->_game.id == GID_MONKEY2 && g_scumm->_game.platform == Common::kPlatformMacintosh) {
+	if (g_scumm->isMacM68kV5()) {
 		_instrument.macSfx(b);
 	} else {
 		_instrument.program((byte)b, _player->isMT32());
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 7b37517..2150bbc 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);
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index c8cf096..555b708 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -150,7 +150,13 @@ enum GameFeatures {
 	GF_HE_985             = 1 << 14,
 
 	/** HE games with 16 bit color */
-	GF_16BIT_COLOR         = 1 << 15
+	GF_16BIT_COLOR         = 1 << 15,
+
+	/**
+	 * SCUMM v5-v7 Mac games stored in a container file
+	 * Used to differentiate between m68k and PPC versions of Indy4
+	 */
+	GF_MAC_CONTAINER       = 1 << 16
 };
 
 /* SCUMM Debug Channels */
@@ -713,6 +719,9 @@ public:
 
 	bool openFile(BaseScummFile &file, const Common::String &filename, bool resourceFile = false);
 
+	/** Is this game a Mac m68k v5 game? */
+	bool isMacM68kV5() const;
+
 protected:
 	int _resourceHeaderSize;
 	byte _resourceMapper[128];
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 15701f1..3215242 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -250,7 +250,7 @@ void Sound::playSound(int soundID) {
 	// Support for sampled sound effects in Monkey Island 1 and 2
 	else if (_vm->_game.platform != Common::kPlatformFMTowns
 	         // The Macintosh version of MI2 just ignores SBL effects.
-	         && (_vm->_game.platform != Common::kPlatformMacintosh && _vm->_game.id != GID_MONKEY2)
+	         && !_vm->isMacM68kV5()
 	         && READ_BE_UINT32(ptr) == MKTAG('S','B','L',' ')) {
 		debugC(DEBUG_SOUND, "Using SBL sound effect");
 






More information about the Scummvm-git-logs mailing list