[Scummvm-cvs-logs] SF.net SVN: scummvm: [24294] scummvm/trunk/engines/agos

kirben at users.sourceforge.net kirben at users.sourceforge.net
Fri Oct 13 13:38:53 CEST 2006


Revision: 24294
          http://svn.sourceforge.net/scummvm/?rev=24294&view=rev
Author:   kirben
Date:     2006-10-13 04:38:41 -0700 (Fri, 13 Oct 2006)

Log Message:
-----------
Add differences in opcode table for Elvira 2 and cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/debug.cpp
    scummvm/trunk/engines/agos/debug.h
    scummvm/trunk/engines/agos/event.cpp
    scummvm/trunk/engines/agos/icons.cpp
    scummvm/trunk/engines/agos/items.cpp
    scummvm/trunk/engines/agos/rooms.cpp
    scummvm/trunk/engines/agos/subroutine.cpp

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/agos.cpp	2006-10-13 11:38:41 UTC (rev 24294)
@@ -711,6 +711,8 @@
 
 	_stringIdLocalMin = 1;
 
+	_superRoomNumber = 1;
+
 	for (int i = 0; i < 20; i++) {
 		if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
 			_videoWindows[i] = initialVideoWindows_Simon[i];

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/agos.h	2006-10-13 11:38:41 UTC (rev 24294)
@@ -1227,6 +1227,8 @@
 	bool vc_maybe_skip_proc_1(uint16 a, int16 b);
 
 	bool isVgaQueueEmpty();
+	void haltAnimation();
+	void restartAnimation();
 	void addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite, uint16 curZoneNum, int32 param = 0);
 	void deleteVgaEvent(VgaTimerEntry * vte);
 	void processVgaEvents();

Modified: scummvm/trunk/engines/agos/debug.cpp
===================================================================
--- scummvm/trunk/engines/agos/debug.cpp	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/debug.cpp	2006-10-13 11:38:41 UTC (rev 24294)
@@ -60,8 +60,10 @@
 		st = s = simon2dos_opcodeNameTable[opcode];
 	} else if (getGameType() == GType_SIMON1) {
 		st = s = simon1dos_opcodeNameTable[opcode];
-	} else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+	} else if (getGameType() == GType_WW) {
 		st = s = waxworks_opcodeNameTable[opcode];
+	} else if (getGameType() == GType_ELVIRA2) {
+		st = s = elvira2_opcodeNameTable[opcode];
 	} else {
 		st = s = elvira1_opcodeNameTable[opcode];
 	}

Modified: scummvm/trunk/engines/agos/debug.h
===================================================================
--- scummvm/trunk/engines/agos/debug.h	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/debug.h	2006-10-13 11:38:41 UTC (rev 24294)
@@ -384,6 +384,239 @@
 	"WJ|IS_BOX",
 };
 
