[Scummvm-cvs-logs] SF.net SVN: scummvm:[41915] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Sat Jun 27 14:26:26 CEST 2009


Revision: 41915
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41915&view=rev
Author:   buddha_
Date:     2009-06-27 12:26:26 +0000 (Sat, 27 Jun 2009)

Log Message:
-----------
Name Operation Stealth's global variables 251 and 252 and init them in main loop.

These are used as a sort of a backup for the
mouse position (x, y) variables 249 and 250.

Future Wars's VAR_MOUSE_Y_MODE and Operation Stealth's
VAR_MOUSE_X_POS_2ND (251) clash and that's possibly
why executePlayerInput currently works incorrectly
with Operation Stealth. More reverse engineering
is needed...

Modified Paths:
--------------
    scummvm/trunk/engines/cine/cine.h
    scummvm/trunk/engines/cine/main_loop.cpp
    scummvm/trunk/engines/cine/various.cpp

Modified: scummvm/trunk/engines/cine/cine.h
===================================================================
--- scummvm/trunk/engines/cine/cine.h	2009-06-27 11:49:12 UTC (rev 41914)
+++ scummvm/trunk/engines/cine/cine.h	2009-06-27 12:26:26 UTC (rev 41915)
@@ -127,11 +127,15 @@
 #define COPY_PROT_FAIL_PRC_NAME "L201.ANI"
 
 enum {
+	// Both FW and OS
+	VAR_MOUSE_X_POS = 249,
+	VAR_MOUSE_Y_POS = 250,
+	// FW only
 	VAR_MOUSE_X_MODE = 253,
-	VAR_MOUSE_X_POS = 249,
 	VAR_MOUSE_Y_MODE = 251,
-	VAR_MOUSE_Y_POS = 250,
 	// OS only
+	VAR_MOUSE_X_POS_2ND = 251, // Many times used in conjunction with VAR_MOUSE_X_POS
+	VAR_MOUSE_Y_POS_2ND = 252, // Many times used in conjunction with VAR_MOUSE_Y_POS
 	VAR_BYPASS_PROTECTION = 255,
 	VAR_LOW_MEMORY = 0
 };

Modified: scummvm/trunk/engines/cine/main_loop.cpp
===================================================================
--- scummvm/trunk/engines/cine/main_loop.cpp	2009-06-27 11:49:12 UTC (rev 41914)
+++ scummvm/trunk/engines/cine/main_loop.cpp	2009-06-27 12:26:26 UTC (rev 41915)
@@ -288,6 +288,8 @@
 		globalVars[VAR_MOUSE_X_POS] = 0;
 		globalVars[VAR_MOUSE_Y_POS] = 0;
 		if (g_cine->getGameType() == Cine::GType_OS) {
+			globalVars[VAR_MOUSE_X_POS_2ND] = 0;
+			globalVars[VAR_MOUSE_Y_POS_2ND] = 0;
 			globalVars[VAR_BYPASS_PROTECTION] = 0; // set to 1 to bypass the copy protection
 			globalVars[VAR_LOW_MEMORY] = 0; // set to 1 to disable some animations, sounds etc.
 		}

Modified: scummvm/trunk/engines/cine/various.cpp
===================================================================
--- scummvm/trunk/engines/cine/various.cpp	2009-06-27 11:49:12 UTC (rev 41914)
+++ scummvm/trunk/engines/cine/various.cpp	2009-06-27 12:26:26 UTC (rev 41915)
@@ -1095,8 +1095,8 @@
 	// This fixes swimming at the bottom of the ocean after
 	// having been thrown into it with the girl.
 	if (g_cine->getGameType() == Cine::GType_OS) {
-		globalVars[251] = globalVars[VAR_MOUSE_X_POS];
-		globalVars[252] = globalVars[VAR_MOUSE_Y_POS];
+		globalVars[VAR_MOUSE_X_POS_2ND] = globalVars[VAR_MOUSE_X_POS];
+		globalVars[VAR_MOUSE_Y_POS_2ND] = globalVars[VAR_MOUSE_Y_POS];
 	}
 
 	return var_5E;
@@ -1501,10 +1501,7 @@
 				if (xMoveKeyb != kKeybMoveRight) {
 					adder = -adder;
 				}
-				// FIXME: In Operation Stealth's disassembly global variable 251 is used here
-				//        but it's named as VAR_MOUSE_Y_MODE in ScummVM. Is it correct or a
-				//        left over from Future Wars's reverse engineering?
-				globalVars[VAR_MOUSE_X_POS] = globalVars[251] = ptr1[4] + x + adder;
+				globalVars[VAR_MOUSE_X_POS] = globalVars[VAR_MOUSE_X_POS_2ND] = ptr1[4] + x + adder;
 			}
 
 			if (yMoveKeyb && allowPlayerInput) {
@@ -1512,8 +1509,7 @@
 				if (yMoveKeyb != kKeybMoveDown) {
 					adder = -adder;
 				}
-				// TODO: Name currently unnamed global variable 252
-				globalVars[VAR_MOUSE_Y_POS] = globalVars[252] = ptr1[5] + y + adder;
+				globalVars[VAR_MOUSE_Y_POS] = globalVars[VAR_MOUSE_Y_POS_2ND] = ptr1[5] + y + adder;
 			}
 
 			if (globalVars[VAR_MOUSE_X_POS] || globalVars[VAR_MOUSE_Y_POS]) {


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