[Scummvm-cvs-logs] CVS: scummvm/scumm saveload.cpp,1.70,1.71 script.cpp,1.83,1.84 script_v2.cpp,2.70,2.71 script_v5.cpp,1.80,1.81 scumm.h,1.194,1.195

Max Horn fingolfin at users.sourceforge.net
Thu May 15 19:18:01 CEST 2003


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

Modified Files:
	saveload.cpp script.cpp script_v2.cpp script_v5.cpp scumm.h 
Log Message:
SentenceTab unk4/unk3 are the sentence objects (think of: 'Use objectA with objectB' or 'Give objectA to objectB' etc.); added a little more V2 sentence hackery; added a FIXME regarding some strange sentence code (accessing objectB before it is set) in script.cpp

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- saveload.cpp	15 May 2003 22:36:42 -0000	1.70
+++ saveload.cpp	16 May 2003 02:16:56 -0000	1.71
@@ -532,8 +532,8 @@
 	const SaveLoadEntry sentenceTabEntries[] = {
 		MKLINE(SentenceTab, verb, sleUint8, VER_V8),
 		MKLINE(SentenceTab, unk2, sleUint8, VER_V8),
-		MKLINE(SentenceTab, unk4, sleUint16, VER_V8),
-		MKLINE(SentenceTab, unk3, sleUint16, VER_V8),
+		MKLINE(SentenceTab, objectA, sleUint16, VER_V8),
+		MKLINE(SentenceTab, objectB, sleUint16, VER_V8),
 		MKLINE(SentenceTab, freezeCount, sleUint8, VER_V8),
 		MKEND()
 	};

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- script.cpp	16 May 2003 01:56:06 -0000	1.83
+++ script.cpp	16 May 2003 02:16:57 -0000	1.84
@@ -709,7 +709,7 @@
 		
 		// Check if this doSentence request is identical to the previous one;
 		// if yes, ignore this invocation.
-		if (_sentenceNum && st->verb == c && st->unk4 == b && st->unk3 == a)
+		if (_sentenceNum && st->verb == c && st->objectA == b && st->objectB == a)
 			return;
 
 		_sentenceNum++;
@@ -719,7 +719,8 @@
 
 		st = &_sentence[_sentenceNum++];
 
-		if (!(st->unk3 & 0xFF00))
+		// FIXME: this seems wrong, it accesses objectB before we ever set it!
+		if (!(st->objectB & 0xFF00))
 			st->unk2 = 0;
 		else
 			st->unk2 = 1;
@@ -727,8 +728,8 @@
 	}
 
 	st->verb = c;
-	st->unk4 = b;
-	st->unk3 = a;
+	st->objectA = b;
+	st->objectB = a;
 	st->freezeCount = 0;
 }
 
@@ -755,12 +756,12 @@
 	_sentenceNum--;
 
 	if (!(_features & GF_AFTER_V7))
-		if (_sentence[_sentenceNum].unk2 && _sentence[_sentenceNum].unk3 == _sentence[_sentenceNum].unk4)
+		if (_sentence[_sentenceNum].unk2 && _sentence[_sentenceNum].objectB == _sentence[_sentenceNum].objectA)
 			return;
 
 	_localParamList[0] = _sentence[_sentenceNum].verb;
-	_localParamList[1] = _sentence[_sentenceNum].unk4;
-	_localParamList[2] = _sentence[_sentenceNum].unk3;
+	_localParamList[1] = _sentence[_sentenceNum].objectA;
+	_localParamList[2] = _sentence[_sentenceNum].objectB;
 	_currentScript = 0xFF;
 	if (sentenceScript)
 		runScript(sentenceScript, 0, 0, _localParamList);

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.70
retrieving revision 2.71
diff -u -d -r2.70 -r2.71
--- script_v2.cpp	16 May 2003 01:56:06 -0000	2.70
+++ script_v2.cpp	16 May 2003 02:16:57 -0000	2.71
@@ -843,8 +843,8 @@
 	st = &_sentence[_sentenceNum++];
 
 	st->verb = a;
-	st->unk4 = getVarOrDirectWord(0x40);
-	st->unk3 = getVarOrDirectWord(0x20);
+	st->objectA = getVarOrDirectWord(0x40);
+	st->objectB = getVarOrDirectWord(0x20);
 	st->freezeCount = 0;
 	
 	// TODO
@@ -852,19 +852,24 @@
 	case 1:
 		// Execute the sentence
 		_sentenceNum--;
-		warning("TODO o2_doSentence(%d, %d, %d): execute", st->verb, st->unk4, st->unk3);
+		warning("TODO o2_doSentence(%d, %d, %d): execute", st->verb, st->objectA, st->objectB);
 
 		// FIXME / TODO: The following is hackish, and probably incomplete, but it works somewhat.
 		_scummVars[8] = st->verb;
-		_scummVars[9] = st->unk4;
-		_scummVars[10] = st->unk3;
-		runVerbCode(st->unk4, st->verb, 0, 0, NULL);
+		_scummVars[9] = st->objectA;
+		_scummVars[10] = st->objectB;
+		runVerbCode(st->objectA, st->verb, 0, 0, NULL);
 
 		break;
 	case 2:
-		// TODO - print the sentence
+		// Print the sentence
 		_sentenceNum--;
-		warning("TODO o2_doSentence(%d, %d, %d): print", st->verb, st->unk4, st->unk3);
+		warning("TODO o2_doSentence(%d, %d, %d): print", st->verb, st->objectA, st->objectB);
+		
+		_scummVars[26] = st->verb;
+		_scummVars[27] = st->objectA;
+		_scummVars[28] = st->objectB;
+		o2_drawSentence();
 		break;
 	}
 }

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- script_v5.cpp	15 May 2003 22:48:06 -0000	1.80
+++ script_v5.cpp	16 May 2003 02:16:58 -0000	1.81
@@ -748,8 +748,8 @@
 	st = &_sentence[_sentenceNum++];
 
 	st->verb = a;
-	st->unk4 = getVarOrDirectWord(0x40);
-	b = st->unk3 = getVarOrDirectWord(0x20);
+	st->objectA = getVarOrDirectWord(0x40);
+	b = st->objectB = getVarOrDirectWord(0x20);
 	if (b == 0) {
 		st->unk2 = 0;
 	} else {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -d -r1.194 -r1.195
--- scumm.h	15 May 2003 22:48:06 -0000	1.194
+++ scumm.h	16 May 2003 02:16:59 -0000	1.195
@@ -207,8 +207,8 @@
 struct SentenceTab {
 	byte verb;
 	byte unk2;
-	uint16 unk4;
-	uint16 unk3;
+	uint16 objectA;
+	uint16 objectB;
 	uint8 freezeCount;
 };
 





More information about the Scummvm-git-logs mailing list