[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.129,2.130 script_v6.cpp,1.288,1.289 script_v6he.cpp,2.2,2.3

Travis Howell kirben at users.sourceforge.net
Fri Feb 6 19:13:14 CET 2004


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

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

Clean up last commit.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.129
retrieving revision 2.130
diff -u -d -r2.129 -r2.130
--- intern.h	7 Feb 2004 02:23:24 -0000	2.129
+++ intern.h	7 Feb 2004 02:52:27 -0000	2.130
@@ -326,8 +326,6 @@
 	
 	const OpcodeEntryV6 *_opcodesV6;
 
-	File _hFileTable[17];
-	
 public:
 	ScummEngine_v6(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs) {
 		VAR_VIDEONAME = 0xFF;
@@ -364,9 +362,6 @@
 	void writeArray(int array, int index, int base, int value);
 
 	void shuffleArray(int num, int minIdx, int maxIdx);
-	void unknownEA_func(int a, int b, int c, int d, int e);
-	int readFileToArray(int slot, int32 size);
-	void writeFileFromArray(int slot, int resID);
 
 	/* Version 6 script opcodes */
 	void o6_setBlastObjectWindow();
@@ -522,23 +517,12 @@
 	void o6_bor();
 	void o6_band();
 	void o6_stopTalking();
-	void o6_openFile();
-	void o6_closeFile();
-	void o6_deleteFile();
-	void o6_readFile();
-	void o6_rename();
-	void o6_writeFile();
 	void o6_findAllObjects();
 	void o6_pickVarRandom();
 	void o6_getDateTime();
-	void o6_unknownE0();
 	void o6_unknownE1();
 	void o6_unknownE4();
-	void o6_localizeArray();
 	void o6_shuffle();
-	void o6_unknownFA();
-	void o6_unknownEA();
-	void o6_readINI();
 
 	byte VAR_VIDEONAME;
 	byte VAR_RANDOM_NR;
@@ -582,6 +566,8 @@
 	/* Version 6 script opcodes */
 	void o6_drawBlastObject();
 	void o6_setBlastObjectWindow();
+	void o6_setState();
+	void o6_startSound();
 	void o6_roomOps();
 	void o6_actorOps();
 	void o6_verbOps();

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.288
retrieving revision 1.289
diff -u -d -r1.288 -r1.289
--- script_v6.cpp	6 Feb 2004 21:05:57 -0000	1.288
+++ script_v6.cpp	7 Feb 2004 02:52:27 -0000	1.289
@@ -320,18 +320,18 @@
 		OPCODE(o6_bor),
 		/* D8 */
 		OPCODE(o6_isRoomScriptRunning),
-		OPCODE(o6_closeFile),
-		OPCODE(o6_openFile),
-		OPCODE(o6_readFile),
+		OPCODE(o6_invalid),
+		OPCODE(o6_invalid),
+		OPCODE(o6_invalid),
 		/* DC */
-		OPCODE(o6_writeFile),
+		OPCODE(o6_invalid),
 		OPCODE(o6_findAllObjects),
-		OPCODE(o6_deleteFile),
-		OPCODE(o6_rename),
+		OPCODE(o6_invalid),
+		OPCODE(o6_invalid),
 		/* E0 */
-		OPCODE(o6_unknownE0),
+		OPCODE(o6_invalid),
 		OPCODE(o6_unknownE1),
-		OPCODE(o6_localizeArray),
+		OPCODE(o6_invalid),
 		OPCODE(o6_pickVarRandom),
 		/* E4 */
 		OPCODE(o6_unknownE4),
@@ -341,7 +341,7 @@
 		/* E8 */
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
-		OPCODE(o6_unknownEA),
+		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
 		/* EC */
 		OPCODE(o6_getActorLayer),
@@ -352,7 +352,7 @@
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
-		OPCODE(o6_readINI),
+		OPCODE(o6_invalid),
 		/* F4 */
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
@@ -361,7 +361,7 @@
 		/* F8 */
 		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
-		OPCODE(o6_unknownFA),
+		OPCODE(o6_invalid),
 		OPCODE(o6_invalid),
 		/* FC */
 		OPCODE(o6_invalid),
@@ -1011,12 +1011,6 @@
 	int state = pop();
 	int obj = pop();
 
-	if ((_features & GF_HUMONGOUS) && (state & 0x8000)) {
-		state = state & 0x7F00;
-		putState(obj, state);
-		return;
-	}
-
 	putState(obj, state);
 	markObjectRectAsDirty(obj);
 	if (_BgNeedsRedraw)
@@ -1064,9 +1058,6 @@
 }
 
 void ScummEngine_v6::o6_startSound() {
-	if ((_features & GF_HUMONGOUS) && (_gameId != GID_PUTTDEMO))
-		pop(); // offset which seems to always be zero
-
 	if (_features & GF_DIGI_IMUSE)
 		_imuseDigital->startSfx(pop());
 	else
@@ -1838,10 +1829,7 @@
 		j = pop();
 		i = pop();
 		checkRange(255, 0, i, "Illegal palette slot %d");
-		if ((_features & GF_HUMONGOUS) && (_gameId != GID_PUTTDEMO))
-			a->remapActorPaletteColor(i, j);
-		else
-			a->setPalette(i, j);
+		a->setPalette(i, j);
 		break;
 	case 87:		// SO_TALK_COLOR
 		a->talkColor = pop();
@@ -1987,8 +1975,6 @@
 		if (_curVerbSlot) {
 			setVerbObject(_roomResource, a, slot);
 			vs->type = kImageVerbType;
-			if (_features & GF_HUMONGOUS)
-				vs->imgindex = a;
 		}
 		break;
 	case 125:		// SO_VERB_NAME
@@ -2013,8 +1999,6 @@
 		vs->curmode = 0;
 		break;
 	case 131:		// SO_VERB_DELETE
-		if (_features & GF_HUMONGOUS)
-			slot = getVerbSlot(pop(), 0);
 		killVerb(slot);
 		break;
 	case 132:		// SO_VERB_NEW
@@ -2446,8 +2430,6 @@
 
 void ScummEngine_v6::o6_dummy() {
 	/* nothing */
-	if (_features & GF_HUMONGOUS)
-		stopObjectCode();
 }
 
 void ScummEngine_v6::o6_dim2dimArray() {
@@ -2986,28 +2968,9 @@
 	int object, x, y, state;
 	
 	// dummy opcode in tentacle
-	if (_gameId == GID_TENTACLE)
+	if (_version == 6)
 		return;
 
-	// V6 version
-	if (_version == 6) {
-		state = pop();
-		if (state == 0) {
-			state = 1;
-		}
-		y = pop();
-		x = pop();
-		object = pop();
-		int objnum = getObjectIndex(object);
-		if (objnum == -1)
-			return;
-		_objs[objnum].x_pos = x * 8;
-		_objs[objnum].y_pos = y * 8;
-		putState(object, state);
-		drawObject(objnum, 0);
-		return;	
-	}
-
 	// V7 version
 	state = pop();
 	y = pop();
@@ -3043,153 +3006,6 @@
 	stopTalk();
 }
 
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_openFile() {
-	int mode, len, slot, l, r;
-	byte filename[100];
-
-	_msgPtrToAdd = filename;
-	_messagePtr = _scriptPointer;
-	addMessageToStack(_messagePtr);
-
-	len = resStrLen(_scriptPointer);
-	_scriptPointer += len + 1;
-	
-	for (r = strlen((char*)filename); r != 0; r--) {
-		if (filename[r - 1] == '\\')
-			break;
-	}
-	
-	mode = pop();
-	slot = -1;
-	for (l = 0; l < 17; l++) {
-		if (_hFileTable[l].isOpen() == false) {
-			slot = l;
-			break;
-		}
-	}
-
-	if (slot != -1) {
-		if (mode == 1)
-			_hFileTable[slot].open((char*)filename + r, getGameDataPath(), File::kFileReadMode);
-		else if (mode == 2)
-			_hFileTable[slot].open((char*)filename + r, getGameDataPath(), File::kFileWriteMode);
-		else
-			error("o6_openFile(): wrong open file mode");
-
-		warning("%d = o6_openFile(\"%s\", %d)", slot, filename + r, mode);
-	}
-	push(slot);
-}
-
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_closeFile() {
-	int slot = pop();
-	_hFileTable[slot].close();
-	warning("o6_closeFile(%d)", slot);
-}
-
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_deleteFile() {
-	int len, r;
-	byte filename[100];
-
-	_msgPtrToAdd = filename;
-	_messagePtr = _scriptPointer;
-	addMessageToStack(_messagePtr);
-
-	len = resStrLen(_scriptPointer);
-	_scriptPointer += len + 1;
-
-	for (r = strlen((char*)filename); r != 0; r--) {
-		if (filename[r - 1] == '\\')
-			break;
-	}
-
-	warning("stub o6_deleteFile(\"%s\")", filename + r);
-}
-
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_rename() {
-	int len, r1, r2;
-	byte filename[100],filename2[100];
-
-	_msgPtrToAdd = filename;
-	_messagePtr = _scriptPointer;
-	addMessageToStack(_messagePtr);
-
-	len = resStrLen(_scriptPointer);
-	_scriptPointer += len + 1;
-
-	for (r1 = strlen((char*)filename); r1 != 0; r1--) {
-		if (filename[r1 - 1] == '\\')
-			break;
-	}
-
-	_msgPtrToAdd = filename2;
-	_messagePtr = _scriptPointer;
-	addMessageToStack(_messagePtr);
-
-	len = resStrLen(_scriptPointer);
-	_scriptPointer += len + 1;
-
-	for (r2 = strlen((char*)filename2); r2 != 0; r2--) {
-		if (filename2[r2 - 1] == '\\')
-			break;
-	}
-
-	warning("stub o6_rename(\"%s\" to \"%s\")", filename + r1, filename2 + r2);
-}
-
-int ScummEngine_v6::readFileToArray(int slot, int32 size) {
-	if (size == 0)
-		size = _hFileTable[slot].size() - _hFileTable[slot].pos();
-	writeVar(0, 0);
-	defineArray(0, 3, 0, size);
-	byte *ptr = getResourceAddress(rtString, readVar(0));
-	_hFileTable[slot].read(ptr, size);
-	return readVar(0);
-}
-
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_readFile() {
-	int32 size = pop();
-	int slot = pop();
-
-	if (size == -2) {
-		push(_hFileTable[slot].readUint16LE());
-	} else if (size == -1) {
-		push(_hFileTable[slot].readByte());
-	} else {
-		push(readFileToArray(slot, size));
-	}
-	warning("o6_readFile(%d, %d)", slot, size);
-}
-
-void ScummEngine_v6::writeFileFromArray(int slot, int resID) {
-	byte *ptr = getResourceAddress(rtString, resID);
-	// FIXME: hack for proper size: / 2 - 5
-	int32 size = getResourceSize(rtString, resID) / 2 - 5;
-	_hFileTable[slot].write(ptr, size);
-}
-
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_writeFile() {
-	int32 size = pop();
-	int16 resID = pop();
-	int slot = pop();
-
-	if (size == -2) {
-		_hFileTable[slot].writeUint16LE(resID);
-	} else if (size == -1) {
-		_hFileTable[slot].writeByte(resID);
-	} else {
-		writeFileFromArray(slot, resID);
-	}
-	warning("o6_writeFile(%d, %d)", slot, resID);
-}
-
-// Humongous Entertainment games only
 void ScummEngine_v6::o6_findAllObjects() {
 	int a = pop();
 	int i = 1;
@@ -3326,87 +3142,10 @@
 	push(area);
 }
 
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_unknownE0() {
-	int a = fetchScriptByte();
-	a -= 222;
-	if (a != 0) {
-		a -= 2;
-		if (a != 0) 
-			return;
-		warning("o6_unknownE0(%d) stub", pop());
-	} else {
-		warning("o6_uknownE0, sound volume %d stub", pop());
-	}
-}
-
-// Humongous Entertainment games only
 void ScummEngine_v6::o6_unknownE4() {
 	warning("o6_unknownE4(%d) stub", pop());
 }
 
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_unknownFA() {
-	int len, a = fetchScriptByte();
-	
-	len = resStrLen(_scriptPointer);
-	warning("stub o6_unknownFA(%d, \"%s\")", a, _scriptPointer);
-	_scriptPointer += len + 1;
-}
-
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_unknownEA() {
-	int edi, esi, eax;
-	edi = pop();
-	esi = pop();
-
-	if (edi ==  0) {
-		eax = esi;
-		esi = edi;
-		edi = eax;
-	}
-
-	eax = fetchScriptByte();
-	switch (eax) {
-	case 199:
-		unknownEA_func(5, esi, edi, fetchScriptWord(), eax);
-		break;
-	case 202:
-		unknownEA_func(3, esi, edi, fetchScriptWord(), eax);
-		break;
-	default:
-		break;
-	}
-}
-
-void ScummEngine_v6::unknownEA_func(int a, int b, int c, int d, int e) {
-	// Used in mini game at Cosmic Dust Diner in puttmoon
-	warning("unknownEA_func(%d, %d, %d, %d, %d) stub", a, b, c, d, e);
-}
-
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_readINI() {
-	int len;
-
-	len = resStrLen(_scriptPointer);
-	warning("stub o6_readINI(\"%s\")", _scriptPointer);
-	_scriptPointer += len + 1;
-	pop();
-	push(0);
-	
-}
-
-// Humongous Entertainment games only
-void ScummEngine_v6::o6_localizeArray() {
-	int stringID = pop();
-
-	if (stringID < _numArray) {
-		_baseArrays[stringID][0] = (byte)_currentScript;
-	} else {
-		warning("o6_localizeArray(%d): too big scriptID", stringID);
-	}
-}
-
 void ScummEngine_v6::decodeParseString(int m, int n) {
 	byte b;
 

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -d -r2.2 -r2.3
--- script_v6he.cpp	7 Feb 2004 02:28:24 -0000	2.2
+++ script_v6he.cpp	7 Feb 2004 02:52:27 -0000	2.3
@@ -382,6 +382,29 @@
 	return _opcodesV6he[i].desc;
 }
 
+void ScummEngine_v6he::o6_setState() {
+	int state = pop();
+	int obj = pop();
+
+	if (state & 0x8000) {
+		state = state & 0x7F00;
+		putState(obj, state);
+		return;
+	}
+
+	putState(obj, state);
+	markObjectRectAsDirty(obj);
+	if (_BgNeedsRedraw)
+		clearDrawObjectQueue();
+}
+
+void ScummEngine_v6he::o6_startSound() {
+	if (_gameId != GID_PUTTDEMO)
+		pop(); // offset which seems to always be zero
+
+	_sound->addSoundToQueue(pop());
+}
+
 void ScummEngine_v6he::o6_roomOps() {
 	int a, b, c, d, e;
 	byte op;
@@ -437,8 +460,6 @@
 		_saveTemporaryState = true;
 		_saveLoadSlot = pop();
 		_saveLoadFlag = pop();
-		if (_gameId == GID_TENTACLE)
-			_saveSound = (_saveLoadSlot != 0);
 		break;
 
 	case 181:		// SO_ROOM_FADE
@@ -494,17 +515,7 @@
 
 	case 213:		// SO_ROOM_NEW_PALETTE
 		a = pop();
-
-		// This opcode is used when turning off noir mode in Sam & Max,
-		// but since our implementation of this feature doesn't change
-		// the original palette there's no need to reload it. Doing it
-		// this way, we avoid some graphics glitches that the original
-		// interpreter had.
-
-		if (_gameId == GID_SAMNMAX && vm.slot[_currentScript].number == 64)
-			setDirtyColors(0, 255);
-		else
-			setPalette(a);
+		setPalette(a);
 		break;
 	case 220:
 		a = pop();
@@ -617,19 +628,13 @@
 		break;
 	case 95:		// SO_IGNORE_BOXES
 		a->ignoreBoxes = 1;
-		if (_version >= 7)
-			a->forceClip = 100;
-		else
-			a->forceClip = 0;
+		a->forceClip = 0;
 		if (a->isInCurrentRoom())
 			a->putActor(a->_pos.x, a->_pos.y, a->room);
 		break;
 	case 96:		// SO_FOLLOW_BOXES
 		a->ignoreBoxes = 0;
-		if (_version >= 7)
-			a->forceClip = 100;
-		else
-			a->forceClip = 0;
+		a->forceClip = 0;
 		if (a->isInCurrentRoom())
 			a->putActor(a->_pos.x, a->_pos.y, a->room);
 		break;
@@ -811,7 +816,7 @@
 		offs = fetchScriptWordSigned();
 		actnum = pop();
 		a = derefActor(actnum, "o6_wait:168");
-		if (a->isInCurrentRoom() && a->moving)
+		if (a->moving)
 			break;
 		return;
 	case 169:		// SO_WAIT_FOR_MESSAGE Wait for message
@@ -819,14 +824,8 @@
 			break;
 		return;
 	case 170:		// SO_WAIT_FOR_CAMERA Wait for camera
-		if (_version >= 7) {
-			if (camera._dest != camera._cur)
-				break;
-		} else {
-			if (camera._cur.x / 8 != camera._dest.x / 8)
-				break;
-		}
-
+		if (camera._cur.x / 8 != camera._dest.x / 8)
+			break;
 		return;
 	case 171:		// SO_WAIT_FOR_SENTENCE
 		if (_sentenceNum) {





More information about the Scummvm-git-logs mailing list