Skip to content

Commit

Permalink
SCUMM: Add support for Indy4 Mac 68k sound
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Hoops committed Sep 20, 2012
1 parent 4522d18 commit fc6ab89
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
9 changes: 9 additions & 0 deletions engines/scumm/detection.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion engines/scumm/imuse/imuse_part.cpp
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion engines/scumm/scumm.cpp
Expand Up @@ -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);
Expand Down
11 changes: 10 additions & 1 deletion engines/scumm/scumm.h
Expand Up @@ -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 */
Expand Down Expand Up @@ -713,6 +719,9 @@ class ScummEngine : public Engine {

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];
Expand Down
2 changes: 1 addition & 1 deletion engines/scumm/sound.cpp
Expand Up @@ -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");

Expand Down

0 comments on commit fc6ab89

Please sign in to comment.