+static const char *const elvira2_opcodeNameTable[256] = {
+	/* 0 */
+	"|NOT",
+	"IJ|AT",
+	"IJ|NOT_AT",
+	NULL,
+	/* 4 */
+	NULL,
+	"IJ|CARRIED",
+	"IJ|NOT_CARRIED",
+	"IIJ|IS_AT",
+	/* 8 */
+	"IIJ|IS_NOT_AT",
+	"IIJ|IS_SIBLING",
+	"IIJ|IS_NOT_SIBLING",
+	"VJ|IS_ZERO",
+	/* 12 */
+	"VJ|ISNOT_ZERO",
+	"VWJ|IS_EQ",
+	"VWJ|IS_NEQ",
+	"VWJ|IS_LE",
+	/* 16 */
+	"VWJ|IS_GE",
+	"VVJ|IS_EQF",
+	"VVJ|IS_NEQF",
+	"VVJ|IS_LEF",
+	/* 20 */
+	"VVJ|IS_GEF",
+	NULL,
+	NULL,
+	"WJ|CHANCE",
+	/* 24 */
+	"IJ|IS_PLAYER",
+	"IJ|IS_ROOM",
+	"IJ|IS_OBJECT",
+	"IWJ|ITEM_STATE_IS",
+	/* 28 */
+	"IBJ|OBJECT_HAS_FLAG",
+	"IIJ|CAN_PUT",
+	NULL,
+	"I|SET_NO_PARENT",
+	/* 32 */
+	NULL,
+	"II|SET_PARENT",
+	"IBV|COPY_OF",
+	"VIB|COPY_FO",
+	/* 36 */
+	"VV|MOVE",
+	"W|WHAT_O",
+	NULL,
+	NULL,
+	/* 40 */
+	NULL,
+	"V|ZERO",
+	"VW|SET",
+	"VW|ADD",
+	/* 44 */
+	"VW|SUB",
+	"VV|ADDF",
+	"VV|SUBF",
+	"VW|MUL",
+	/* 48 */
+	"VW|DIV",
+	"VV|MULF",
+	"VV|DIVF",
+	"VW|MOD",
+	/* 52 */
+	"VV|MODF",
+	"VW|RANDOM",
+	"B|MOVE_DIRN",
+	"I|SET_A_PARENT",
+	/* 56 */
+	"IB|SET_CHILD2_BIT",
+	"IB|CLEAR_CHILD2_BIT",
+	"II|MAKE_SIBLING",
+	"I|INC_STATE",
+	/* 60 */
+	"I|DEC_STATE",
+	"IW|SET_STATE",
+	"V|SHOW_INT",
+	"T|SHOW_STRING_NL",
+	/* 64 */
+	"T|SHOW_STRING",
+	"I|UNK_65",
+	"I|UNK_66",
+	"|UNK_67",
+	/* 68 */
+	"x|END",
+	"x|DONE",
+	NULL,
+	"W|START_SUB",
+	/* 72 */
+	NULL,
+	"I|PRINT_OBJ",
+	"I|PRINT_NAME",
+	"I|PRINT_CNAME",
+	/* 76 */
+	"WW|ADD_TIMEOUT",
+	"J|IS_M1_EMPTY",
+	"J|IS_M3_EMPTY",
+	"ITJ|CHILD_FR2_IS",
+	/* 80 */
+	"IIJ|IS_ITEM_EQ",
+	NULL,
+	"B|DEBUG",
+	"|RESCAN",
+	/* 84 */
+	NULL,
+	"IBB|WHERE_TO",
+	NULL,
+	"W|COMMENT",
+	/* 88 */
+	"|STOP_ANIMATION",
+	"T|LOAD_USER_GAME",
+	"IB|GET_PARENT",
+	"IB|GET_NEXT",
+	/* 92 */
+	"IB|GET_CHILDREN",
+	NULL,
+	NULL,
+	NULL,
+	/* 96 */
+	"WB|PICTURE",
+	"W|LOAD_ZONE",
+	"WBWWW|ANIMATE",
+	"W|STOP_ANIMATE",
+	/* 100 */
+	"|KILL_ANIMATE",
+	"BWWWWWW|DEFINE_WINDOW",
+	"B|CHANGE_WINDOW",
+	"|CLS",
+	/* 104 */
+	"B|CLOSE_WINDOW",
+	"B|UNK_105",
+	"W|UNK_106",
+	"WWWWWIW|ADD_BOX",
+	/* 108 */
+	"W|DEL_BOX",
+	"W|ENABLE_BOX",
+	"W|DISABLE_BOX",
+	"WWW|MOVE_BOX",
+	/* 112 */
+	NULL,
+	NULL,
+	"IB|DO_ICONS",
+	"IBJ|IS_CLASS",
+	/* 116 */
+	"IB|SET_CLASS",
+	"IB|UNSET_CLASS",
+	NULL,
+	"W|WAIT_SYNC",
+	/* 120 */
+	"W|SYNC",
+	"BI|DEF_OBJ",
+	NULL,
+	"|SET_TIME",
+	/* 124 */
+	NULL,
+	"IJ|IS_SIBLING_WITH_A",
+	"IBB|DO_CLASS_ICONS",
+	"WW|PLAY_TUNE",
+	/* 128 */
+	"W|WAIT_END_TUNE",
+	"W|IF_END_TUNE",
+	"Bww|SET_ADJ_NOUN",
+	NULL,
+	/* 132 */
+	"|SAVE_GAME",
+	"|LOAD_GAME",
+	"|STOP_TUNE",
+	"|PAUSE",
+	/* 136 */
+	"IV|COPY_SF",
+	"B|RESTORE_ICONS",
+	"|FREEZE_ZONES",
+	"II|SET_PARENT_SPECIAL",
+	/* 140 */
+	"|CLEAR_TIMERS",
+	"BI|SET_M1_OR_M3",
+	"WJ|IS_BOX",
+	"I|START_ITEM_SUB",
+	/* 144 */
+	"IB|SET_DOOR_OPEN",
+	"IB|SET_DOOR_CLOSED",
+	"IB|SET_DOOR_LOCKED",
+	"IB|SET_DOOR_OPEN",
+	/* 148 */
+	"IBJ|IF_DOOR_OPEN",
+	"IBJ|IF_DOOR_CLOSED",
+	"IBJ|IF_DOOR_LOCKED",
+	"BI|STORE_ITEM",
+	/* 152 */
+	"BB|GET_ITEM",
+	"B|SET_BIT",
+	"B|CLEAR_BIT",
+	"BJ|IS_BIT_CLEAR",
+	/* 156 */
+	"BJ|IS_BIT_SET",
+	"IBB|GET_ITEM_PROP",
+	"IBW|SET_ITEM_PROP",
+	NULL,
+	/* 160 */
+	"B|SET_INK",
+	"|UNK_161",
+	"BT|PRINT_STR",
+	NULL,
+	/* 164 */
+	NULL,
+	"W|SET_SUPER_ROOM",
+	"BV|GET_SUPER_ROOM",
+	NULL,
+	/* 168 */
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	/* 172 */
+	NULL,
+	NULL,
+	"W|UNK_174",
+	"|getDollar2",
+	/* 176 */
+	"IWBB|UNK_176",
+	"B|UNK_177",
+	"B|UNK_178",
+	"IWWJ|IS_ADJ_NOUN",
+	/* 180 */
+	"B|SET_BIT2",
+	"B|CLEAR_BIT2",
+	"BJ|IS_BIT2_CLEAR",
+	"BJ|IS_BIT2_SET",
+};
+
 static const char *const waxworks_opcodeNameTable[256] = {
 	/* 0 */
 	"|NOT",
@@ -589,17 +822,17 @@
 	"B|SET_INK",
 	"|UNK_161",
 	"BT|PRINT_STR",
-	"W|PLAY_EFFECT",
+	NULL,
 	/* 164 */
-	"|getDollar2",
+	NULL,
 	"W|SET_SUPER_ROOM",
 	"BV|GET_SUPER_ROOM",
-	"B|CLEAR_BIT2",
+	NULL,
 	/* 168 */
-	"BJ|IS_BIT2_CLEAR",
-	"BJ|IS_BIT2_SET",
 	NULL,
 	NULL,
+	NULL,
+	NULL,
 	/* 172 */
 	NULL,
 	NULL,

Modified: scummvm/trunk/engines/agos/event.cpp
===================================================================
--- scummvm/trunk/engines/agos/event.cpp	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/event.cpp	2006-10-13 11:38:41 UTC (rev 24294)
@@ -160,6 +160,20 @@
 	return result;
 }
 
