[Scummvm-cvs-logs] SF.net SVN: scummvm: [29494] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Nov 13 16:49:21 CET 2007


Revision: 29494
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29494&view=rev
Author:   lordhoto
Date:     2007-11-13 07:49:21 -0800 (Tue, 13 Nov 2007)

Log Message:
-----------
- implemented opcodes:
  -> o2_setHiddenItemsEntry 147
  -> o2_getHiddenItemsEntry 148
  -> o2t_fadeScenePal 3
- added o2t_playSoundEffect to the temporary opcode list

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h
    scummvm/trunk/engines/kyra/script_v2.cpp

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2007-11-13 12:15:04 UTC (rev 29493)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2007-11-13 15:49:21 UTC (rev 29494)
@@ -274,6 +274,8 @@
 	clearAnimObjects();
 
 	// XXX
+	memset(_hiddenItems, -1, sizeof(_hiddenItems));
+	// XXX
 
 	_sceneList = new SceneDesc[86];
 	memset(_sceneList, 0, sizeof(SceneDesc)*86);
@@ -1846,10 +1848,10 @@
 		Opcode(o2_clearSpecialSceneScriptState),
 		Opcode(o2_querySpecialSceneScriptState),
 		OpcodeUnImpl(),
-		OpcodeUnImpl(),
+		Opcode(o2_setHiddenItemsEntry),
 		// 0x94
+		Opcode(o2_getHiddenItemsEntry),
 		OpcodeUnImpl(),
-		OpcodeUnImpl(),
 		Opcode(o2_wsaClose),
 		OpcodeUnImpl(),
 		// 0x98
@@ -1890,8 +1892,8 @@
 	static const OpcodeV2 opcodeTemporaryTable[] = {
 		Opcode(o2t_defineNewShapes),
 		Opcode(o2t_setCurrentFrame),
-		OpcodeUnImpl(),
-		OpcodeUnImpl(),
+		Opcode(o2t_playSoundEffect),
+		Opcode(o2t_fadeScenePal),
 		Opcode(o2t_setShapeFlag),
 		Opcode(o2_dummy)
 	};

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2007-11-13 12:15:04 UTC (rev 29493)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2007-11-13 15:49:21 UTC (rev 29494)
@@ -494,6 +494,8 @@
 	};
 	Item *_itemList;
 
+	uint16 _hiddenItems[20];
+
 	int findFreeItem();
 	int countAllItems();
 	int findItem(uint16 sceneId, uint16 id);
@@ -514,10 +516,6 @@
 	static const byte _itemStringMap[];
 	static const int _itemStringMapSize;
 
-	// Just used in French version
-	int getItemCommandStringDrop(uint16 item);
-	int getItemCommandStringPickUp(uint16 item);
-
 	void setMouseCursor(uint16 item);
 	void setHandItem(uint16 item);
 	void removeHandItem();
@@ -545,6 +543,11 @@
 
 	void changeFileExtension(char *buffer);
 
+	// - Just used in French version
+	int getItemCommandStringDrop(uint16 item);
+	int getItemCommandStringPickUp(uint16 item);
+	// -
+
 	char _internStringBuf[200];
 	static const char *_languageExtension[];
 	static const char *_scriptLangExt[];
@@ -777,6 +780,8 @@
 	int o2_setSpecialSceneScriptState(ScriptState *script);
 	int o2_clearSpecialSceneScriptState(ScriptState *script);
 	int o2_querySpecialSceneScriptState(ScriptState *script);
+	int o2_setHiddenItemsEntry(ScriptState *script);
+	int o2_getHiddenItemsEntry(ScriptState *script);
 	int o2_customChat(ScriptState *script);
 	int o2_customChatFinish(ScriptState *script);
 	int o2_setVocHigh(ScriptState *script);
@@ -793,6 +798,7 @@
 	int o2t_defineNewShapes(ScriptState *script);
 	int o2t_setCurrentFrame(ScriptState *script);
 	int o2t_playSoundEffect(ScriptState *script);
+	int o2t_fadeScenePal(ScriptState *script);
 	int o2t_setShapeFlag(ScriptState *script);
 
 	// script

Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp	2007-11-13 12:15:04 UTC (rev 29493)
+++ scummvm/trunk/engines/kyra/script_v2.cpp	2007-11-13 15:49:21 UTC (rev 29494)
@@ -658,17 +658,16 @@
 			++count;
 	}
 	
-	/*XXX
-	if (_unkTable3[0] == item && _newChapterFile == 1)
+	if (_hiddenItems[0] == item && _newChapterFile == 1)
 		++count;
-	if (_unkTable3[1] == item && _newChapterFile == 1)
+	if (_hiddenItems[1] == item && _newChapterFile == 1)
 		++count;
-	if (_unkTable3[2] == item && _newChapterFile == 2)
+	if (_hiddenItems[2] == item && _newChapterFile == 2)
 		++count;
-	if (_unkTable3[3] == item && _newChapterFile == 2)
+	if (_hiddenItems[3] == item && _newChapterFile == 2)
 		++count;
-	if (_unkTable3[4] == item && _newChapterFile == 1)
-		++count;*/
+	if (_hiddenItems[4] == item && _newChapterFile == 1)
+		++count;
 
 	return count;
 }
@@ -708,6 +707,18 @@
 	return _specialSceneScriptState[stackPos(0)];
 }
 
+int KyraEngine_v2::o2_setHiddenItemsEntry(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "o2_setHiddenItemsEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+	int item = stackPos(1);
+	_hiddenItems[stackPos(0)] = item;
+	return item;
+}
+
+int KyraEngine_v2::o2_getHiddenItemsEntry(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "o2_getHiddenItemsEntry(%p) (%d)", (const void *)script, stackPos(0));
+	return _hiddenItems[stackPos(0)];
+}
+
 int KyraEngine_v2::o2_customChat(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "o2_customChat(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2));
 	strcpy((char*)_unkBuf500Bytes, stackPosString(0));
@@ -802,6 +813,12 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2t_fadeScenePal(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "o2t_fadeScenePal(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+	fadeScenePal(stackPos(0), stackPos(1));
+	return 0;
+}
+
 int KyraEngine_v2::o2t_setShapeFlag(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "o2t_setShapeFlag(%p) (%d)", (const void *)script, stackPos(0));
 	_newShapeFlag = stackPos(0);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list