[Scummvm-cvs-logs] CVS: scummvm/scumm debugger.cpp,1.43,1.44 saveload.cpp,1.71,1.72 script.cpp,1.92,1.93 script_v5.cpp,1.84,1.85 scumm.h,1.200,1.201

Max Horn fingolfin at users.sourceforge.net
Mon May 19 04:32:08 CEST 2003


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

Modified Files:
	debugger.cpp saveload.cpp script.cpp script_v5.cpp scumm.h 
Log Message:
renamed ScriptSlot::unk1/unk2  to freezeResistant/recursive

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- debugger.cpp	18 May 2003 23:45:34 -0000	1.43
+++ debugger.cpp	19 May 2003 11:31:33 -0000	1.44
@@ -521,13 +521,13 @@
 bool ScummDebugger::Cmd_PrintScript(int argc, const char **argv) {
 	int i;
 	ScriptSlot *ss = &_s->vm.slot[1];
-	Debug_Printf("+-----------------------------+\n");
-	Debug_Printf("|# |num|sta|typ|un1|un2|fc|cut|\n");
-	Debug_Printf("+--+---+---+---+---+--+---+---+\n");
+	Debug_Printf("+----------------------------+\n");
+	Debug_Printf("|# |num|sta|typ|fr|rec|fc|cut|\n");
+	Debug_Printf("+--+---+---+---+--+--+---+---+\n");
 	for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) {
 		if (ss->number) {
-			Debug_Printf("|%2d|%3d|%3d|%3d|%3d|%3d|%2d|%3d|\n",
-					i, ss->number, ss->status, ss->where, ss->unk1, ss->unk2,
+			Debug_Printf("|%2d|%3d|%3d|%3d|%2d|%3d|%2d|%3d|\n",
+					i, ss->number, ss->status, ss->where, ss->freezeResistant, ss->recursive,
 					ss->freezeCount, ss->cutsceneOverride);
 		}
 	}

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- saveload.cpp	16 May 2003 02:16:56 -0000	1.71
+++ saveload.cpp	19 May 2003 11:31:34 -0000	1.72
@@ -513,8 +513,8 @@
 		MKLINE(ScriptSlot, delayFrameCount, sleUint16, VER_V8),
 		MKLINE(ScriptSlot, status, sleByte, VER_V8),
 		MKLINE(ScriptSlot, where, sleByte, VER_V8),
-		MKLINE(ScriptSlot, unk1, sleByte, VER_V8),
-		MKLINE(ScriptSlot, unk2, sleByte, VER_V8),
+		MKLINE(ScriptSlot, freezeResistant, sleByte, VER_V8),
+		MKLINE(ScriptSlot, recursive, sleByte, VER_V8),
 		MKLINE(ScriptSlot, freezeCount, sleByte, VER_V8),
 		MKLINE(ScriptSlot, didexec, sleByte, VER_V8),
 		MKLINE(ScriptSlot, cutsceneOverride, sleByte, VER_V8),

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- script.cpp	18 May 2003 23:46:30 -0000	1.92
+++ script.cpp	19 May 2003 11:31:34 -0000	1.93
@@ -34,19 +34,18 @@
 };
 
 
