aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTravis Howell2010-09-18 14:18:48 +0000
committerTravis Howell2010-09-18 14:18:48 +0000
commitae3b6f0aa391a2352d0e2042a05366c5d80668b7 (patch)
tree39bfc76dbbcbfbe2eb03537973141a4ffc713e71 /engines/scumm
parent5b18bb1aa13e7da895b58a4e413797587365cf96 (diff)
downloadscummvm-rg350-ae3b6f0aa391a2352d0e2042a05366c5d80668b7.tar.gz
scummvm-rg350-ae3b6f0aa391a2352d0e2042a05366c5d80668b7.tar.bz2
scummvm-rg350-ae3b6f0aa391a2352d0e2042a05366c5d80668b7.zip
SCUMM: Fix bug #3070077 - MMC64: No music when Syd plays the piano.
svn-id: r52796
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/scumm.cpp10
-rw-r--r--engines/scumm/scumm_v0.h5
-rw-r--r--engines/scumm/sound.cpp3
-rw-r--r--engines/scumm/sound.h1
-rw-r--r--engines/scumm/vars.cpp6
-rw-r--r--engines/scumm/verbs.cpp8
6 files changed, 26 insertions, 7 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index e5a5da4402..6a841b7a2d 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -698,6 +698,10 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr)
_activeObject2Inv = false;
_activeObjectObtained = 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)
@@ -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) {
if (_game.version >= 3) {
VAR(VAR_TMR_1) += delta;
diff --git a/engines/scumm/scumm_v0.h b/engines/scumm/scumm_v0.h
index 5ef416f650..7b913f7750 100644
--- a/engines/scumm/scumm_v0.h
+++ b/engines/scumm/scumm_v0.h
@@ -62,6 +62,7 @@ protected:
virtual void setupScummVars();
virtual void resetScummVars();
+ virtual void scummLoop(int delta);
virtual void decodeParseString();
virtual void processInput();
@@ -136,6 +137,10 @@ protected:
void o_endCutscene();
void o_beginOverride();
void o_setOwnerOf();
+
+ byte VAR_ACTIVE_ACTOR;
+ byte VAR_IS_SOUND_RUNNING;
+ byte VAR_ACTIVE_VERB;
};
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 708faa5687..eb157c3111 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -78,6 +78,7 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer)
_curSoundPos(0),
_currentCDSound(0),
_currentMusic(0),
+ _lastSound(0),
_soundsPaused(false),
_sfxMode(0) {
@@ -95,6 +96,7 @@ Sound::~Sound() {
void Sound::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlags) {
if (_vm->VAR_LAST_SOUND != 0xFF)
_vm->VAR(_vm->VAR_LAST_SOUND) = sound;
+ _lastSound = sound;
// HE music resources are in separate file
if (sound <= _vm->_numSounds)
@@ -789,6 +791,7 @@ void Sound::stopAllSounds() {
}
// Clear the (secondary) sound queue
+ _lastSound = 0;
_soundQue2Pos = 0;
memset(_soundQue2, 0, sizeof(_soundQue2));
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index 401b1638cc..4fe46f32f0 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -91,6 +91,7 @@ public:
bool _soundsPaused;
byte _sfxMode;
+ uint _lastSound;
public:
Sound(ScummEngine *parent, Audio::Mixer *mixer);
diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp
index d1d3ed63a4..5e6e96e413 100644
--- a/engines/scumm/vars.cpp
+++ b/engines/scumm/vars.cpp
@@ -116,10 +116,10 @@ void ScummEngine_v0::setupScummVars() {
VAR_CAMERA_POS_X = 2;
VAR_HAVE_MSG = 3;
VAR_ROOM = 4;
- //VAR_ACTIVE_ACTOR = 5;
+ VAR_ACTIVE_ACTOR = 5;
VAR_OVERRIDE = 6;
- //VAR_IS_SOUND_RUNNING = 8;
- //VAR_ACTIVE_VERB = 9;
+ VAR_IS_SOUND_RUNNING = 8;
+ VAR_ACTIVE_VERB = 9;
VAR_CHARCOUNT = 10;
}
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index 5f8a6d9f52..3d16dc566c 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -745,13 +745,13 @@ void ScummEngine_v0::runObject(int obj, int entry) {
runObjectScript(obj, entry, false, false, NULL);
} else if (entry != 13 && entry != 15) {
if (_activeVerb != 3) {
- VAR(9) = entry;
+ VAR(VAR_ACTIVE_VERB) = entry;
runScript(3, 0, 0, 0);
// 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)
- setOwnerOf(_activeInventory, VAR(5));
+ setOwnerOf(_activeInventory, VAR(VAR_ACTIVE_ACTOR));
}
}
}
@@ -955,7 +955,7 @@ bool ScummEngine_v0::verbExec() {
return true;
}
_v0ObjectInInventory = true;
- VAR(5) = _activeActor;
+ VAR(VAR_ACTIVE_ACTOR) = _activeActor;
runObject(_activeInventory , 3);
_v0ObjectInInventory = false;