[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.292,2.293 intern.h,2.199,2.200 resource.cpp,1.250,1.251 script.cpp,1.177,1.178 script_v6he.cpp,2.92,2.93 script_v72he.cpp,2.22,2.23 script_v7he.cpp,2.46,2.47 sound.cpp,1.367,1.368

Travis Howell kirben at users.sourceforge.net
Wed Aug 25 23:13:21 CEST 2004


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

Modified Files:
	gfx.cpp intern.h resource.cpp script.cpp script_v6he.cpp 
	script_v72he.cpp script_v7he.cpp sound.cpp 
Log Message:

Add some stubs for HE 7.2
Fix warning
Add music support for later HE 7.2 games


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.292
retrieving revision 2.293
diff -u -d -r2.292 -r2.293
--- gfx.cpp	26 Aug 2004 03:21:33 -0000	2.292
+++ gfx.cpp	26 Aug 2004 06:08:41 -0000	2.293
@@ -1337,7 +1337,8 @@
 }
 
 void Gdi::decompressBMAPbg(byte *dst, int screenwidth, int w, int height, const byte *src, int shr, int mask) {
-	uint32 color, dataBit, data, shift, iteration;
+	uint32 color, dataBit, data, shift;
+	int32 iteration;
 
      color = *src;
 	 src++;

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.199
retrieving revision 2.200
diff -u -d -r2.199 -r2.200
--- intern.h	25 Aug 2004 12:48:47 -0000	2.199
+++ intern.h	26 Aug 2004 06:08:41 -0000	2.200
@@ -691,6 +691,8 @@
 	void o72_wordArrayInc();
 	void o72_objectX();
 	void o72_objectY();
+	void o72_getTimer();
+	void o72_setTimer();
 	void o72_wordArrayDec();
 	void o72_startScript();
 	void o72_startObject();
@@ -700,6 +702,7 @@
 	void o72_arrayOps();
 	void o72_dimArray();
 	void o72_dim2dimArray();
+	void o72_unknownCE();
 	void o72_shuffle();
 	void o72_jumpToScript();
 	void o72_openFile();

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.250
retrieving revision 1.251
diff -u -d -r1.250 -r1.251
--- resource.cpp	25 Aug 2004 06:58:30 -0000	1.250
+++ resource.cpp	26 Aug 2004 06:08:41 -0000	1.251
@@ -2411,7 +2411,6 @@
 	_inventory = (uint16 *)calloc(_numInventory, sizeof(uint16));
 	_verbs = (VerbSlot *)calloc(_numVerbs, sizeof(VerbSlot));
 	_objs = (ObjectData *)calloc(_numLocalObjects, sizeof(ObjectData));
-	debug(2, "Allocated %d space in numObjects", _numLocalObjects);
 	_scummVars = (int32 *)calloc(_numVariables, sizeof(int32));
 	_bitVars = (byte *)calloc(_numBitVariables >> 3, 1);
 	_images = (uint16 *)calloc(_numImages, sizeof(uint16));

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- script.cpp	24 Aug 2004 11:17:28 -0000	1.177
+++ script.cpp	26 Aug 2004 06:08:41 -0000	1.178
@@ -477,6 +477,10 @@
 }
 
 int ScummEngine::readVar(uint var) {
+	// HACK Seems to variable difference
+	if (_gameId == GID_PAJAMA && var == 32770) 
+		return 5;
+
 	int a;
 	static byte copyprotbypassed;
 	if (!_copyProtection)

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.92
retrieving revision 2.93
diff -u -d -r2.92 -r2.93
--- script_v6he.cpp	25 Aug 2004 11:20:33 -0000	2.92
+++ script_v6he.cpp	26 Aug 2004 06:08:41 -0000	2.93
@@ -772,7 +772,7 @@
 		_skipDrawObject = 0;
 		break;
 	default:
-		error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num);
+		warning("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num);
 		break;
 	}
 }
@@ -851,7 +851,7 @@
 		push(retval);
 		break;
 	default:
-		error("o6_kernelGetFunctions: default case %d", args[0]);
+		warning("o6_kernelGetFunctions: default case %d", args[0]);
 	}
 }
 

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.22
retrieving revision 2.23
diff -u -d -r2.22 -r2.23
--- script_v72he.cpp	25 Aug 2004 12:48:47 -0000	2.22
+++ script_v72he.cpp	26 Aug 2004 06:08:41 -0000	2.23
@@ -156,8 +156,8 @@
 		OPCODE(o6_invalid),
 		OPCODE(o6_wordVarDec),
 		/* 58 */
