[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.254,2.255 resource.cpp,1.269,1.270 script.cpp,1.194,1.195 script_v72he.cpp,2.100,2.101 script_v80he.cpp,2.27,2.28 script_v90he.cpp,2.36,2.37 scumm.cpp,1.206,1.207 scumm.h,1.480,1.481

Travis Howell kirben at users.sourceforge.net
Thu Sep 16 22:44:01 CEST 2004


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

Modified Files:
	intern.h resource.cpp script.cpp script_v72he.cpp 
	script_v80he.cpp script_v90he.cpp scumm.cpp scumm.h 
Log Message:

nukeArrays still nuking wrong arrays.
Add some more differences in later HE versions.
Add HE opcodes changes.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.254
retrieving revision 2.255
diff -u -d -r2.254 -r2.255
--- intern.h	16 Sep 2004 12:30:52 -0000	2.254
+++ intern.h	17 Sep 2004 05:43:36 -0000	2.255
@@ -795,6 +795,7 @@
 	
 	/* HE version 80 script opcodes */
 	void o80_unknown45();
+	void o80_unknown48();
 	void o80_unknown49();
 	void o80_unknown4A();
 	void o80_readConfigFile();

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.269
retrieving revision 1.270
diff -u -d -r1.269 -r1.270
--- resource.cpp	16 Sep 2004 09:20:49 -0000	1.269
+++ resource.cpp	17 Sep 2004 05:43:37 -0000	1.270
@@ -2309,7 +2309,7 @@
 		_numGlobalObjects = _fileHandle.readUint16LE();
 		_numImages = _fileHandle.readUint16LE();
 		_numSprites = _fileHandle.readUint16LE();
-		_numLocalScriptOffsets = _fileHandle.readUint16LE();
+		_numLocalScripts = _fileHandle.readUint16LE();
 		_fileHandle.readUint16LE(); // heap related
 		_fileHandle.readUint16LE(); // _numPalettes?
 		_fileHandle.readUint16LE(); // _numSmacker?
@@ -2338,13 +2338,16 @@
 		_numGlobalObjects = _fileHandle.readUint16LE();
 		_numImages = _fileHandle.readUint16LE();
 		_numSprites = _fileHandle.readUint16LE();
-		_numLocalScriptOffsets = _fileHandle.readUint16LE();
+		_numLocalScripts = _fileHandle.readUint16LE();
 		_fileHandle.readUint16LE(); // heap releated
 		_numNewNames = 10;
 
 		_objectRoomTable = (byte *)calloc(_numGlobalObjects, 1);
 		_numRoomVariables = 64;
-		_numGlobalScripts = 200;
+		if (_gameId == GID_FREDDI4)
+			_numGlobalScripts = 2048;
+		else
+			_numGlobalScripts = 200;
 
 	} else if (_heversion >= 70 && blockSize > 38) { // sputm7.2
 		if (blockSize != 32 + 8)

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -d -r1.194 -r1.195
--- script.cpp	13 Sep 2004 02:29:45 -0000	1.194
+++ script.cpp	17 Sep 2004 05:43:37 -0000	1.195
@@ -354,8 +354,8 @@
 	if (_heversion < 60 || !script)
 		return;
 
-	//FIXME Nukes wrong arrays in fbear
-	if (_gameId == GID_FBEAR)
+	//FIXME Nukes wrong arrays in other
+	if (_gameId != GID_PUTTMOON)
 		return;
 
 	for (i = 1; i < _numArray; i++) {

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.100
retrieving revision 2.101
diff -u -d -r2.100 -r2.101
--- script_v72he.cpp	16 Sep 2004 23:34:26 -0000	2.100
+++ script_v72he.cpp	17 Sep 2004 05:43:37 -0000	2.101
@@ -770,9 +770,12 @@
 }
 
 void ScummEngine_v72he::o72_unknown5A() {
-	int value = pop();
-	push(4);
-	debug(1,"o72_unknown5A stub (%d)", value);
+	// Seems to get length of sound already played
+	int snd = pop();
+	int r = _mixer->getChannelElapsedTime(_sound->_musicChannelHandle);
+
+	push(r * 10);
+	debug(1,"o72_unknown5A stub (%d)", snd);
 }
 
 void ScummEngine_v72he::o72_wordArrayDec() {

Index: script_v80he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v80he.cpp,v
retrieving revision 2.27
retrieving revision 2.28
diff -u -d -r2.27 -r2.28
--- script_v80he.cpp	16 Sep 2004 23:34:26 -0000	2.27
+++ script_v80he.cpp	17 Sep 2004 05:43:37 -0000	2.28
@@ -135,7 +135,7 @@
 		OPCODE(o6_invalid),
 		OPCODE(o72_wordArrayWrite),
 		/* 48 */
-		OPCODE(o6_invalid),
+		OPCODE(o80_unknown48),
 		OPCODE(o80_unknown49),
 		OPCODE(o80_unknown4A),
 		OPCODE(o72_wordArrayIndexedWrite),
@@ -401,6 +401,23 @@
 	debug(1,"o80_unknown45 stub (%d)",subOp);
 }
 
+void ScummEngine_v80he::o80_unknown48() {
+	int id, len, val;
+	byte *addr;
+	char string[100];
+
+	id = pop();
+
+	addr = getStringAddress(id);
+	if (!addr)
+		error("o80_unknown48: Reference to zeroed array pointer (%d)", id);
+
+	len = resStrLen(getStringAddress(id)) + 1;
+	memcpy(string, addr, len);
+	val = atoi(string);
+	push(val);
+}
+
 void ScummEngine_v80he::o80_unknown49() {
 	// Sound related
 	int result = 0;

Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.36
retrieving revision 2.37
diff -u -d -r2.36 -r2.37
--- script_v90he.cpp	16 Sep 2004 23:34:26 -0000	2.36
+++ script_v90he.cpp	17 Sep 2004 05:43:37 -0000	2.37
@@ -135,7 +135,7 @@
 		OPCODE(o6_invalid),
 		OPCODE(o72_wordArrayWrite),
 		/* 48 */
-		OPCODE(o6_invalid),
+		OPCODE(o80_unknown48),
 		OPCODE(o80_unknown49),
 		OPCODE(o80_unknown4A),
 		OPCODE(o72_wordArrayIndexedWrite),
@@ -534,12 +534,17 @@
 			pop();
 			break;
 		case 15:
-			if (_heversion >= 99) {
+			if (_heversion == 99) {
 				getStackList(args, ARRAYSIZE(args));
 				pop();
 				pop();
 				pop();
 				pop();
+			} else if (_heversion == 98) {
+				pop();
+				pop();
+				pop();
+				pop();
 			} else {
 				pop();
 				pop();
@@ -621,7 +626,7 @@
 			break;
 		case 23:
 			pop();
-			if (_heversion >= 99)
+			if (_gameId == GID_FREDDI4 || _heversion >= 99)
 				pop();
 			break;
 		case 29:
@@ -883,8 +888,6 @@
 	}
 
 	defineArray(fetchScriptWord(), data, dim2start, dim2end, dim1start, dim1end);
-
-	debug(1,"o90_unknown37 stub");
 }
 
 void ScummEngine_v90he::o90_unknown3A() {

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -d -r1.206 -r1.207
--- scumm.cpp	17 Sep 2004 02:59:37 -0000	1.206
+++ scumm.cpp	17 Sep 2004 05:43:37 -0000	1.207
@@ -311,6 +311,8 @@
 	// Humongous Entertainment Scumm Version 9.8 ?  Scummsys.98
 	// these and later games can easily be identified by the .(a) file instead of a .he1
 	// and INIB chunk in the .he0
+	{"smaller", "Pajama Sam's Lost & Found (Test)", GID_HEGAME, 6, 98, MDT_NONE,
+	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
 	{"lost", "Pajama Sam's Lost & Found", GID_HEGAME, 6, 98, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
 	{"racedemo", "Putt-Putt Enters the Race (Demo)", GID_HEGAME, 6, 98, MDT_NONE,
@@ -320,14 +322,14 @@
 	{"BluesABCTimeDemo", "Blue's ABC Time (Demo)", GID_HEGAME, 6, 98, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
 
-	// Engine moved to c++ 
-	// Humongous Entertainment Scumm Version 9.9 ?  Scummsys.99
-	{"smaller", "Pajama Sam's Lost & Found (Test)", GID_HEGAME, 6, 99, MDT_NONE,
-	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
-	{"freddi4", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch", GID_HEGAME, 6, 99, MDT_NONE,
+	// Global scripts increased to 2048
+	{"freddi4", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch", GID_FREDDI4, 6, 98, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
-	{"f4-demo", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch (Demo)", GID_HEGAME, 6, 99, MDT_NONE,
+	{"f4-demo", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch (Demo)", GID_FREDDI4, 6, 98, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
+
+	// Engine moved to c++ 
+	// Humongous Entertainment Scumm Version 9.9 ?  Scummsys.99
 	{"circdemo", "Putt-Putt Joins the Circus (Demo)", GID_HEGAME, 6, 99, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
 	{"sf2-demo", "Spyfox 2: Some Assembly Required (Demo)", GID_HEGAME, 6, 99, MDT_NONE,
@@ -401,7 +403,7 @@
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
 	{"df047cc4792150f601290357566d36a6", "Freddi Fish 1: The Case of the Missing Kelp Seeds *updated)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
-	{"92e7727e67f5cd979d8a1070e4eb8cb3", "Putt-Putt Saves the Zoo *updated)", GID_HEGAME, 6, 99, MDT_NONE,
+	{"92e7727e67f5cd979d8a1070e4eb8cb3", "Putt-Putt Saves the Zoo *updated)", GID_FREDDI4, 6, 98, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
 	{"0ab19be9e2a3f6938226638b2a3744fe", "Putt-Putt Travels Through Time (updated Demo)", GID_HEGAME, 6, 98, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0},
@@ -537,7 +539,7 @@
 	_numActors = 0;
 	_numCostumes = 0;
 	_numImages = 0;
-	_numLocalScriptOffsets = 0;
+	_numLocalScripts = 0;
 	_numSprites = 0;
 	_numTalkies = 0;
 	_audioNames = NULL;
@@ -2736,7 +2738,7 @@
 
 			id = READ_LE_UINT32(ptr);
 
-			checkRange(NUM_LOCALSCRIPT + _numGlobalScripts, _numGlobalScripts, id, "Invalid local script %d");
+			checkRange(_numLocalScripts + _numGlobalScripts, _numGlobalScripts, id, "Invalid local script %d");
 			_localScriptList[id - _numGlobalScripts] = ptr + 4 - roomResPtr;
 
 			if (_dumpScripts) {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.480
retrieving revision 1.481
diff -u -d -r1.480 -r1.481
--- scumm.h	14 Sep 2004 15:06:01 -0000	1.480
+++ scumm.h	17 Sep 2004 05:43:37 -0000	1.481
@@ -257,7 +257,8 @@
 	GID_PUTTDEMO,
 	GID_PUTTMOON,
 	GID_FBEAR,
-	GID_FUNPACK
+	GID_FUNPACK,
+	GID_FREDDI4
 };
 
 #define _baseRooms res.address[rtRoom]
@@ -490,9 +491,9 @@
 	int _numInventory;
 	int _numNewNames, _numGlobalScripts;
 	int _numActors, _numRoomVariables;
-	int _numLocalScriptOffsets, _numSprites, _numTalkies;
+	int _numSprites, _numTalkies;
 public:
-	int _numImages, _numRooms, _numScripts, _numSounds;	// Used by VARS in HE games
+	int _numLocalScripts, _numImages, _numRooms, _numScripts, _numSounds;	// Used by HE games
 	int _numCostumes;	// FIXME - should be protected, used by Actor::remapActorPalette
 	int _numCharsets;	// FIXME - should be protected, used by CharsetRenderer
 





More information about the Scummvm-git-logs mailing list