-/* Start executing script 'script' with parameters 'a' and 'b' */
-void Scumm::runScript(int script, int a, int b, int *lvarptr) {
+/* Start executing script 'script' with the given parameters */
+void Scumm::runScript(int script, bool freezeResistant, bool recursive, int *lvarptr) {
+	ScriptSlot *s;
 	byte *scriptPtr;
 	uint32 scriptOffs;
 	byte scriptType;
 	int slot;
-	ScriptSlot *s;
-
 
-	if (script == 0)
+	if (!script)
 		return;
 
-	if (b == 0)
+	if (!recursive)
 		stopScriptNr(script);
 
 	if (script < _numGlobalScripts) {
@@ -67,10 +66,9 @@
 	s->offs = scriptOffs;
 	s->status = ssRunning;
 	s->where = scriptType;
-	s->unk1 = a;
-	s->unk2 = b;
+	s->freezeResistant = freezeResistant;
+	s->recursive = recursive;
 	s->freezeCount = 0;
-
 	s->delayFrameCount = 0;
 
 	initializeLocals(slot, lvarptr);
@@ -550,7 +548,7 @@
 	int i;
 
 	for (i = 0; i < NUM_SCRIPT_SLOT; i++) {
-		if (_currentScript != i && vm.slot[i].status != ssDead && (vm.slot[i].unk1 == 0 || flag >= 0x80)) {
+		if (_currentScript != i && vm.slot[i].status != ssDead && (!vm.slot[i].freezeResistant || flag >= 0x80)) {
 			vm.slot[i].status |= 0x80;
 			vm.slot[i].freezeCount++;
 		}
@@ -611,8 +609,8 @@
 		vm.slot[slot].number = 10001;
 		vm.slot[slot].where = WIO_ROOM;
 		vm.slot[slot].offs = _EXCD_offs;
-		vm.slot[slot].unk1 = 0;
-		vm.slot[slot].unk2 = 0;
+		vm.slot[slot].freezeResistant = false;
+		vm.slot[slot].recursive = false;
 		vm.slot[slot].freezeCount = 0;
 
 		vm.slot[slot].delayFrameCount = 0;
@@ -647,8 +645,8 @@
 		vm.slot[slot].number = 10002;
 		vm.slot[slot].where = WIO_ROOM;
 		vm.slot[slot].offs = _ENCD_offs;
-		vm.slot[slot].unk1 = 0;
-		vm.slot[slot].unk2 = 0;
+		vm.slot[slot].freezeResistant = false;
+		vm.slot[slot].recursive = false;
 		vm.slot[slot].freezeCount = 0;
 		vm.slot[slot].delayFrameCount = 0;
 		runScriptNested(slot);
@@ -805,13 +803,15 @@
 	}
 }
 
-void Scumm::runVerbCode(int object, int entry, int a, int b, int *vars) {
+void Scumm::runVerbCode(int object, int entry, bool freezeResistant, bool recursive, int *vars) {
+	ScriptSlot *s;
 	uint32 obcd;
 	int slot, where, offs;
 
 	if (!object)
 		return;
-	if (!b)
+
+	if (!recursive)
 		stopObjectScript(object);
 
 	where = whereIsObject(object);
@@ -828,14 +828,15 @@
 	if (offs == 0)
 		return;
 
-	vm.slot[slot].number = object;
-	vm.slot[slot].offs = obcd + offs;
-	vm.slot[slot].status = ssRunning;
-	vm.slot[slot].where = where;
-	vm.slot[slot].unk1 = a;
-	vm.slot[slot].unk2 = b;
-	vm.slot[slot].freezeCount = 0;
-	vm.slot[slot].delayFrameCount = 0;
+	s = &vm.slot[slot];
+	s->number = object;
+	s->offs = obcd + offs;
+	s->status = ssRunning;
+	s->where = where;
+	s->freezeResistant = freezeResistant;
+	s->recursive = recursive;
+	s->freezeCount = 0;
+	s->delayFrameCount = 0;
 
 	initializeLocals(slot, vars);
 

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- script_v5.cpp	18 May 2003 21:14:49 -0000	1.84
+++ script_v5.cpp	19 May 2003 11:31:35 -0000	1.85
@@ -595,7 +595,7 @@
 	vm.slot[cur].status = 0;
 	_currentScript = 0xFF;
 
-	runScript(data, vm.slot[cur].unk1, vm.slot[cur].unk2, vars);
+	runScript(data, vm.slot[cur].freezeResistant, vm.slot[cur].recursive, vars);
 }
 
 void Scumm_v5::o5_cursorCommand() {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- scumm.h	18 May 2003 23:46:30 -0000	1.200
+++ scumm.h	19 May 2003 11:31:35 -0000	1.201
@@ -91,10 +91,11 @@
 	int32 delay;
 	uint16 number;
 	uint16 delayFrameCount;
+	bool freezeResistant, recursive;
+	bool didexec;
 	byte status;
 	byte where;
-	byte unk1, unk2, freezeCount;
-	bool didexec;
+	byte freezeCount;
 	byte cutsceneOverride;
 };
 
@@ -495,7 +496,7 @@
 	void startManiac();
 
 public:
-	void runScript(int script, int a, int b, int *lvarptr);
+	void runScript(int script, bool freezeResistant, bool recursive, int *lvarptr);
 	void stopScriptNr(int script);
 
 protected:
@@ -698,7 +699,7 @@
 	int getVerbEntrypoint(int obj, int entry);
 	int getVerbSlot(int id, int mode);
 	void killVerb(int slot);
-	void runVerbCode(int script, int entry, int a, int b, int *vars);
+	void runVerbCode(int script, int entry, bool freezeResistant, bool recursive, int *vars);
 	void setVerbObject(uint room, uint object, uint verb);
 
 public:





More information about the Scummvm-git-logs mailing list