[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.152,2.153 script_v6he.cpp,2.35,2.36 script_v7he.cpp,2.7,2.8

Travis Howell kirben at users.sourceforge.net
Mon Mar 1 23:02:06 CET 2004


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

Modified Files:
	intern.h script_v6he.cpp script_v7he.cpp 
Log Message:

Ooops, just move everyting used by HE6 to HE6.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.152
retrieving revision 2.153
diff -u -d -r2.152 -r2.153
--- intern.h	2 Mar 2004 06:19:26 -0000	2.152
+++ intern.h	2 Mar 2004 06:42:21 -0000	2.153
@@ -593,6 +593,7 @@
 	void o6_redimArray();
 	void o6_stringLen();
 	void o6_readINI();
+	void o6_unknownF4();
 	void o6_unknownF9();
 	void o6_readFilePos();
 };
@@ -617,13 +618,9 @@
 	virtual void executeOpcode(byte i);
 	virtual const char *getOpcodeDesc(byte i);
 
-	byte stringLen(byte *);
-
 	/* Version 7 script opcodes */
 	void o7_objectX();
 	void o7_objectY();
-	void o7_stringLen();
-	void o7_unknownF4();
 	void o7_unknownFB();
 };
 

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.35
retrieving revision 2.36
diff -u -d -r2.35 -r2.36
--- script_v6he.cpp	2 Mar 2004 06:19:26 -0000	2.35
+++ script_v6he.cpp	2 Mar 2004 06:42:22 -0000	2.36
@@ -352,7 +352,7 @@
 		OPCODE(o6_invalid),
 		OPCODE(o6_readINI),
 		/* F4 */
-		OPCODE(o6_invalid),
+		OPCODE(o6_unknownF4),
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
@@ -1248,22 +1248,21 @@
 	int a, len;
 	byte *addr;
 
-	if (!(_features & GF_WINDOWS)) {
-		o6_invalid();
-		return;
-	}
-
 	a = pop();
 
 	addr = getStringAddress(a);
 	if (!addr) {
 		// FIXME: should be error here
-		warning("ScummEngine_v6he::o7_stringLen: Reference to zeroed array pointer (%d)", a);
+		warning("o6_stringLen: Reference to zeroed array pointer (%d)", a);
 		push(0);
 		return;
 	}
 
-	len = stringLen(addr);
+	if (_gameId == GID_FREDDEMO) {
+		len = strlen((char *)getStringAddress(a));
+	} else { // FREDDI, PUTTMOON
+		len = stringLen(addr);
+	}
 	push(len);
 }
 
@@ -1315,6 +1314,65 @@
 	}
 }
 
+void ScummEngine_v6he::o6_unknownF4() {
+	if (_gameId == GID_FREDDEMO) {
+		byte b;
+		int len;
+		b = fetchScriptByte();
+
+		switch (b) {
+		case 6:
+			pop();
+			len = resStrLen(_scriptPointer);
+			_scriptPointer += len + 1;
+			break;
+		case 7:
+			len = resStrLen(_scriptPointer);
+			_scriptPointer += len + 1;
+			len = resStrLen(_scriptPointer);
+			_scriptPointer += len + 1;
+			break;
+		}
+	} else { // FREDDI, PUTTMOON
+		int a, b;
+		byte filename1[256], filename2[256];
+		int len;
+
+		
+		b = pop();
+		a = pop();
+
+		switch (b) {
+		case 1:
+			_msgPtrToAdd = filename1;
+			_messagePtr = _scriptPointer;
+			addMessageToStack(_messagePtr);
+
+			len = resStrLen(_scriptPointer);
+			_scriptPointer += len + 1;
+			debug(1, "o6_unknownF4(%d, %d, \"%s\")", a, b, _messagePtr);
+			break;
+		case 2:
+			_msgPtrToAdd = filename1;
+			_messagePtr = _scriptPointer;
+			addMessageToStack(_messagePtr);
+
+			len = resStrLen(_scriptPointer);
+			_scriptPointer += len + 1;
+
+			_msgPtrToAdd = filename2;
+			_messagePtr = _scriptPointer;
+			addMessageToStack(_messagePtr);
+
+			len = resStrLen(_scriptPointer);
+			_scriptPointer += len + 1;
+			debug(1, "o6_unknownF4(%d, %d, \"%s\", \"%s\")", a, b, filename1, filename2);
+			break;
+		}
+	}
+	warning("o6_unknownF4 stub");
+}
+
 void ScummEngine_v6he::o6_unknownF9() {
 	// File related
 	int len, r;

Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.7
retrieving revision 2.8
diff -u -d -r2.7 -r2.8
--- script_v7he.cpp	2 Mar 2004 06:19:26 -0000	2.7
+++ script_v7he.cpp	2 Mar 2004 06:42:22 -0000	2.8
@@ -344,7 +344,7 @@
 		/* EC */
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
-		OPCODE(o7_stringLen),
+		OPCODE(o6_stringLen),
 		OPCODE(o6_invalid),
 		/* F0 */
 		OPCODE(o6_invalid),
@@ -352,7 +352,7 @@
 		OPCODE(o6_invalid),
 		OPCODE(o6_readINI),
 		/* F4 */
-		OPCODE(o7_unknownF4),
+		OPCODE(o6_unknownF4),
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
@@ -406,120 +406,6 @@
 	push(_objs[objnum].y_pos);
 }
 
