[Scummvm-cvs-logs] CVS: scummvm/scumm saveload.cpp,1.47,1.48 script.cpp,1.42,1.43 scumm.h,1.132,1.133

Max Horn max at quendi.de
Wed Jan 15 12:29:14 CET 2003


At 7:49 Uhr -0800 15.01.2003, James Brown wrote:
>Update of /cvsroot/scummvm/scummvm/scumm
>In directory sc8-pr-cvs1:/tmp/cvs-serv30669/scumm
>
>Modified Files:
>	saveload.cpp script.cpp scumm.h
>Log Message:
>ComI uses more locals
>

Hum, where does it use more than 16 local variables? The highest I 
see is access to localvar15, and that is in exactly one script, 
ROOM-010-cannon-v/LSCR-2008.lck. So why was that change made? If we 
error out due to not enough local vars, then most ceretainly 
something else is wrong, and this change is just hiding the symptoms 
and is not fixing the issue.

And in any case something is wrong with that patch:


>Index: saveload.cpp
>===================================================================
>RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
>retrieving revision 1.47
>retrieving revision 1.48
>diff -u -d -r1.47 -r1.48
>--- saveload.cpp	15 Jan 2003 14:14:00 -0000	1.47
>+++ saveload.cpp	15 Jan 2003 15:49:44 -0000	1.48
>@@ -358,10 +358,10 @@
>  		MKARRAY(Scumm, _localScriptList[0], sleUint32, 
>NUM_LOCALSCRIPT, VER_V8),
>
>  		// vm.localvar grew from 25 to 40 entries and then from
>-		// 16 to 32 bit variables.
>+		// 16 to 32 bit variables... and THEN from 16 to 20 variables
>  		MKARRAY_OLD(Scumm, vm.localvar[0][0], sleUint16, 25 * 
>17, VER_V8, VER_V8),
>  		MKARRAY_OLD(Scumm, vm.localvar[0][0], sleUint16, 
>NUM_SCRIPT_SLOT * 17, VER_V9, VER_V14),
>-		MKARRAY(Scumm, vm.localvar[0][0], sleUint16, 
>NUM_SCRIPT_SLOT * 17, VER_V15),
>+		MKARRAY(Scumm, vm.localvar[0][0], sleUint16, 
>NUM_SCRIPT_SLOT * 20, VER_V15),
>
>  		MKARRAY(Scumm, _resourceMapper[0], sleByte, 128, VER_V8),
>  		MKARRAY(Scumm, _charsetColorMap[0], sleByte, 16, VER_V8),


Here you change 17 to 20


>Index: script.cpp
>===================================================================
>RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
>retrieving revision 1.42
>retrieving revision 1.43
>diff -u -d -r1.42 -r1.43
>--- script.cpp	12 Jan 2003 10:22:07 -0000	1.42
>+++ script.cpp	15 Jan 2003 15:49:44 -0000	1.43
>@@ -385,7 +385,7 @@
>  		} else {
>  			var &= 0xFFF;
>  		}
>-		checkRange(0x10, 0, var, "Local variable %d out of range(r)");
>+		checkRange(20, 0, var, "Local variable %d out of range(r)");
>  		return vm.localvar[_currentScript][var];
>  	}
>
>@@ -450,7 +450,7 @@
>  			var &= 0xFFF;
>  		}
>
>-		checkRange(0x10, 0, var, "Local variable %d out of range(w)");
>+		checkRange(20, 0, var, "Local variable %d out of range(w)");
>  		vm.localvar[_currentScript][var] = value;
>  		return;
>  	}


... and here 16 to 20


>Index: scumm.h
>===================================================================
>RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
>retrieving revision 1.132
>retrieving revision 1.133
>diff -u -d -r1.132 -r1.133
>--- scumm.h	15 Jan 2003 13:29:00 -0000	1.132
>+++ scumm.h	15 Jan 2003 15:49:44 -0000	1.133
>@@ -254,7 +254,7 @@
>  		byte cutSceneStackPointer;
>  		ScriptSlot slot[NUM_SCRIPT_SLOT];
>  		NestedScript nest[15];
>-		int32 localvar[NUM_SCRIPT_SLOT][17];
>+		int32 localvar[NUM_SCRIPT_SLOT][21];
>  	} vm;
>
>  	struct {
>

and here 17 to 21.


Most probably, in saveload.cpp it should be 21, too, no?


Max
-- 
-----------------------------------------------
Max Horn
Software Developer




More information about the Scummvm-git-logs mailing list