[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.163,2.164 resource.cpp,1.208,1.209 script_v6.cpp,1.331,1.332 script_v6he.cpp,2.56,2.57 script_v7he.cpp,2.14,2.15 scumm.cpp,1.37,1.38 verbs.cpp,1.95,1.96

Eugene Sandulenko sev at users.sourceforge.net
Sat Jun 5 19:22:00 CEST 2004


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

Modified Files:
	intern.h resource.cpp script_v6.cpp script_v6he.cpp 
	script_v7he.cpp scumm.cpp verbs.cpp 
Log Message:
o more _heversion usage
o hack to ensure 1x scaler is selected for 640x480 games. Begs for better
  implementation
o 7.0+-specific extendions to
  * resource loading
  * o6_resourceRoutines
  * o6_actorOps
  * o7_pickupObject
  * ScummEngine::setVerbObject

Now puttputt.w32 script execution advances little more.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.163
retrieving revision 2.164
diff -u -d -r2.163 -r2.164
--- intern.h	5 Jun 2004 00:54:48 -0000	2.163
+++ intern.h	6 Jun 2004 02:20:52 -0000	2.164
@@ -637,6 +637,7 @@
 	void o7_unknownFA();
 	void o7_unknownFB();
 	void o7_quitPauseRestart();
+	void o7_pickupObject();
 };
 
 class ScummEngine_v7 : public ScummEngine_v6 {

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -d -r1.208 -r1.209
--- resource.cpp	5 Jun 2004 15:14:19 -0000	1.208
+++ resource.cpp	6 Jun 2004 02:20:53 -0000	1.209
@@ -80,7 +80,7 @@
 		}
 		if (!(_features & GF_SMALL_HEADER)) {
 
-			if ((_features & GF_HUMONGOUS) && (_features & GF_WINDOWS)) {
+			if (_heversion >= 70) { // Windows titles
 				sprintf(buf, "%s.he%.1d", _gameName.c_str(), room == 0 ? 0 : 1);
 			} else if (_version >= 7) {
 				if (room > 0 && (_version == 8))
@@ -185,7 +185,7 @@
 	if (_features & GF_SMALL_NAMES)
 		return;
 
-	if ((_features & GF_HUMONGOUS) && (_features & GF_WINDOWS)) {
+	if (_heversion >= 70) { // Windows titles
 		num = READ_LE_UINT16(_HEV7RoomOffsets);
 		ptr = _HEV7RoomOffsets + 2;
 		for (i = 0; i < num; i++) {
@@ -350,17 +350,16 @@
 				_fileHandle.read(_objectStateTable, num);
 				_fileHandle.read(_objectRoomTable, num);
 				memset(_objectOwnerTable, 0xFF, num);
+			} else if (_heversion >= 70) { // Windows titles
+				_fileHandle.read(_objectStateTable, num);
+				_fileHandle.read(_objectOwnerTable, num);
+				_fileHandle.read(_objectRoomTable, num);
 			} else {
 				_fileHandle.read(_objectOwnerTable, num);
 				for (i = 0; i < num; i++) {
 					_objectStateTable[i] = _objectOwnerTable[i] >> OF_STATE_SHL;
 					_objectOwnerTable[i] &= OF_OWNER_MASK;
 				}
-				if ((_features & GF_HUMONGOUS) && (_features & GF_WINDOWS)) {
-					// _objectRoomTable
-					_fileHandle.seek(num * 4, SEEK_CUR);
-					//_fileHandle.read(_objectRoomTable, num * 4);
-				}
 			}
 			
 			if (_version != 8) {
@@ -506,9 +505,10 @@
 		for (i = 0; i < num; i++) {
 			res.roomoffs[id][i] = _fileHandle.readUint32LE();
 		}
-		if ((_features & GF_HUMONGOUS) && (_features & GF_WINDOWS)) {
-			_fileHandle.seek(4 * num, SEEK_CUR); // FIXME what are these additional offsets
-		}
+		// FIXME: these are related to globs
+
+		//_fileHandle.read(_globSize, num);
+		_fileHandle.seek(4 * num, SEEK_CUR);
 	}
 }
 
@@ -2057,7 +2057,7 @@
 			_numGlobalScripts = 2000;
 
 		_shadowPaletteSize = NUM_SHADOW_PALETTE * 256;
-	} else if (_heversion >= 72) {
+	} else if (_heversion >= 72) { // sputm7.2
 		_fileHandle.readUint16LE();
 		_numVariables = _fileHandle.readUint16LE();
 		_numBitVariables = _fileHandle.readUint16LE();
@@ -2073,13 +2073,16 @@
 		_numCharsets = _fileHandle.readUint16LE();
 		_numCostumes = _fileHandle.readUint16LE();
 		_numGlobalObjects = _fileHandle.readUint16LE();
-		_fileHandle.readUint16LE(); 
+		_fileHandle.readUint16LE();
+
+		_objectRoomTable = (byte *)calloc(_numGlobalObjects, 1);
 
 		// FIXME: Is this correct??? A V6+ game which doesn't use object name
 		// resources seems odd...
 		_numNewNames = 0;
 
 		_objectRoomTable = (byte *)calloc(_numGlobalObjects * 4, 1);
+
 		_numGlobalScripts = 200;
 		_shadowPaletteSize = 256;
 	} else if (_version == 6) {
@@ -2104,6 +2107,10 @@
 		_numGlobalScripts = 200;
 
 		_shadowPaletteSize = 256;
+
+		if (_heversion >= 70) {
+			_objectRoomTable = (byte *)calloc(_numGlobalObjects, 1);
+		}
 	} else {
 		_numVariables = _fileHandle.readUint16LE();      // 800
 		_fileHandle.readUint16LE();                      // 16

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.331
retrieving revision 1.332
diff -u -d -r1.331 -r1.332
--- script_v6.cpp	2 Jun 2004 13:49:06 -0000	1.331
+++ script_v6.cpp	6 Jun 2004 02:20:53 -0000	1.332
@@ -394,6 +394,7 @@
 		obj = pop();
 	}
 
+
 	return obj;
 }
 
@@ -930,8 +931,9 @@
 	case 0x97:		// SO_USERPUT_SOFT_OFF
 		_userPut--;
 		break;
-	case 0x99:{		// SO_CURSOR_IMAGE Set cursor image
-			if ((_features & GF_HUMONGOUS) && (_features & GF_WINDOWS)) {
+	case 0x99: 		// SO_CURSOR_IMAGE Set cursor image
+		{
+			if (_heversion >= 70) { // Windows titles
 				warning("cursorCommand 0x99 PC_SetCursorToID(%d) stub", pop());
 				break;
 			}
@@ -1557,11 +1559,43 @@
 			loadFlObject(obj, room);
 			break;
 		}
-	case 120:{										/* queue ? for load */
-			 warning("stub queueload resource %d", pop());
-			 // QL_QueGlobForLoad(2, pop(), 1);
-			 break;
-		
+	case 120: 					/* queue ? for load */
+		{
+			if (_heversion < 70)
+				error("o6_resourceRoutines: default case %d", op);
+			
+			warning("stub queueload resource 2, %d", pop());
+			// QL_QueGlobForLoad(2, pop(), 1);
+			break;
+		}
+	case 121: 
+		{
+			if (_heversion < 70)
+				error("o6_resourceRoutines: default case %d", op);
+
+			warning("stub queueload resource 4, %d", pop());
+			// QL_QueGlobForLoad(4, pop(), 1);
+			break;
+		}
+	case 122: 
+		{
+			if (_heversion < 70)
+				error("o6_resourceRoutines: default case %d", op);
+
+			warning("stub queueload resource 3, %d", pop());
+			// QL_QueGlobForLoad(3, pop(), 1);
+			break;
+		}
+	case 123: 
+		{
+			if (_heversion < 70)
+				error("o6_resourceRoutines: default case %d", op);
+
+			resid = pop();
+			warning("stub queueload resource 18, %d", resid);
+			// QL_QueGlobForLoad(18, resid, 1);
+			// QL_QueGlobForLoad(1, resid, 1);
+			break;
 		}
 	default:
 		error("o6_resourceRoutines: default case %d", op);

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.56
retrieving revision 2.57
diff -u -d -r2.56 -r2.57
--- script_v6he.cpp	3 Jun 2004 01:28:21 -0000	2.56
+++ script_v6he.cpp	6 Jun 2004 02:20:53 -0000	2.57
@@ -560,6 +560,16 @@
 		return;
 
 	switch (b) {
+	case 30:
+		if (_heversion <= 70) {
+			error("o6_actorOps: default case %d", b);
+		}
+
+		k = pop();
+		j = pop();
+		i = pop();
+		warning("o6_actorOps: stub case %d", b);
+		break;
 	case 76:		// SO_COSTUME
 		a->setActorCostume(pop());
 		break;
@@ -630,7 +640,6 @@
 	case 93:		// SO_NEVER_ZCLIP
 		a->forceClip = 0;
 		break;
-	case 225:		// SO_ALWAYS_ZCLIP
 	case 94:		// SO_ALWAYS_ZCLIP
 		a->forceClip = pop();
 		break;
@@ -693,6 +702,23 @@
 			a->bottom = top_actor;
 		}
 		break;
+	case 219:
+		if (_heversion <= 70) {
+			error("o6_actorOps: default case %d", b);
+		}
+
+		a->forceClip = false;
+		a->needRedraw = true;
+		a->needBgReset = true;
+		break;
+	case 225:		// SO_ALWAYS_ZCLIP
+		if (_heversion < 70) {
+			a->forceClip = pop(); // FIXME: where does this come from?
+		} else {
+			i = pop(); // talkie slot
+			warning("o6_actorOps: stub case %d", b);
+		}
+		break;
 	default:
 		error("o6_actorOps: default case %d", b);
 	}
@@ -704,6 +730,7 @@
 	byte op;
 
 	op = fetchScriptByte();
+
 	if (op == 196) {
 		_curVerb = pop();
 		_curVerbSlot = getVerbSlot(_curVerb, 0);

Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.14
retrieving revision 2.15
diff -u -d -r2.14 -r2.15
--- script_v7he.cpp	5 Jun 2004 02:20:40 -0000	2.14
+++ script_v7he.cpp	6 Jun 2004 02:20:53 -0000	2.15
@@ -216,7 +216,7 @@
 		OPCODE(o6_animateActor),
 		OPCODE(o6_doSentence),
 		/* 84 */
-		OPCODE(o6_pickupObject),
+		OPCODE(o7_pickupObject),
 		OPCODE(o6_loadRoomWithEgo),
 		OPCODE(o6_invalid),
 		OPCODE(o6_getRandomNumber),
@@ -626,4 +626,22 @@
 	}
 }
 
+void ScummEngine_v7he::o7_pickupObject() {
+	int obj, room;
+
+	room = pop();
+	obj = pop();
+	if (room == 0)
+		room = getObjectRoom(obj);
+
+	addObjectToInventory(obj, room);
+	putOwner(obj, VAR(VAR_EGO));
+	putClass(obj, kObjectClassUntouchable, 1);
+	putState(obj, 1);
+	markObjectRectAsDirty(obj);
+	clearDrawObjectQueue();
+	runInventoryScript(obj);									/* Difference */
+}
+
+
 } // End of namespace Scumm

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- scumm.cpp	5 Jun 2004 15:14:19 -0000	1.37
+++ scumm.cpp	6 Jun 2004 02:20:53 -0000	1.38
@@ -674,6 +674,9 @@
 		_screenWidth = 320;
 		_screenHeight = 240;
 	} else if (_features & GF_DEFAULT_TO_1X_SCALER) {
+		// FIXME: a dirty hack. Currently this is checked before engine
+		//  creation.
+		_system->setGraphicsMode("1x");
 		_screenWidth = 640;
 		_screenHeight = 480;
 	} else if (_features & GF_NES) {

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- verbs.cpp	2 Apr 2004 21:51:56 -0000	1.95
+++ verbs.cpp	6 Jun 2004 02:20:53 -0000	1.96
@@ -527,6 +527,10 @@
 	FindObjectInRoom foir;
 	int i;
 
+	if (_heversion >= 70) { // Windows titles. Here we always ignore room
+		room = getObjectRoom(object);
+	}
+
 	if (whereIsObject(object) == WIO_FLOBJECT)
 		error("Can't grab verb image from flobject");
 





More information about the Scummvm-git-logs mailing list