+void AGOSEngine::haltAnimation() {
+	VgaTimerEntry *vte = _vgaTimerList;
+
+	_lockWord |= 0x10;
+
+	while (vte->delay) {
+		vte->delay += 10;
+	}
+}
+
+void AGOSEngine::restartAnimation() {
+	_lockWord &= ~0x10;
+}
+
 void AGOSEngine::addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite, uint16 curZoneNum, int32 param) {
 	VgaTimerEntry *vte;
 

Modified: scummvm/trunk/engines/agos/icons.cpp
===================================================================
--- scummvm/trunk/engines/agos/icons.cpp	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/icons.cpp	2006-10-13 11:38:41 UTC (rev 24294)
@@ -199,6 +199,9 @@
 			src += READ_LE_UINT16(&((uint16 *)src)[icon]);
 			decompressIcon(dst, src, 24, 12, 224, _dxSurfacePitch);
 		}
+	} else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+		// TODO
+
 	} else if (getGameType() == GType_ELVIRA1) {
 		dst += (x + window->x) * 8;
 		dst += (y * 8 + window->y) * _dxSurfacePitch;
@@ -206,8 +209,6 @@
 		src = _iconFilePtr;
 		src += icon * 288;
 		decompressIconAmiga(dst, src, 16, _dxSurfacePitch, false);
-	} else {
-		// TODO
 	}
 
 	_lockWord &= ~0x8000;

