[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.50,1.51 script_v6.cpp,1.38,1.39 script_v8.cpp,2.110,2.111

Max Horn fingolfin at users.sourceforge.net
Sun Jan 12 13:14:04 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv3558

Modified Files:
	resource.cpp script_v6.cpp script_v8.cpp 
Log Message:
work around a script bug in COMI; cleanup; re-enabled array assert

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- resource.cpp	12 Jan 2003 08:32:44 -0000	1.50
+++ resource.cpp	12 Jan 2003 21:13:21 -0000	1.51
@@ -392,7 +392,17 @@
 		while ((num = _fileHandle.readUint32LE()) != 0) {
 			a = _fileHandle.readUint32LE();
 			b = _fileHandle.readUint32LE();
-			defineArray(num, 5, a, b);
+			
+			// FIXME - seems the COMI scripts have a bug related to array 436.
+			// and visible in script 2015, room 20. Basically, the dimensions
+			// are swapped in the definition of the array, but its obvious
+			// that this must be a script bug simply by looking at the defintions
+			// of other arrays and how they are used.
+			// Talk to fingolfin if you have questions about this :-)
+			if (num == 436)
+				defineArray(num, 5, b, a);
+			else
+				defineArray(num, 5, a, b);
 		}
 	} else {
 		while ((num = _fileHandle.readUint16LE()) != 0) {

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- script_v6.cpp	12 Jan 2003 18:55:41 -0000	1.38
+++ script_v6.cpp	12 Jan 2003 21:13:21 -0000	1.39
@@ -406,7 +406,7 @@
 
 	// FIXME: comment this for the time being as it was causing ft to crash
 	// in the minefeild
-	// assert(base >= 0 && base < ah->dim1_size * ah->dim2_size);
+	//assert(base >= 0 && base < ah->dim1_size * ah->dim2_size);
 
 	if (ah->type == 4) {
 		return ah->data[base];
@@ -424,12 +424,11 @@
 		return;
 	base += idx * ah->dim1_size;
 
-	//assert(base >= 0 && base < ah->dim1_size * ah->dim2_size);
+	assert(base >= 0 && base < ah->dim1_size * ah->dim2_size);
 
 	if (ah->type == 4) {
 		ah->data[base] = value;
 	} else if (_features & GF_AFTER_V8) {
-		// FIXME - this is just a guess, might be wrong
 		((uint32 *)ah->data)[base] = TO_LE_32(value);
 	} else {
 		((uint16 *)ah->data)[base] = TO_LE_16(value);

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.110
retrieving revision 2.111
diff -u -d -r2.110 -r2.111
--- script_v8.cpp	12 Jan 2003 17:51:12 -0000	2.110
+++ script_v8.cpp	12 Jan 2003 21:13:22 -0000	2.111
@@ -704,13 +704,13 @@
 		break;
 	case 0x15:		// SO_ASSIGN_SCUMMVAR_LIST
 		b = pop();
-		c = pop();
+		len = getStackList(list, sizeof(list) / sizeof(list[0]));
 		d = readVar(array);
 		if (d == 0) {
-			defineArray(array, 5, 0, b + c);
+			defineArray(array, 5, 0, b + len);
 		}
-		while (c--) {
-			writeArray(array, 0, b + c, pop());
+		while (--len >= 0) {
+			writeArray(array, 0, b + len, list[len]);
 		}
 		break;
 	case 0x16:		// SO_ASSIGN_2DIM_LIST





More information about the Scummvm-git-logs mailing list