-		OPCODE(o6_invalid),
-		OPCODE(o6_invalid),
+		OPCODE(o72_getTimer),
+		OPCODE(o72_setTimer),
 		OPCODE(o6_invalid),
 		OPCODE(o72_wordArrayDec),
 		/* 5C */
@@ -303,7 +303,7 @@
 		/* CC */
 		OPCODE(o6_pickOneOfDefault),
 		OPCODE(o6_stampObject),
-		OPCODE(o6_invalid),
+		OPCODE(o72_unknownCE),
 		OPCODE(o6_invalid),
 		/* D0 */
 		OPCODE(o6_getDateTime),
@@ -619,6 +619,24 @@
 	push(_objs[objnum].y_pos);
 }
 
+void ScummEngine_v72he::o72_getTimer() {
+	int b =	pop();
+	int a =	fetchScriptByte();
+	warning("o72_getTimer stub (%d, %d)", b, a);
+	if (a == 10)
+		push(1);
+	else
+		push(0);
+}
+
+void ScummEngine_v72he::o72_setTimer() {
+	int b =	pop();
+	int a =	fetchScriptByte();
+	if (a != 158)
+		error("TIMER command %d?", a);
+	warning("o72_setTimer stub (%d, %d)", b, a);
+}
+
 void ScummEngine_v72he::o72_wordArrayDec() {
 	int var = fetchScriptWord();
 	int base = pop();
@@ -821,6 +839,15 @@
 	defineArray(fetchScriptWord(), data, 0, a, 0, b);
 }
 
+void ScummEngine_v72he::o72_unknownCE() {
+	int a =	pop();
+	int b =	pop();
+	int c =	pop();
+	int d =	pop();
+	warning("o72_unknownCE stub (%d, %d, %d, %d)", d, c, b, a);
+	push(4000);
+}
+
 void ScummEngine_v72he::shuffleArray(int num, int minIdx, int maxIdx) {
 	int range = maxIdx - minIdx;
 	int count = range * 2;

Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.46
retrieving revision 2.47
diff -u -d -r2.46 -r2.47
--- script_v7he.cpp	25 Aug 2004 11:17:16 -0000	2.46
+++ script_v7he.cpp	26 Aug 2004 06:08:41 -0000	2.47
@@ -707,7 +707,7 @@
 		warning("stub: o7_quitPauseRestart subOpcode %d", subOp);
 		break;
 	default:
-		error("o7_quitPauseRestart invalid case %d", subOp);
+		warning("o7_quitPauseRestart invalid case %d", subOp);
 	}
 }
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.367
retrieving revision 1.368
diff -u -d -r1.367 -r1.368
--- sound.cpp	24 Aug 2004 00:58:28 -0000	1.367
+++ sound.cpp	26 Aug 2004 06:08:41 -0000	1.368
@@ -166,8 +166,10 @@
 		debugC(DEBUG_SOUND, "playSound #%d", soundID);
 
 		int music_offs, total_size;
+		uint skip;
 		char buf[32];
 		File musicFile;
+
 		sprintf(buf, "%s.he4", _vm->getGameName());
 		if (musicFile.open(buf) == false) {
 			warning("playSound: Music file is not open");
@@ -176,15 +178,30 @@
 		musicFile.seek(4, SEEK_SET);
 		total_size = musicFile.readUint32BE();
 
-		// Skip header junk
-		musicFile.seek(+20, SEEK_CUR);
+		musicFile.seek(+40, SEEK_CUR);
+		if (musicFile.readUint32LE() == MKID('SGEN')) {
+			// Skip to correct music header
+			skip = (soundID - 4001) * 21;
+			musicFile.seek(+skip, SEEK_CUR);
 
-		// Skip to correct music header
-		uint skip = (soundID - 4001) * 25;
-		musicFile.seek(+skip, SEEK_CUR);
+			// Skip to offsets
+			musicFile.seek(+8, SEEK_CUR);
+		
+		} else {
+			// Rewind
+			musicFile.seek(-44, SEEK_CUR);
+
+			// Skip header junk
+			musicFile.seek(+20, SEEK_CUR);
+
+			// Skip to correct music header
+			skip = (soundID - 4001) * 25;
+			musicFile.seek(+skip, SEEK_CUR);
+
+			// Skip to offsets
+			musicFile.seek(+21, SEEK_CUR);
+		}
 
-		// Skip to offsets
-		musicFile.seek(+21, SEEK_CUR);
 
 		music_offs = musicFile.readUint32LE();
 		size = musicFile.readUint32LE();





More information about the Scummvm-git-logs mailing list