[Scummvm-cvs-logs] CVS: scummvm/scumm input.cpp,2.2,2.3 script.cpp,1.201,1.202 scumm.cpp,1.259,1.260 scumm.h,1.510,1.511 vars.cpp,1.111,1.112

Travis Howell kirben at users.sourceforge.net
Sun Oct 17 23:41:04 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14634/scumm

Modified Files:
	input.cpp script.cpp scumm.cpp scumm.h vars.cpp 
Log Message:

Add keyboard control for HE80+ games.



Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/input.cpp,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -d -r2.2 -r2.3
--- input.cpp	28 Sep 2004 20:19:28 -0000	2.2
+++ input.cpp	18 Oct 2004 06:40:33 -0000	2.3
@@ -97,6 +97,31 @@
 				_keyPressed = event.kbd.ascii;	// Normal key press, pass on to the game.
 			}
 
+			if (_heversion >= 80) {
+				// Keyboard is controlled via variable
+				int _keyState = 0;
+
+				if (event.kbd.ascii == 276) // Left
+					_keyState = 1;
+
+				if (event.kbd.ascii == 275) // Right
+					_keyState |= 2;
+
+				if (event.kbd.ascii == 273) // Up
+					_keyState |= 4;
+
+				if (event.kbd.ascii == 274) // Down
+					_keyState |= 8;
+
+				if (event.kbd.flags == OSystem::KBD_SHIFT)
+					_keyState |= 16;
+
+				if (event.kbd.flags == OSystem::KBD_CTRL)
+					_keyState |= 32;
+
+				VAR(VAR_KEY_STATE) = _keyState;
+			}
+
 			if (_keyPressed >= 512)
 				debugC(DEBUG_GENERAL, "_keyPressed > 512 (%d)", _keyPressed);
 			else

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- script.cpp	16 Oct 2004 05:10:14 -0000	1.201
+++ script.cpp	18 Oct 2004 06:40:34 -0000	1.202
@@ -548,7 +548,7 @@
 			var &= 0xFFF;
 		}
 
-		if (_heversion >= 72)
+		if (_heversion >= 80)
 			checkRange(25, 0, var, "Local variable %d out of range(r)");
 		else
 			checkRange(20, 0, var, "Local variable %d out of range(r)");
@@ -627,7 +627,7 @@
 			var &= 0xFFF;
 		}
 
-		if (_heversion >= 72)
+		if (_heversion >= 80)
 			checkRange(25, 0, var, "Local variable %d out of range(w)");
 		else
 			checkRange(20, 0, var, "Local variable %d out of range(w)");

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.259
retrieving revision 1.260
diff -u -d -r1.259 -r1.260
--- scumm.cpp	16 Oct 2004 20:38:37 -0000	1.259
+++ scumm.cpp	18 Oct 2004 06:40:35 -0000	1.260
@@ -850,6 +850,7 @@
 	VAR_NUM_UNK = 0xFF;
 	VAR_POLYGONS_ONLY = 0xFF;
 	VAR_WINDOWS_VERSION = 0xFF;
+	VAR_KEY_STATE = 0xFF;
 	VAR_WIZ_TCOLOR = 0xFF;
 
 	// Use g_scumm from error() ONLY
@@ -1089,7 +1090,7 @@
 	if (VAR_DEBUGMODE != 0xFF) {
 		// This is NOT for the Mac version of Indy3/Loom
 		VAR(VAR_DEBUGMODE) = _debugMode;
-		if (_heversion >= 80)
+		if (_heversion >= 80 && _debugMode)
 			VAR(85) = 1;
 	}
 

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.510
retrieving revision 1.511
diff -u -d -r1.510 -r1.511
--- scumm.h	12 Oct 2004 14:40:32 -0000	1.510
+++ scumm.h	18 Oct 2004 06:40:35 -0000	1.511
@@ -1335,6 +1335,7 @@
 	byte VAR_NUM_UNK;
 	byte VAR_POLYGONS_ONLY;
 	byte VAR_WINDOWS_VERSION;
+	byte VAR_KEY_STATE;
 	byte VAR_WIZ_TCOLOR;
 };
 

Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/vars.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- vars.cpp	17 Oct 2004 04:35:36 -0000	1.111
+++ vars.cpp	18 Oct 2004 06:40:36 -0000	1.112
@@ -263,6 +263,7 @@
 
 	if (_heversion >= 80)
 		VAR_WINDOWS_VERSION = 79;
+		VAR_KEY_STATE = 86;
 	if (_heversion >= 90) {
 		VAR_NUM_SPRITES = 106;
 		VAR_WIZ_TCOLOR = 117;
@@ -491,7 +492,7 @@
 		VAR(VAR_V6_EMSSPACE) = 10000;
 		VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
 	} else if (_heversion >= 70) {
-		VAR(VAR_NUM_SOUND_CHANNELS) = 3;
+		VAR(VAR_NUM_SOUND_CHANNELS) = 8;
 		VAR(VAR_MUSIC_CHANNEL) = 1;
 		VAR(VAR_SOUND_CHANNEL) = 2;
 





More information about the Scummvm-git-logs mailing list