[Scummvm-cvs-logs] SF.net SVN: scummvm: [29408] scummvm/trunk/engines/cruise

yazoo at users.sourceforge.net yazoo at users.sourceforge.net
Sun Nov 4 13:57:58 CET 2007


Revision: 29408
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29408&view=rev
Author:   yazoo
Date:     2007-11-04 04:57:57 -0800 (Sun, 04 Nov 2007)

Log Message:
-----------
Some more script functions

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/script.cpp
    scummvm/trunk/engines/cruise/script.h

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2007-11-04 10:45:10 UTC (rev 29407)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2007-11-04 12:57:57 UTC (rev 29408)
@@ -804,8 +804,7 @@
 }
 
 int buildInventorySub1(int overlayIdx, int objIdx) {
-	objDataStruct *pObjectData =
-	    getObjectDataFromOverlay(overlayIdx, objIdx);
+	objDataStruct *pObjectData = getObjectDataFromOverlay(overlayIdx, objIdx);
 
 	if (pObjectData) {
 		return pObjectData->type;

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2007-11-04 10:45:10 UTC (rev 29407)
+++ scummvm/trunk/engines/cruise/function.cpp	2007-11-04 12:57:57 UTC (rev 29408)
@@ -246,14 +246,21 @@
 }
 
 int16 Op_removeBackground(void) {
-	int backgroundIdx;
+	int backgroundIdx = popVar();
+	int ovl = popVar();
 
-	backgroundIdx = popVar();
-
 	printf("Op_removeBackground: remove background %d\n", backgroundIdx);
 	return (0);
 }
 
+int16 Op_UnmergeBackgroundIncrust(void) {
+	int backgroundIdx = popVar();
+	int ovl = popVar();
+
+	printf("Op_UnmergeBackgroundIncrust: unmerge background %d\n", backgroundIdx);
+	return (0);
+}
+
 int16 Op_freeMediumVar(void) {
 	// TODO: implement
 	printf("Op_freeMediumVar, implement\n");
@@ -944,14 +951,14 @@
 	return (param1 * param2) >> 8;
 }
 
-int16 Op_23(void) {
+int16 Op_GetStep(void) {
 	int si = popVar();
 	int dx = popVar();
 
 	return subOp23(dx, si);
 }
 
-int16 Op_22(void) {
+int16 Op_GetZoom(void) {
 	return (computeZoom(popVar()));
 }
 
@@ -1410,6 +1417,47 @@
 	return 0;
 }
 
+int16 Op_GetNodeX(void) {
+	int16 node = popVar();
+
+	int nodeInfo[2];
+
+	int result = getNode(nodeInfo, node);
+
+	ASSERT(result == 0);
+
+	return nodeInfo[0];
+}
+
+int16 Op_GetNodeY(void) {
+	int16 node = popVar();
+
+	int nodeInfo[2];
+
+	int result = getNode(nodeInfo, node);
+
+	ASSERT(result == 0);
+
+	return nodeInfo[1];
+}
+
+int16 Op_songExist(void) {
+	char* songName = (char*)popPtr();
+
+	printf("Unimplemented \"Op_songExist\": %s\n", songName);
+
+	return 0;
+}
+
+int16 Op_SetNodeColor(void) {
+	int16 color = popVar();
+	int16 node = popVar();
+
+	printf("Unimplemented \"Op_SetNodeColor\"\n");
+
+	return 0;
+}
+
 void setupOpcodeTable(void) {
 	int i;
 
@@ -1444,9 +1492,13 @@
 	opcodeTablePtr[0x19] = Op_RemoveAnimation;
 	opcodeTablePtr[0x1A] = Op_SetZoom;
 	opcodeTablePtr[0x1B] = Op_SetObjectAtNode;
+	opcodeTablePtr[0x1D] = Op_SetNodeColor;
 	opcodeTablePtr[0x1E] = Op_1E;
+	opcodeTablePtr[0x1F] = Op_GetNodeX;
+	opcodeTablePtr[0x20] = Op_GetNodeY;
 	opcodeTablePtr[0x21] = Op_21;
-	opcodeTablePtr[0x22] = Op_22;
+	opcodeTablePtr[0x22] = Op_GetZoom;
+	opcodeTablePtr[0x23] = Op_GetStep;
 	opcodeTablePtr[0x24] = Op_SetStringColors;
 	opcodeTablePtr[0x28] = Op_ChangeSaveAllowedState;
 	opcodeTablePtr[0x29] = Op_freeAllPerso;
@@ -1456,6 +1508,7 @@
 	opcodeTablePtr[0x2E] = Op_releaseOverlay;
 	opcodeTablePtr[0x2F] = Op_AddBackgroundIncrust;
 	opcodeTablePtr[0x30] = Op_RemoveBackgroundIncrust;
+	opcodeTablePtr[0x31] = Op_UnmergeBackgroundIncrust;
 	opcodeTablePtr[0x32] = Op_freeBackgroundInscrustList;
 	opcodeTablePtr[0x37] = Op_37;
 	opcodeTablePtr[0x38] = Op_removeBackground;
@@ -1468,6 +1521,7 @@
 	opcodeTablePtr[0x3F] = Op_3F;
 	opcodeTablePtr[0x40] = Op_40;
 	opcodeTablePtr[0x41] = Op_isFileLoaded2;
+	opcodeTablePtr[0x43] = Op_songExist;
 	opcodeTablePtr[0x45] = Op_45;
 	opcodeTablePtr[0x54] = Op_SetFontFileIndex;
 	opcodeTablePtr[0x56] = Op_changeCutSceneState;
@@ -1516,11 +1570,11 @@
 		return (-21);
 
 	if (opcodeTablePtr[opcode]) {
-		//printf("Function: %X\n",opcode);
+		printf("Function: %d\n",opcode);
 		pushVar(opcodeTablePtr[opcode] ());
 		return (0);
 	} else {
-		printf("Unsupported opcode %X in opcode type 8\n", opcode);
+		printf("Unsupported opcode %d in opcode type 8\n", opcode);
 		// exit(1);
 	}
 

Modified: scummvm/trunk/engines/cruise/script.cpp
===================================================================
--- scummvm/trunk/engines/cruise/script.cpp	2007-11-04 10:45:10 UTC (rev 29407)
+++ scummvm/trunk/engines/cruise/script.cpp	2007-11-04 12:57:57 UTC (rev 29408)
@@ -32,8 +32,8 @@
 
 scriptInstanceStruct *currentScriptPtr;
 
-uint8 getByteFromScript(void) {
-	uint8 var = currentData3DataPtr[currentScriptPtr->var4];
+int8 getByteFromScript(void) {
+	int8 var = *(int8*)(currentData3DataPtr+currentScriptPtr->var4);
 
 	currentScriptPtr->var4 = currentScriptPtr->var4 + 1;
 
@@ -727,7 +727,7 @@
 		}
 		opcodeType = getByteFromScript();
 
-		//printf("opType: %d\n",(opcodeType&0xFB)>>3);
+		printf("opType: %d\n",(opcodeType&0xFB)>>3);
 
 		currentScriptOpcodeType = opcodeType & 7;
 

Modified: scummvm/trunk/engines/cruise/script.h
===================================================================
--- scummvm/trunk/engines/cruise/script.h	2007-11-04 10:45:10 UTC (rev 29407)
+++ scummvm/trunk/engines/cruise/script.h	2007-11-04 12:57:57 UTC (rev 29408)
@@ -57,7 +57,7 @@
 extern scriptInstanceStruct *currentScriptPtr;
 
 void setupFuncArray(void);
-uint8 getByteFromScript(void);
+int8 getByteFromScript(void);
 
 int removeScript(int overlay, int idx, scriptInstanceStruct * headPtr);
 uint8 *attacheNewScriptToTail(scriptInstanceStruct *scriptHandlePtr, int16 overlayNumber, int16 param, int16 arg0, int16 arg1, int16 arg2, scriptTypeEnum scriptType);


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