Modified: scummvm/trunk/engines/agos/items.cpp
===================================================================
--- scummvm/trunk/engines/agos/items.cpp	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/items.cpp	2006-10-13 11:38:41 UTC (rev 24294)
@@ -383,6 +383,11 @@
 	op[183] = &AGOSEngine::o_b2NotZero;
 
 	// Code difference, check if triggered
+	op[65] = NULL;
+	op[66] = NULL;
+	op[67] = NULL;
+	op[70] = NULL;
+
 	op[163] = NULL;
 	op[164] = NULL;
 	op[167] = NULL;
@@ -417,10 +422,10 @@
 	op[74] = &AGOSEngine::oe1_pName;
 	op[75] = &AGOSEngine::oe1_pcName;
 	op[83] = &AGOSEngine::o1_rescan;
+	op[85] = &AGOSEngine::oww_whereTo;
+	op[89] = &AGOSEngine::oe2_loadUserGame;
 	op[98] = &AGOSEngine::o1_animate;
 	op[99] = &AGOSEngine::o1_stopAnimate;
-	op[85] = &AGOSEngine::oww_whereTo;
-	op[89] = &AGOSEngine::oe2_loadUserGame;
 	op[105] = &AGOSEngine::oww_menu;
 	op[106] = &AGOSEngine::oww_textMenu;
 	op[123] = &AGOSEngine::oe1_setTime;
@@ -1466,12 +1471,25 @@
 
 void AGOSEngine::o_doTable() {
 	// 143: start item sub
-	SubRoom *subRoom = (SubRoom *)findChildOfType(getNextItemPtr(), 1);
-	if (subRoom != NULL) {
-		Subroutine *sub = getSubroutineByID(subRoom->subroutine_id);
-		if (sub)
+	SubRoom *r = (SubRoom *)findChildOfType(getNextItemPtr(), 1);
+	if (r != NULL) {
+		Subroutine *sub = getSubroutineByID(r->subroutine_id);
+		if (sub) {
 			startSubroutine(sub);
+			return;
+		}
 	}
+
+	if (getGameType() == GType_ELVIRA2) {
+		SubSuperRoom *sr = (SubSuperRoom *)findChildOfType(getNextItemPtr(), 4);
+		if (sr != NULL) {
+			Subroutine *sub = getSubroutineByID(sr->subroutine_id);
+			if (sub) {
+				startSubroutine(sub);
+				return;
+			}
+		}
+	}
 }
 
 void AGOSEngine::o_storeItem() {

Modified: scummvm/trunk/engines/agos/rooms.cpp
===================================================================
--- scummvm/trunk/engines/agos/rooms.cpp	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/rooms.cpp	2006-10-13 11:38:41 UTC (rev 24294)
@@ -43,22 +43,6 @@
 	return 0;
 }
 
-uint16 AGOSEngine::getDoorOf(Item *i, uint16 d) {
-	SubGenExit *g;
-	Item *x;
-
-	g = (SubGenExit *)findChildOfType(i, 4);
-	if (g == NULL)
-		return 0;
-
-	x = derefItem(g->dest[d]);
-	if (x == NULL)
-		return 0;
-	if (isRoom(x))
-		return 0;
-	return itemPtrToID(x);
-}
-
 uint16 AGOSEngine::getDoorState(Item *item, uint16 d) {
 	uint16 mask = 3;
 	uint16 n;
@@ -75,24 +59,6 @@
 	return n;
 }
 
-uint16 AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
-	SubGenExit *g;
-	Item *x;
-
-	g = (SubGenExit *)findChildOfType(item, 4);
-	if (g == NULL)
-		return 0;
-
-	x = derefItem(g->dest[d]);
-	if (x == NULL)
-		return 0;
-	if (isRoom(x))
-		return itemPtrToID(x);
-	if (x->state != 0)
-		return 0;
-	return x->parent;
-}
-
 uint16 AGOSEngine::getExitOf(Item *item, uint16 d) {
 	SubRoom *subRoom;
 	uint16 x;
@@ -110,25 +76,6 @@
 	return subRoom->roomExit[d];
 }
 
-uint16 AGOSEngine::getExitState(Item *i, uint16 x, uint16 d) {
-	SubSuperRoom *sr;
-	uint16 mask = 3;
-	uint16 n;
-	uint16 *c;
-
-	sr = (SubSuperRoom *)findChildOfType(i, 4);
-	if (sr == NULL)
-	    return 0;
-
-	c = sr->roomExitStates;
-	c += x - 1;
-	d <<= 1;
-	mask <<= d;
-	n = *c & mask;
-	n >>= d;
-	return n;
-}
-
 void AGOSEngine::changeDoorState(SubRoom *r, uint16 d, uint16 n) {
 	uint16 mask=3;
 	d <<= 1;
@@ -176,6 +123,41 @@
 	changeDoorState(r1, d, n);    
 }
 
