SCUMM: Fix bug #3070077 - MMC64: No music when Syd plays the piano.

svn-id: r52796
This commit is contained in:
Travis Howell 2010-09-18 14:18:48 +00:00
parent 5b18bb1aa1
commit ae3b6f0aa3
6 changed files with 26 additions and 7 deletions

View file

@ -698,6 +698,10 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr)
_activeObject2Inv = false; _activeObject2Inv = false;
_activeObjectObtained = false; _activeObjectObtained = false;
_activeObject2Obtained = false; _activeObject2Obtained = false;
VAR_ACTIVE_ACTOR = 0xFF;
VAR_IS_SOUND_RUNNING = 0xFF;
VAR_ACTIVE_VERB = 0xFF;
} }
ScummEngine_v6::ScummEngine_v6(OSystem *syst, const DetectorResult &dr) ScummEngine_v6::ScummEngine_v6(OSystem *syst, const DetectorResult &dr)
@ -1931,6 +1935,12 @@ void ScummEngine::waitForTimer(int msec_delay) {
} }
} }
void ScummEngine_v0::scummLoop(int delta) {
VAR(VAR_IS_SOUND_RUNNING) = (_sound->_lastSound && _sound->isSoundRunning(_sound->_lastSound) != 0);
ScummEngine::scummLoop(delta);
}
void ScummEngine::scummLoop(int delta) { void ScummEngine::scummLoop(int delta) {
if (_game.version >= 3) { if (_game.version >= 3) {
VAR(VAR_TMR_1) += delta; VAR(VAR_TMR_1) += delta;

View file

@ -62,6 +62,7 @@ protected:
virtual void setupScummVars(); virtual void setupScummVars();
virtual void resetScummVars(); virtual void resetScummVars();
virtual void scummLoop(int delta);
virtual void decodeParseString(); virtual void decodeParseString();
virtual void processInput(); virtual void processInput();
@ -136,6 +137,10 @@ protected:
void o_endCutscene(); void o_endCutscene();
void o_beginOverride(); void o_beginOverride();
void o_setOwnerOf(); void o_setOwnerOf();
byte VAR_ACTIVE_ACTOR;
byte VAR_IS_SOUND_RUNNING;
byte VAR_ACTIVE_VERB;
}; };

View file

@ -78,6 +78,7 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer)
_curSoundPos(0), _curSoundPos(0),
_currentCDSound(0), _currentCDSound(0),
_currentMusic(0), _currentMusic(0),
_lastSound(0),
_soundsPaused(false), _soundsPaused(false),
_sfxMode(0) { _sfxMode(0) {
@ -95,6 +96,7 @@ Sound::~Sound() {
void Sound::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlags) { void Sound::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlags) {
if (_vm->VAR_LAST_SOUND != 0xFF) if (_vm->VAR_LAST_SOUND != 0xFF)
_vm->VAR(_vm->VAR_LAST_SOUND) = sound; _vm->VAR(_vm->VAR_LAST_SOUND) = sound;
_lastSound = sound;
// HE music resources are in separate file // HE music resources are in separate file
if (sound <= _vm->_numSounds) if (sound <= _vm->_numSounds)
@ -789,6 +791,7 @@ void Sound::stopAllSounds() {
} }
// Clear the (secondary) sound queue // Clear the (secondary) sound queue
_lastSound = 0;
_soundQue2Pos = 0; _soundQue2Pos = 0;
memset(_soundQue2, 0, sizeof(_soundQue2)); memset(_soundQue2, 0, sizeof(_soundQue2));

View file

@ -91,6 +91,7 @@ public:
bool _soundsPaused; bool _soundsPaused;
byte _sfxMode; byte _sfxMode;
uint _lastSound;
public: public:
Sound(ScummEngine *parent, Audio::Mixer *mixer); Sound(ScummEngine *parent, Audio::Mixer *mixer);

View file

@ -116,10 +116,10 @@ void ScummEngine_v0::setupScummVars() {
VAR_CAMERA_POS_X = 2; VAR_CAMERA_POS_X = 2;
VAR_HAVE_MSG = 3; VAR_HAVE_MSG = 3;
VAR_ROOM = 4; VAR_ROOM = 4;
//VAR_ACTIVE_ACTOR = 5; VAR_ACTIVE_ACTOR = 5;
VAR_OVERRIDE = 6; VAR_OVERRIDE = 6;
//VAR_IS_SOUND_RUNNING = 8; VAR_IS_SOUND_RUNNING = 8;
//VAR_ACTIVE_VERB = 9; VAR_ACTIVE_VERB = 9;
VAR_CHARCOUNT = 10; VAR_CHARCOUNT = 10;
} }

View file

@ -745,13 +745,13 @@ void ScummEngine_v0::runObject(int obj, int entry) {
runObjectScript(obj, entry, false, false, NULL); runObjectScript(obj, entry, false, false, NULL);
} else if (entry != 13 && entry != 15) { } else if (entry != 13 && entry != 15) {
if (_activeVerb != 3) { if (_activeVerb != 3) {
VAR(9) = entry; VAR(VAR_ACTIVE_VERB) = entry;
runScript(3, 0, 0, 0); runScript(3, 0, 0, 0);
// For some reasons, certain objects don't have a "give" script // For some reasons, certain objects don't have a "give" script
} else if (VAR(5) > 0 && VAR(5) < 8) { } else if (VAR(VAR_ACTIVE_ACTOR) > 0 && VAR(VAR_ACTIVE_ACTOR) < 8) {
if (_activeInventory) if (_activeInventory)
setOwnerOf(_activeInventory, VAR(5)); setOwnerOf(_activeInventory, VAR(VAR_ACTIVE_ACTOR));
} }
} }
} }
@ -955,7 +955,7 @@ bool ScummEngine_v0::verbExec() {
return true; return true;
} }
_v0ObjectInInventory = true; _v0ObjectInInventory = true;
VAR(5) = _activeActor; VAR(VAR_ACTIVE_ACTOR) = _activeActor;
runObject(_activeInventory , 3); runObject(_activeInventory , 3);
_v0ObjectInInventory = false; _v0ObjectInInventory = false;