[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.139,1.140 intern.h,2.200,2.201 script.cpp,1.178,1.179 script_v6.cpp,1.389,1.390 script_v6he.cpp,2.93,2.94 script_v72he.cpp,2.23,2.24 script_v7he.cpp,2.47,2.48 scumm.cpp,1.140,1.141 scumm.h,1.452,1.453 sound.cpp,1.368,1.369

Travis Howell kirben at users.sourceforge.net
Thu Aug 26 01:48:01 CEST 2004


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

Modified Files:
	akos.cpp intern.h script.cpp script_v6.cpp script_v6he.cpp 
	script_v72he.cpp script_v7he.cpp scumm.cpp scumm.h sound.cpp 
Log Message:

More code/stubs for HE 7.2 games
Add another temp hack
Add id for water, uses more actors
Another small correction to music playback for HE 7.2 games


Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -d -r1.139 -r1.140
--- akos.cpp	22 Aug 2004 15:02:52 -0000	1.139
+++ akos.cpp	26 Aug 2004 08:47:06 -0000	1.140
@@ -59,6 +59,7 @@
 	AKC_SetVar = 0xC010,
 	AKC_CmdQue3 = 0xC015,
 	AKC_ComplexChan = 0xC020,
+	AKC_Unk2 = 0xC025,
 	AKC_Jump = 0xC030,
 	AKC_JumpIfSet = 0xC031,
 	AKC_AddVar = 0xC040,
@@ -1294,6 +1295,7 @@
 		case AKC_EndSeq:
 		case AKC_ComplexChan:
 		case AKC_Unk1:
+		case AKC_Unk2:
 			break;
 
 		case AKC_Cmd3:
@@ -1322,7 +1324,7 @@
 	int code2 = aksq[curpos];
 	if (code2 & 0x80)
 		code2 = (code2 << 8) | aksq[curpos + 1];
-	assert((code2 & 0xC000) != 0xC000 || code2 == AKC_ComplexChan || code2 == AKC_Return || code2 == AKC_EndSeq || code2 == AKC_Unk1);
+	assert((code2 & 0xC000) != 0xC000 || code2 == AKC_ComplexChan || code2 == AKC_Return || code2 == AKC_EndSeq || code2 == AKC_Unk1 || code2 == AKC_Unk2);
 
 	a->cost.curpos[chan] = curpos;
 

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.200
retrieving revision 2.201
diff -u -d -r2.200 -r2.201
--- intern.h	26 Aug 2004 06:08:41 -0000	2.200
+++ intern.h	26 Aug 2004 08:47:06 -0000	2.201
@@ -678,8 +678,6 @@
 	int readFileToArray(int slot, int32 size);
 	void writeFileFromArray(int slot, int resID);
 
-	void copyScriptString(byte *dst);
-
 	/* Version 7 script opcodes */
 	void o72_pushDWord();
 	void o72_addMessageToStack();
@@ -715,6 +713,8 @@
 	void o72_stringLen();
 	void o72_readINI();
 	void o72_unknownF4();
+	void o72_unknownF8();
+	void o72_unknownF9();
 	void o72_unknownFA();
 	void o72_unknownFB();
 	void o72_unknownFC();

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- script.cpp	26 Aug 2004 06:08:41 -0000	1.178
+++ script.cpp	26 Aug 2004 08:47:06 -0000	1.179
@@ -478,9 +478,12 @@
 
 int ScummEngine::readVar(uint var) {
 	// HACK Seems to variable difference
+	// Correct values for now
 	if (_gameId == GID_PAJAMA && var == 32770) 
 		return 5;
-
+	else if (_gameId == GID_WATER && var == 32770) 
+		return 23
+;
 	int a;
 	static byte copyprotbypassed;
 	if (!_copyProtection)
@@ -1034,10 +1037,20 @@
 	return false;
 }
 
-void ScummEngine::copyScriptString(byte *dst) {
-	int len = resStrLen(_scriptPointer) + 1;
-	while (len--)
-		*dst++ = fetchScriptByte();
+void ScummEngine::copyScriptString(byte *dst, bool override) {
+	int len, i = 0;
+	if (_heversion >= 72 && (pop() == -1 || override)) {
+		printf("part one\n");
+		len = resStrLen(_stringBuffer) + 1;
+		while (len--)
+			*dst++ = _stringBuffer[i++];
+	} else {
+		printf("part two\n");
+		len = resStrLen(_scriptPointer) + 1;
+		while (len--)
+			*dst++ = fetchScriptByte();
+	}
+
 }
 
 //

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.389
retrieving revision 1.390
diff -u -d -r1.389 -r1.390
--- script_v6.cpp	25 Aug 2004 02:12:03 -0000	1.389
+++ script_v6.cpp	26 Aug 2004 08:47:06 -0000	1.390
@@ -1915,6 +1915,7 @@
 	int slot, a, b;
 	VerbSlot *vs;
 	byte op;
+	byte name[200];
 
 	op = fetchScriptByte();
 	if (op == 196) {
@@ -1936,7 +1937,8 @@
 		}
 		break;
 	case 125:		// SO_VERB_NAME
-		loadPtrToResource(rtVerb, slot, NULL);
+		copyScriptString(name);
+		loadPtrToResource(rtVerb, slot, name);
 		vs->type = kTextVerbType;
 		vs->imgindex = 0;
 		break;

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.93
retrieving revision 2.94
diff -u -d -r2.93 -r2.94
--- script_v6he.cpp	26 Aug 2004 06:08:41 -0000	2.93
+++ script_v6he.cpp	26 Aug 2004 08:47:07 -0000	2.94
@@ -549,6 +549,7 @@
 	int i, j, k;
 	int args[8];
 	byte b;
+	byte name[256];
 
 	b = fetchScriptByte();
 	if (b == 197) {
@@ -620,7 +621,8 @@
 		a->talkColor = pop();
 		break;
 	case 88:		// SO_ACTOR_NAME
-		loadPtrToResource(rtActorName, a->number, NULL);
+		copyScriptString(name);
+		loadPtrToResource(rtActorName, a->number, name);
 		break;
 	case 89:		// SO_INIT_ANIMATION
 		a->initFrame = pop();
@@ -999,7 +1001,8 @@
 void ScummEngine_v6he::o6_closeFile() {
 	int slot = pop();
 	if (slot != -1)
-		_hFileTable[slot].close();
+		if (_hFileTable[slot].isOpen() == true)
+			_hFileTable[slot].close();
 }
 
 void ScummEngine_v6he::o6_deleteFile() {

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.23
retrieving revision 2.24
diff -u -d -r2.23 -r2.24
--- script_v72he.cpp	26 Aug 2004 06:08:41 -0000	2.23
+++ script_v72he.cpp	26 Aug 2004 08:47:07 -0000	2.24
@@ -356,8 +356,8 @@
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
 		/* F8 */
-		OPCODE(o6_invalid),
-		OPCODE(o7_unknownF9),
+		OPCODE(o72_unknownF8),
+		OPCODE(o72_unknownF9),
 		OPCODE(o72_unknownFA),
 		OPCODE(o72_unknownFB),
 		/* FC */
@@ -513,21 +513,6 @@
 	}
 }
 
-void ScummEngine_v72he::copyScriptString(byte *dst) {
-	int a = pop();
-	int b = 0;
-	// FIXME Should only be -1
-	if (a == 1 || a == -1) {
-		int len = resStrLen(_stringBuffer) + 1;
-		while (len--)
-			*dst++ = _stringBuffer[b++];
-	} else {
-		int len = resStrLen(_scriptPointer) + 1;
-		while (len--)
-			*dst++ = fetchScriptByte();
-	}
-}
-
 void ScummEngine_v72he::o72_pushDWord() {
 	int a;
 	if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) {
@@ -743,7 +728,13 @@
 	switch (subOp) {
 	case 7:			// SO_ASSIGN_STRING
 		array = fetchScriptWord();
-		ah = defineArray(array, kStringArray, 0, 0, 0, 256);
+		ah = defineArray(array, kStringArray, 0, 0, 0, 1024);
+		copyScriptString(ah->data);
+		break;
+	case 194:			// SO_ASSIGN_STRING
+		array = fetchScriptWord();
+		len = getStackList(list, ARRAYSIZE(list));
+		ah = defineArray(array, kStringArray, 0, 0, 0, 1024);
 		copyScriptString(ah->data);
 		break;
 	case 208:		// SO_ASSIGN_INT_LIST
@@ -887,7 +878,7 @@
 	int mode, slot, l, r;
 	byte filename[100];
 
-	copyScriptString(filename);
+	copyScriptString(filename, true);
 	printf("File %s\n", filename);
 	
 	for (r = strlen((char*)filename); r != 0; r--) {
@@ -916,6 +907,7 @@
 			slot = -1;
 
 	}
+	debug(1, "o72_openFile: slot %d, mode %d", slot, mode);
 	push(slot);
 }
 
@@ -962,6 +954,8 @@
 	default:
 		error("default case %d", subOp);
 	}
+	debug(1, "o72_readFile: slot %d, subOp %d val %d", slot, subOp, val);
+
 }
 
 void ScummEngine_v72he::writeFileFromArray(int slot, int resID) {
@@ -1194,6 +1188,28 @@
 	debug(1,"o72_unknownFA: (%d) %s", id, name);
 }
 
+void ScummEngine_v72he::o72_unknownF8() {
+	int a = fetchScriptByte();
+	push(1);
+
+	warning("stub o72_unknownF8(%d)", a);
+}
+
+void ScummEngine_v72he::o72_unknownF9() {
+	// File related
+	int r;
+	byte filename[255];
+
+	copyScriptString(filename);
+
+	for (r = strlen((char*)filename); r != 0; r--) {
+		if (filename[r - 1] == '\\')
+			break;
+	}
+
+	warning("stub o72_unknownF9(\"%s\")", filename + r);
+}
+
 void ScummEngine_v72he::o72_unknownFB() {
 	byte b;
 	b = fetchScriptByte();

Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.47
retrieving revision 2.48
diff -u -d -r2.47 -r2.48
--- script_v7he.cpp	26 Aug 2004 06:08:41 -0000	2.47
+++ script_v7he.cpp	26 Aug 2004 08:47:07 -0000	2.48
@@ -486,6 +486,12 @@
 	op = fetchScriptByte();
 
 	switch (op) {
+	case 9:
+		_heSndLoop |= 4;
+		break;
+	case 164:
+		_heSndLoop |= 2;
+		break;
 	case 224:
 		_heSndSoundFreq = pop();
 		break;

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- scumm.cpp	26 Aug 2004 00:44:49 -0000	1.140
+++ scumm.cpp	26 Aug 2004 08:47:07 -0000	1.141
@@ -263,7 +263,7 @@
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
 	{"maze", "Freddi Fish and Luther's Maze Madness", GID_HEGAME, 6, 72, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
-	{"water", "Freddi Fish and Luther's Water Worries", GID_HEGAME, 6, 72, MDT_NONE,
+	{"water", "Freddi Fish and Luther's Water Worries", GID_WATER, 6, 72, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
 	{"pjs-demo", "Pajama Sam 1: No Need to Hide When It's Dark Outside (Demo)", GID_PAJAMA, 6, 72, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
@@ -1082,6 +1082,8 @@
 		_numActors = 25;
 	else if (_gameId == GID_PAJAMA)
 		_numActors = 62;
+	else if (_gameId == GID_WATER)
+		_numActors = 61;
 	else 
 		_numActors = 13;
 

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.452
retrieving revision 1.453
diff -u -d -r1.452 -r1.453
--- scumm.h	26 Aug 2004 00:44:49 -0000	1.452
+++ scumm.h	26 Aug 2004 08:47:07 -0000	1.453
@@ -257,7 +257,8 @@
 	GID_PUTTDEMO,
 	GID_FBEAR,
 	GID_FUNPACK,
-	GID_PAJAMA
+	GID_PAJAMA,
+	GID_WATER
 };
 
 #define _baseRooms res.address[rtRoom]
@@ -623,7 +624,7 @@
 	void beginOverride();
 	void endOverride();
 
-	void copyScriptString(byte *dst);
+	void copyScriptString(byte *dst, bool override = false);
 	int resStrLen(const byte *src) const;
 	void doSentence(int c, int b, int a);
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.368
retrieving revision 1.369
diff -u -d -r1.368 -r1.369
--- sound.cpp	26 Aug 2004 06:08:41 -0000	1.368
+++ sound.cpp	26 Aug 2004 08:47:07 -0000	1.369
@@ -166,7 +166,7 @@
 		debugC(DEBUG_SOUND, "playSound #%d", soundID);
 
 		int music_offs, total_size;
-		uint skip;
+		uint skip = 0;
 		char buf[32];
 		File musicFile;
 
@@ -195,7 +195,10 @@
 			musicFile.seek(+20, SEEK_CUR);
 
 			// Skip to correct music header
-			skip = (soundID - 4001) * 25;
+			if (soundID >= 8000)
+				skip = (soundID - 8001) * 25;
+			else
+				skip = (soundID - 4001) * 25;
 			musicFile.seek(+skip, SEEK_CUR);
 
 			// Skip to offsets





More information about the Scummvm-git-logs mailing list