[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.151,2.152 script_v6.cpp,1.314,1.315 script_v6he.cpp,2.34,2.35 script_v7he.cpp,2.6,2.7 scummvm.cpp,2.606,2.607

Travis Howell kirben at users.sourceforge.net
Mon Mar 1 22:39:01 CET 2004


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

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

Divide up some code for HE6 and HE7


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.151
retrieving revision 2.152
diff -u -d -r2.151 -r2.152
--- intern.h	2 Mar 2004 04:11:57 -0000	2.151
+++ intern.h	2 Mar 2004 06:19:26 -0000	2.152
@@ -563,6 +563,8 @@
 	int kernelGetFunctions1(byte *addr, int arg1, int arg2, int arg3, int agr4);
 	void kernelSetFunctions1(byte *addr);
 	void seekFilePos(int slot, int offset, int mode);
+	byte stringLen(byte *);
+	virtual void decodeParseString(int a, int b);
 
 	/* Version 6 script opcodes */
 	void o6_drawBlastObject();
@@ -589,6 +591,7 @@
 	void o6_localizeArray();
 	void o6_unknownFA();
 	void o6_redimArray();
+	void o6_stringLen();
 	void o6_readINI();
 	void o6_unknownF9();
 	void o6_readFilePos();
@@ -614,8 +617,6 @@
 	virtual void executeOpcode(byte i);
 	virtual const char *getOpcodeDesc(byte i);
 
-	virtual void decodeParseString(int a, int b);
-
 	byte stringLen(byte *);
 
 	/* Version 7 script opcodes */

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.314
retrieving revision 1.315
diff -u -d -r1.314 -r1.315
--- script_v6.cpp	1 Mar 2004 16:07:16 -0000	1.314
+++ script_v6.cpp	2 Mar 2004 06:19:26 -0000	1.315
@@ -931,7 +931,7 @@
 		_userPut--;
 		break;
 	case 0x99:{		// SO_CURSOR_IMAGE Set cursor image
-			if (_features & GF_AFTER_HEV7) {
+			if ((_features & GF_HUMONGOUS) && (_features & GF_WINDOWS)) {
 				warning("cursorCommand 0x99 PC_SetCursorToID(%d) stub", pop());
 				break;
 			}

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.34
retrieving revision 2.35
diff -u -d -r2.34 -r2.35
--- script_v6he.cpp	2 Mar 2004 01:20:18 -0000	2.34
+++ script_v6he.cpp	2 Mar 2004 06:19:26 -0000	2.35
@@ -344,7 +344,7 @@
 		/* EC */
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
-		OPCODE(o6_invalid),
+		OPCODE(o6_stringLen),
 		OPCODE(o6_invalid),
 		/* F0 */
 		OPCODE(o6_invalid),
@@ -1244,6 +1244,56 @@
 	ah->dim2 = TO_LE_16(newX + 1);
 }
 
+void ScummEngine_v6he::o6_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_v6he::o7_stringLen: Reference to zeroed array pointer (%d)", a);
+		push(0);
+		return;
+	}
+
+	len = stringLen(addr);
+	push(len);
+}
+
+byte ScummEngine_v6he::stringLen(byte *ptr) {
+	byte len;
+	byte c;
+	if (!ptr) {
+		//ptr = _someGlobalPtr;
+		error("ScummEngine_v6he::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_v6he::o6_readINI() {
 	int len;
 
@@ -1285,4 +1335,90 @@
 	warning("stub o6_unknownF9(\"%s\")", filename + r);
 }
 
+void ScummEngine_v6he::decodeParseString(int m, int n) {
+	byte b;
+	int c;
+
+	b = fetchScriptByte();
+
+	switch (b) {
+	case 65:		// SO_AT
+		_string[m].ypos = pop();
+		_string[m].xpos = pop();
+		_string[m].overhead = false;
+		break;
+	case 66:		// SO_COLOR
+		_string[m].color = pop();
+		break;
+	case 67:		// SO_CLIPPED
+		_string[m].right = pop();
+		break;
+	case 69:		// SO_CENTER
+		_string[m].center = true;
+		_string[m].overhead = false;
+		break;
+	case 71:		// SO_LEFT
+		_string[m].center = false;
+		_string[m].overhead = false;
+		break;
+	case 72:		// SO_OVERHEAD
+		_string[m].overhead = true;
+		_string[m].no_talk_anim = false;
+		break;
+	case 73:		// SO_SAY_VOICE
+		error("decodeParseString: case 73");
+		break;
+	case 74:		// SO_MUMBLE
+		_string[m].no_talk_anim = true;
+		break;
+	case 75:		// SO_TEXTSTRING
+		_messagePtr = translateTextAndPlaySpeech(_scriptPointer);
+		_scriptPointer += resStrLen(_scriptPointer)+ 1;
+
+		switch (m) {
+		case 0:
+			actorTalk();
+			break;
+		case 1:
+			drawString(1);
+			break;
+		case 2:
+			unkMessage1();
+			break;
+		case 3:
+			unkMessage2();
+			break;
+		}
+		return;
+	case 0xF9:
+		c = pop();
+		if (c == 1) {
+			_string[m].color = pop();
+		} else {	
+			push(c);
+			int args[16];
+			getStackList(args, ARRAYSIZE(args));
+		}
+		warning("decodeParseString case 0xF9 stub");
+		return;
+	case 0xFE:
+		setStringVars(m);
+		if (n)
+			_actorToPrintStrFor = pop();
+		return;
+	case 0xFF:
+		_string[m].t_xpos = _string[m].xpos;
+		_string[m].t_ypos = _string[m].ypos;
+		_string[m].t_center = _string[m].center;
+		_string[m].t_overhead = _string[m].overhead;
+		_string[m].t_no_talk_anim = _string[m].no_talk_anim;
+		_string[m].t_right = _string[m].right;
+		_string[m].t_color = _string[m].color;
+		_string[m].t_charset = _string[m].charset;
+		return;
+	default:
+		error("decodeParseString: default case 0x%x", b);
+	}
+}
+
 } // End of namespace Scumm

Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -d -r2.6 -r2.7
--- script_v7he.cpp	2 Mar 2004 04:11:57 -0000	2.6
+++ script_v7he.cpp	2 Mar 2004 06:19:26 -0000	2.7
@@ -425,11 +425,7 @@
 		return;
 	}
 
