[Scummvm-cvs-logs] CVS: scummvm/bs2 interpreter.cpp,1.20,1.21

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Thu Oct 23 00:38:01 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv28625

Modified Files:
	interpreter.cpp 
Log Message:
Corrected/clarified some debug messages/comments


Index: interpreter.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/interpreter.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- interpreter.cpp	22 Oct 2003 06:51:57 -0000	1.20
+++ interpreter.cpp	23 Oct 2003 07:08:09 -0000	1.21
@@ -202,6 +202,10 @@
 // and back again with no ill effects. As far as I know, there is absolutely
 // no guarantee that this will work.
 //
+// Maybe we can represent them as offsets into the memory manager's memory?
+// Assuming, of course, that all the pointers we try to pass around this way
+// point to somewhere in that block.
+//
 // I also have a feeling the handling of a script's local variables may be
 // alignment-unsafe.
 
@@ -313,7 +317,7 @@
 			// Pop a value into a local word variable
 			Read16ip(parameter);
 			POPOFFSTACK(value);
-			debug(5, "Pop %d into var %d", value, parameter);
+			debug(5, "Pop %d into local var %d", value, parameter);
 			*((int32 *) (variables + parameter)) = value;
 			break;
 		case CP_CALL_MCODE:
@@ -444,18 +448,16 @@
 		case CP_ADDNPOP_GLOBAL_VAR32:
 			// Add and pop a global variable
 			Read16ip(parameter);
-			// parameter = *((int16_TYPE *) (code + ip));
-			// ip += 2;
 			POPOFFSTACK(value);
 			_globals[parameter] += value;
-			debug(5, "+= %d into global var %d->%d", value, parameter, *(int32 *) (variables + parameter));
+			debug(5, "+= %d into global var %d->%d", value, parameter, _globals[parameter]);
 			break;
 		case CP_SUBNPOP_GLOBAL_VAR32:
 			// Sub and pop a global variable
 			Read16ip(parameter);
 			POPOFFSTACK(value);
 			_globals[parameter] -= value;
-			debug(5, "-= %d into global var %d->%d", value, parameter, *(int32 *) (variables + parameter));
+			debug(5, "-= %d into global var %d->%d", value, parameter, _globals[parameter]);
 			break;
 		case CP_DEBUGON:
 			// Turn debugging on
@@ -482,7 +484,7 @@
 				stack2[stackPointer2 - 2],
 				stack2[stackPointer2 - 1],
 				stack2[stackPointer2 - 2] == stack2[stackPointer2 - 1]);
-			DOOPERATION (stack2[stackPointer2 - 2] == stack2[stackPointer2 - 1]);
+			DOOPERATION(stack2[stackPointer2 - 2] == stack2[stackPointer2 - 1]);
 			break;
 		case OP_PLUS:
 			// '+'
@@ -602,7 +604,7 @@
 		case CP_PUSH_DEREFERENCED_STRUCTURE:
 			// Push the address of a dereferenced structure
 			Read32ip(parameter);
-			debug(5, "Push address of far variable (%x)", (int32) (variables + parameter));
+			debug(5, "Push address of far variable (%x)", (int32) (objectData + sizeof(int32) + sizeof(_standardHeader) + sizeof(_object_hub) + parameter));
 			PUSHONSTACK((int32) (objectData + sizeof(int32) + sizeof(_standardHeader) + sizeof(_object_hub) + parameter));
 			break;
 		case OP_GTTHANE:





More information about the Scummvm-git-logs mailing list