[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.336,1.337 script_v6.cpp,1.452,1.453 script_v6he.cpp,2.166,2.167 script_v72he.cpp,2.305,2.306

kirben kirben at users.sourceforge.net
Fri Oct 14 05:38:16 CEST 2005


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

Modified Files:
	resource.cpp script_v6.cpp script_v6he.cpp script_v72he.cpp 
Log Message:

Adjust array ids in HE80+ games, to match original.
Otherwise array aren't always nuked by scripts.


Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.336
retrieving revision 1.337
diff -u -d -r1.336 -r1.337
--- resource.cpp	14 Oct 2005 02:13:33 -0000	1.336
+++ resource.cpp	14 Oct 2005 12:36:45 -0000	1.337
@@ -753,6 +753,10 @@
 	byte *ptr;
 
 	CHECK_HEAP
+
+	if (_heversion >= 80 && type == rtString)
+		idx &= ~0x33539000;
+
 	if (!res.validateResource("getResourceAddress", type, idx))
 		return NULL;
 

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.452
retrieving revision 1.453
diff -u -d -r1.452 -r1.453
--- script_v6.cpp	9 Sep 2005 07:24:11 -0000	1.452
+++ script_v6.cpp	14 Oct 2005 12:36:46 -0000	1.453
@@ -460,6 +460,9 @@
 
 	data = readVar(a);
 
+	if (_heversion >= 80)
+		data &= ~0x33539000;
+
 	if (data)
 		res.nukeResource(rtString, data);
 	if (_heversion >= 60)

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.166
retrieving revision 2.167
diff -u -d -r2.166 -r2.167
--- script_v6he.cpp	13 Oct 2005 15:02:21 -0000	2.166
+++ script_v6he.cpp	14 Oct 2005 12:36:46 -0000	2.167
@@ -1152,6 +1152,9 @@
 }
 
 void ScummEngine_v60he::localizeArray(int slot, byte scriptSlot) {
+	if (_heversion >= 80)
+		slot &= ~0x33539000;
+
 	if (slot >= _numArray)
 		error("o60_localizeArrayToScript(%d): array slot out of range", slot);
 

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.305
retrieving revision 2.306
diff -u -d -r2.305 -r2.306
--- script_v72he.cpp	5 Sep 2005 07:50:41 -0000	2.305
+++ script_v72he.cpp	14 Oct 2005 12:36:46 -0000	2.306
@@ -405,8 +405,14 @@
 
 	size = arrayDataSizes[type];
 
+	if (_heversion >= 80)
+		id |= 0x33539000;
+
 	writeVar(array, id);
 
+	if (_heversion >= 80)
+		id &= ~0x33539000;
+
 	size *= dim2end - dim2start + 1;
 	size *= dim1end - dim1start + 1;
 	size >>= 3;





More information about the Scummvm-git-logs mailing list