+// Elvira 1 specific
+uint16 AGOSEngine::getDoorOf(Item *i, uint16 d) {
+	SubGenExit *g;
+	Item *x;
+
+	g = (SubGenExit *)findChildOfType(i, 4);
+	if (g == NULL)
+		return 0;
+
+	x = derefItem(g->dest[d]);
+	if (x == NULL)
+		return 0;
+	if (isRoom(x))
+		return 0;
+	return itemPtrToID(x);
+}
+
+uint16 AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
+	SubGenExit *g;
+	Item *x;
+
+	g = (SubGenExit *)findChildOfType(item, 4);
+	if (g == NULL)
+		return 0;
+
+	x = derefItem(g->dest[d]);
+	if (x == NULL)
+		return 0;
+	if (isRoom(x))
+		return itemPtrToID(x);
+	if (x->state != 0)
+		return 0;
+	return x->parent;
+}
+
 void AGOSEngine::moveDirn_e1(Item *i, uint x) {
 	Item *d, *p;
 	uint16 n;
@@ -208,6 +190,26 @@
 	showMessageFormat("You can't go that way.\n");
 }
 
+// Elvira 2 specific
+uint16 AGOSEngine::getExitState(Item *i, uint16 x, uint16 d) {
+	SubSuperRoom *sr;
+	uint16 mask = 3;
+	uint16 n;
+	uint16 *c;
+
+	sr = (SubSuperRoom *)findChildOfType(i, 4);
+	if (sr == NULL)
+	    return 0;
+
+	c = sr->roomExitStates;
+	c += x - 1;
+	d <<= 1;
+	mask <<= d;
+	n = *c & mask;
+	n >>= d;
+	return n;
+}
+
 void AGOSEngine::moveDirn_e2(Item *i, uint x) {
 	SubSuperRoom *sr;
 	Item *d, *p;
@@ -251,6 +253,7 @@
 	}
 }
 
+// Waxworks specific
 void AGOSEngine::moveDirn_ww(Item *i, uint x) {
 	Item *d;
 	uint16 n;

Modified: scummvm/trunk/engines/agos/subroutine.cpp
===================================================================
--- scummvm/trunk/engines/agos/subroutine.cpp	2006-10-13 09:17:35 UTC (rev 24293)
+++ scummvm/trunk/engines/agos/subroutine.cpp	2006-10-13 11:38:41 UTC (rev 24294)
@@ -55,6 +55,23 @@
 	" ", "NI ","N ",
 };
 
+static const char *const opcodeArgTable_elvira2[256] = {
+	" ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ",
+	"BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ",
+	"II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ",
+	"BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ",
+	"IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "I  ", "I ", " ", "T ", " ", " ",
+	"N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ",
+	"IIB ", "T ", "T ", "T ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NBNNN ", "N ",
+	" ", "BNNNNNN ", "B ", " ", "B ", "B ", "N ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ",
+	"IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ",
+	"NN ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", "N ",
+	"I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ",	"B ",
+	"IBB ", "IBN ", "IB ", "B ", " ", "TB ", "TB ", "I ", "N ", "B ", "INB ", "INB ", "INB ", "INB ",
+	"INB ", "INB ", "INB ", "N ", " ", "INBB ", "B ", "B ", "Ian ", "B ", "B ", "B ", "B ", "T ",
+	"T ", "B ", " ", "I ", " ", " "
+};
+
 static const char *const opcodeArgTable_waxworks[256] = {
 	" ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ",
 	"BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ",
@@ -636,8 +653,10 @@
 		table = opcodeArgTable_simon1talkie;
 	else if (getGameType() == GType_SIMON1)
 		table = opcodeArgTable_simon1dos;
-	else if (getGameType() == GType_WW || getGameType() == GType_ELVIRA2)
+	else if (getGameType() == GType_WW)
 		table = opcodeArgTable_waxworks;
+	else if (getGameType() == GType_ELVIRA2)
+		table = opcodeArgTable_elvira2;
 	else
 		table = opcodeArgTable_elvira1;
 


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