-void ScummEngine_v7he::o7_stringLen() {
-	int a, len;
-	byte *addr;
-
-	if (!(_features & GF_WINDOWS)) {
-		o6_invalid();
-		return;
-	}
-
-	a = pop();
-
-	addr = getStringAddress(a);
-	if (!addr) {
-		// FIXME: should be error here
-		warning("ScummEngine_v7he::o7_stringLen: Reference to zeroed array pointer (%d)", a);
-		push(0);
-		return;
-	}
-
-	len = strlen((char *)getStringAddress(a));
-	push(len);
-}
-
-byte ScummEngine_v7he::stringLen(byte *ptr) {
-	byte len;
-	byte c;
-	if (!ptr) {
-		//ptr = _someGlobalPtr;
-		error("ScummEngine_v7he::stringLen(): zero ptr. Undimplemented behaviour");
-		return 1;
-	}
-
-	len = 0;
-	c = *ptr++;
-
-	if (len == c)
-		return 1;
-
-	do {
-		len++;
-		if (c == 0xff) {
-			ptr += 3;
-			len += 3;
-		}
-		c = *ptr++;
-	} while (c);
-
-	return len+1;
-}
-
-void ScummEngine_v7he::o7_unknownF4() {
-	if (!(_features & GF_WINDOWS)) {
-		o6_invalid();
-		return;
-	}
-
-	if (_gameId == GID_FREDDEMO) {
-		byte b;
-		int len;
-		b = fetchScriptByte();
-
-		switch (b) {
-		case 6:
-			pop();
-			len = resStrLen(_scriptPointer);
-			_scriptPointer += len + 1;
-			break;
-		case 7:
-			len = resStrLen(_scriptPointer);
-			_scriptPointer += len + 1;
-			len = resStrLen(_scriptPointer);
-			_scriptPointer += len + 1;
-			break;
-		}
-	} else { // FREDDI.w32, PUTTMOON.w32
-		int a, b;
-		byte filename1[256], filename2[256];
-		int len;
-
-		
-		b = pop();
-		a = pop();
-
-		switch (b) {
-		case 1:
-			_msgPtrToAdd = filename1;
-			_messagePtr = _scriptPointer;
-			addMessageToStack(_messagePtr);
-
-			len = resStrLen(_scriptPointer);
-			_scriptPointer += len + 1;
-			debug(0, "unknownF4(%d, %d, \"%s\")", a, b, _messagePtr);
-			break;
-		case 2:
-			_msgPtrToAdd = filename1;
-			_messagePtr = _scriptPointer;
-			addMessageToStack(_messagePtr);
-
-			len = resStrLen(_scriptPointer);
-			_scriptPointer += len + 1;
-
-			_msgPtrToAdd = filename2;
-			_messagePtr = _scriptPointer;
-			addMessageToStack(_messagePtr);
-
-			len = resStrLen(_scriptPointer);
-			_scriptPointer += len + 1;
-			debug(0, "unknownF4(%d, %d, \"%s\", \"%s\")", a, b, filename1, filename2);
-			break;
-		}
-	}
-	warning("o7_unknownF4 stub");
-}
-
 void ScummEngine_v7he::o7_unknownFB() {
 	byte b;
 	b = fetchScriptByte();





More information about the Scummvm-git-logs mailing list