-	if (_gameId == GID_FREDDEMO) {
-		len = strlen((char *)getStringAddress(a));
-	} else { // FREDDI.w32, PUTTMOON.w32
-		len = stringLen(addr);
-	}
+	len = strlen((char *)getStringAddress(a));
 	push(len);
 }
 
@@ -549,90 +545,4 @@
 	warning("o7_unknownFB stub");
 }
 
-void ScummEngine_v7he::decodeParseString(int m, int n) {
-	byte b;
-	int c;
-
-	b = fetchScriptByte();
-
-	switch (b) {
-	case 65:		// SO_AT
-		_string[m].ypos = pop();
-		_string[m].xpos = pop();
-		_string[m].overhead = false;
-		break;
-	case 66:		// SO_COLOR
-		_string[m].color = pop();
-		break;
-	case 67:		// SO_CLIPPED
-		_string[m].right = pop();
-		break;
-	case 69:		// SO_CENTER
-		_string[m].center = true;
-		_string[m].overhead = false;
-		break;
-	case 71:		// SO_LEFT
-		_string[m].center = false;
-		_string[m].overhead = false;
-		break;
-	case 72:		// SO_OVERHEAD
-		_string[m].overhead = true;
-		_string[m].no_talk_anim = false;
-		break;
-	case 73:		// SO_SAY_VOICE
-		error("decodeParseString: case 73");
-		break;
-	case 74:		// SO_MUMBLE
-		_string[m].no_talk_anim = true;
-		break;
-	case 75:		// SO_TEXTSTRING
-		_messagePtr = translateTextAndPlaySpeech(_scriptPointer);
-		_scriptPointer += resStrLen(_scriptPointer)+ 1;
-
-		switch (m) {
-		case 0:
-			actorTalk();
-			break;
-		case 1:
-			drawString(1);
-			break;
-		case 2:
-			unkMessage1();
-			break;
-		case 3:
-			unkMessage2();
-			break;
-		}
-		return;
-	case 0xF9:
-		c = pop();
-		if (c == 1) {
-			_string[m].color = pop();
-		} else {	
-			push(c);
-			int args[16];
-			getStackList(args, ARRAYSIZE(args));
-		}
-		warning("decodeParseString case 0xF9 stub");
-		return;
-	case 0xFE:
-		setStringVars(m);
-		if (n)
-			_actorToPrintStrFor = pop();
-		return;
-	case 0xFF:
-		_string[m].t_xpos = _string[m].xpos;
-		_string[m].t_ypos = _string[m].ypos;
-		_string[m].t_center = _string[m].center;
-		_string[m].t_overhead = _string[m].overhead;
-		_string[m].t_no_talk_anim = _string[m].no_talk_anim;
-		_string[m].t_right = _string[m].right;
-		_string[m].t_color = _string[m].color;
-		_string[m].t_charset = _string[m].charset;
-		return;
-	default:
-		error("decodeParseString: default case 0x%x", b);
-	}
-}
-
 } // End of namespace Scumm

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.606
retrieving revision 2.607
diff -u -d -r2.606 -r2.607
--- scummvm.cpp	2 Mar 2004 06:04:38 -0000	2.606
+++ scummvm.cpp	2 Mar 2004 06:19:26 -0000	2.607
@@ -667,7 +667,7 @@
 	if (_features & GF_FMTOWNS) {	// FMTowns V3 games use 320x240
 		_screenWidth = 320;
 		_screenHeight = 240;
-	} else if ((_gameId == GID_CMI) || (_features & GF_WINDOWS)) {
+	} else if ((_gameId == GID_CMI) || ((_features & GF_HUMONGOUS) && (_features & GF_WINDOWS))) {
 		_screenWidth = 640;
 		_screenHeight = 480;
 	} else if (_features & GF_NES) {





More information about the Scummvm-git-logs mailing list