aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2010-11-29 21:02:11 +0000
committerBastien Bouclet2010-11-29 21:02:11 +0000
commita526bdb839ec09523715846904ff6a194578e1e3 (patch)
tree3611093cad33036d67d933a90ef6e389f96b8187
parent1b50b62157297040ec067f0f251c8e380cc3b4c0 (diff)
downloadscummvm-rg350-a526bdb839ec09523715846904ff6a194578e1e3.tar.gz
scummvm-rg350-a526bdb839ec09523715846904ff6a194578e1e3.tar.bz2
scummvm-rg350-a526bdb839ec09523715846904ff6a194578e1e3.zip
MOHAWK: Add Selenitic opcode 101, maze runner sound help.
svn-id: r54642
-rw-r--r--engines/mohawk/myst_scripts_selenitic.cpp78
-rw-r--r--engines/mohawk/myst_scripts_selenitic.h3
2 files changed, 69 insertions, 12 deletions
diff --git a/engines/mohawk/myst_scripts_selenitic.cpp b/engines/mohawk/myst_scripts_selenitic.cpp
index 368bc7f14d..85a170c08f 100644
--- a/engines/mohawk/myst_scripts_selenitic.cpp
+++ b/engines/mohawk/myst_scripts_selenitic.cpp
@@ -105,7 +105,7 @@ void MystScriptParser_Selenitic::setupOpcodes() {
// "Stack-Specific" Opcodes
SPECIFIC_OPCODE(100, o_100_mazeRunnerMove),
- SPECIFIC_OPCODE(101, opcode_101),
+ SPECIFIC_OPCODE(101, o_101_mazeRunnerSoundRepeat),
SPECIFIC_OPCODE(102, o_102_soundReceiverSigma),
SPECIFIC_OPCODE(103, o_103_soundReceiverRight),
SPECIFIC_OPCODE(104, o_104_soundReceiverLeft),
@@ -362,6 +362,9 @@ void MystScriptParser_Selenitic::o_100_mazeRunnerMove(uint16 op, uint16 var, uin
if (videoToNext) {
_maze_runner_compass->drawConditionalDataToScreen(8);
mazeRunnerUpdateCompass();
+
+ if (move == 0 || move == 3)
+ mazeRunnerPlaySoundHelp();
}
}
@@ -379,19 +382,72 @@ bool MystScriptParser_Selenitic::mazeRunnerForwardAllowed(uint16 position) {
return move == 6 || move == 7;
}
-void MystScriptParser_Selenitic::opcode_101(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- varUnusedCheck(op, var);
+void MystScriptParser_Selenitic::mazeRunnerPlaySoundHelp() {
+ uint16 soundId = 0;
+
+ _maze_runner_light->drawConditionalDataToScreen(1);
+
+ if (_maze_runner_position >= 272)
+ soundId = 0;
+ else if (_maze_runner_position >= 264)
+ soundId = 8191;
+ else if (_maze_runner_position >= 256)
+ soundId = 0;
+ else if (_maze_runner_position >= 248)
+ soundId = 5191;
+ else if (_maze_runner_position >= 232)
+ soundId = 0;
+ else if (_maze_runner_position >= 224)
+ soundId = 5191;
+ else if (_maze_runner_position >= 216)
+ soundId = 0;
+ else if (_maze_runner_position >= 208)
+ soundId = 5191;
+ else if (_maze_runner_position >= 176)
+ soundId = 0;
+ else if (_maze_runner_position >= 168)
+ soundId = 7191;
+ else if (_maze_runner_position >= 152)
+ soundId = 0;
+ else if (_maze_runner_position >= 144)
+ soundId = 7191;
+ else if (_maze_runner_position >= 136)
+ soundId = 2191;
+ else if (_maze_runner_position >= 112)
+ soundId = 0;
+ else if (_maze_runner_position >= 104)
+ soundId = 6191;
+ else if (_maze_runner_position >= 96)
+ soundId = 2191;
+ else if (_maze_runner_position >= 88)
+ soundId = 3191;
+ else if (_maze_runner_position >= 80)
+ soundId = 4191;
+ else if (_maze_runner_position >= 72)
+ soundId = 8191;
+ else if (_maze_runner_position >= 64)
+ soundId = 7191;
+ else if (_maze_runner_position >= 56)
+ soundId = 8191;
+ else if (_maze_runner_position >= 40)
+ soundId = 5191;
+ else if (_maze_runner_position >= 24)
+ soundId = 1191;
+ else if (_maze_runner_position >= 16)
+ soundId = 2191;
+ else if (_maze_runner_position >= 8)
+ soundId = 8191;
+ else
+ soundId = 2191;
- if (argc == 0) {
- // Used on Card 1191 (Maze Runner)
- // Called when Red Warning Button is pushed
+ if (soundId)
+ _vm->_sound->playSound(soundId);
- debugC(kDebugScript, "Opcode %d: Repeat Buzzer Sound?", op);
+ _maze_runner_light->drawConditionalDataToScreen(0);
+}
- // TODO: Fill in logic...
- // Repeat buzzer sound
- } else
- unknown(op, var, argc, argv);
+void MystScriptParser_Selenitic::o_101_mazeRunnerSoundRepeat(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ mazeRunnerPlaySoundHelp();
}
/**
diff --git a/engines/mohawk/myst_scripts_selenitic.h b/engines/mohawk/myst_scripts_selenitic.h
index 3b7645ce6c..d9676f05e9 100644
--- a/engines/mohawk/myst_scripts_selenitic.h
+++ b/engines/mohawk/myst_scripts_selenitic.h
@@ -53,7 +53,7 @@ private:
bool setVarValue(uint16 var, uint16 value);
DECLARE_OPCODE(o_100_mazeRunnerMove);
- DECLARE_OPCODE(opcode_101);
+ DECLARE_OPCODE(o_101_mazeRunnerSoundRepeat);
DECLARE_OPCODE(o_102_soundReceiverSigma);
DECLARE_OPCODE(o_103_soundReceiverRight);
DECLARE_OPCODE(o_104_soundReceiverLeft);
@@ -128,6 +128,7 @@ private:
bool mazeRunnerForwardAllowed(uint16 position);
void mazeRunnerUpdateCompass();
+ void mazeRunnerPlaySoundHelp();
};
}