[Scummvm-cvs-logs] SF.net SVN: scummvm:[54642] scummvm/trunk/engines/mohawk

bgk at users.sourceforge.net bgk at users.sourceforge.net
Mon Nov 29 22:02:11 CET 2010


Revision: 54642
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54642&view=rev
Author:   bgk
Date:     2010-11-29 21:02:11 +0000 (Mon, 29 Nov 2010)

Log Message:
-----------
MOHAWK: Add Selenitic opcode 101, maze runner sound help.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp
    scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h

Modified: scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp	2010-11-29 21:01:57 UTC (rev 54641)
+++ scummvm/trunk/engines/mohawk/myst_scripts_selenitic.cpp	2010-11-29 21:02:11 UTC (rev 54642)
@@ -105,7 +105,7 @@
 
 		// "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 @@
 	if (videoToNext) {
 		_maze_runner_compass->drawConditionalDataToScreen(8);
 		mazeRunnerUpdateCompass();
+
+		if (move == 0 || move == 3)
+			mazeRunnerPlaySoundHelp();
 	}
 }
 
@@ -379,21 +382,74 @@
 	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;
 
-	if (argc == 0) {
-		// Used on Card 1191 (Maze Runner)
-		// Called when Red Warning Button is pushed
+	_maze_runner_light->drawConditionalDataToScreen(1);
 
-		debugC(kDebugScript, "Opcode %d: Repeat Buzzer Sound?", op);
+	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;
 
-		// TODO: Fill in logic...
-		// Repeat buzzer sound
-	} else
-		unknown(op, var, argc, argv);
+	if (soundId)
+		_vm->_sound->playSound(soundId);
+
+	_maze_runner_light->drawConditionalDataToScreen(0);
 }
 
+void MystScriptParser_Selenitic::o_101_mazeRunnerSoundRepeat(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+	mazeRunnerPlaySoundHelp();
+}
+
 /**
  * Sound receiver sigma button
  */

Modified: scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h	2010-11-29 21:01:57 UTC (rev 54641)
+++ scummvm/trunk/engines/mohawk/myst_scripts_selenitic.h	2010-11-29 21:02:11 UTC (rev 54642)
@@ -53,7 +53,7 @@
 	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 @@
 
 	bool mazeRunnerForwardAllowed(uint16 position);
 	void mazeRunnerUpdateCompass();
+	void mazeRunnerPlaySoundHelp();
 };
 
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list