[Scummvm-cvs-logs] SF.net SVN: scummvm: [21589] scummvm/trunk/engines/simon

kirben at users.sourceforge.net kirben at users.sourceforge.net
Tue Apr 4 03:13:18 CEST 2006


Revision: 21589
Author:   kirben
Date:     2006-04-04 03:12:22 -0700 (Tue, 04 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21589&view=rev

Log Message:
-----------
Add verb codes differences in FF

Modified Paths:
--------------
    scummvm/trunk/engines/simon/charset.cpp
    scummvm/trunk/engines/simon/debugger.cpp
    scummvm/trunk/engines/simon/items.cpp
    scummvm/trunk/engines/simon/saveload.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/verb.cpp
    scummvm/trunk/engines/simon/vga.cpp
Modified: scummvm/trunk/engines/simon/charset.cpp
===================================================================
--- scummvm/trunk/engines/simon/charset.cpp	2006-04-04 08:50:35 UTC (rev 21588)
+++ scummvm/trunk/engines/simon/charset.cpp	2006-04-04 10:12:22 UTC (rev 21589)
@@ -420,9 +420,9 @@
 	if (getGameType() == GType_FF) {
 		if (_noOracleScroll == 0) {
 			if (fcs->textRow + 30 > fcs->height) {
-				if (vcGetBit(94) == false) {
+				if (getBitFlag(94) == false) {
 					_noOracleScroll = 1;
-					if (vcGetBit(92) == true) {
+					if (getBitFlag(92) == true) {
 						_noOracleScroll = 0;
 						checkLinkBox();
 						scrollOracle();

Modified: scummvm/trunk/engines/simon/debugger.cpp
===================================================================
--- scummvm/trunk/engines/simon/debugger.cpp	2006-04-04 08:50:35 UTC (rev 21588)
+++ scummvm/trunk/engines/simon/debugger.cpp	2006-04-04 10:12:22 UTC (rev 21589)
@@ -154,13 +154,13 @@
 		bit = atoi(argv[1]);
 		value = atoi(argv[2]);
 		if (value <= 1) {
-			_vm->vcSetBitTo(bit, value != 0);
+			_vm->setBitFlag(bit, value != 0);
 			DebugPrintf("Set bit %d to %d\n", bit, value);
 		} else
 			DebugPrintf("Bit value out of range (0 - 1)\n");
 	} else if (argc > 1) {
 		bit = atoi(argv[1]);
-		value = _vm->vcGetBit(bit);
+		value = _vm->getBitFlag(bit);
 		DebugPrintf("Bit %d is %d\n", bit, value);
 	} else
 		DebugPrintf("Syntax: bit <bitnum> <value>\n");

Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp	2006-04-04 08:50:35 UTC (rev 21588)
+++ scummvm/trunk/engines/simon/items.cpp	2006-04-04 10:12:22 UTC (rev 21589)
@@ -1327,7 +1327,7 @@
 
 void SimonEngine::o_83_helper() {
 		if (_exitCutscene) {
-			if (vcGetBit(9)) {
+			if (getBitFlag(9)) {
 				endCutscene();
 			}
 		} else {
@@ -1339,7 +1339,7 @@
 	_exitCutscene = false;
 	while (!(_marks & (1 << i))) {
 		if (_exitCutscene) {
-			if (vcGetBit(9)) {
+			if (getBitFlag(9)) {
 				endCutscene();
 				break;
 			}

Modified: scummvm/trunk/engines/simon/saveload.cpp
===================================================================
--- scummvm/trunk/engines/simon/saveload.cpp	2006-04-04 08:50:35 UTC (rev 21588)
+++ scummvm/trunk/engines/simon/saveload.cpp	2006-04-04 10:12:22 UTC (rev 21589)
@@ -127,7 +127,7 @@
 			drawIconArray(2, getItem1Ptr(), 0, 0);
 			mouseOn();
 			// Reset engine?
-			vcSetBitTo(97, true);
+			setBitFlag(97, true);
 			sub = getSubroutineByID(100);
 			startSubroutine(sub);
 		}

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-04-04 08:50:35 UTC (rev 21588)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-04-04 10:12:22 UTC (rev 21589)
@@ -253,6 +253,8 @@
 	_subtitles = true;
 	_fade = true;
 	_mouseCursor = 0;
+	_mouseAnim = 0;
+	_mouseAnimMax = 0;
 	_vgaVar9 = 0;
 	_scriptUnk1 = 0;
 	_restoreWindow6 = 0;
@@ -1538,6 +1540,48 @@
 void SimonEngine::setup_cond_c_helper() {
 	HitArea *last;
 
+	_noRightClick = 1;
+
+	if (getGameType() == GType_FF) {
+		int cursor = 5;
+		int animMax = 16;
+
+		if (getBitFlag(200)) {
+			cursor = 11;
+			animMax = 5;
+		} else if (getBitFlag(201)) {
+			cursor = 12;
+			animMax = 5;
+		} else if (getBitFlag(202)) {
+			cursor = 13;
+			animMax = 5;
+		} else if (getBitFlag(203)) {
+			cursor = 14;
+			animMax = 9;
+		} else if (getBitFlag(205)) {
+			cursor = 17;
+			animMax = 11;
+		} else if (getBitFlag(206)) {
+			cursor = 16;
+			animMax = 2;
+		} else if (getBitFlag(208)) {
+			cursor = 26;
+			animMax = 2;
+		} else if (getBitFlag(209)) {
+			cursor = 27;
+			animMax = 9;
+		} else if (getBitFlag(210)) {
+			cursor = 28;
+			animMax = 9;
+		}
+
+		//_animatePointer = 0;
+		_mouseCursor = cursor;
+		_mouseAnimMax = animMax;
+		_mouseAnim = 1;
+		_needHitAreaRecalc++;
+	}
+
 	if (getGameType() == GType_SIMON2) {
 		_mouseCursor = 0;
 		if (_defaultVerb != 999) {
@@ -1580,9 +1624,9 @@
 
 		if (_lastHitArea == NULL) {
 		} else if (_lastHitArea->id == 0x7FFB) {
-			handle_uparrow_hitarea(_lastHitArea->fcs);
+			inventoryUp(_lastHitArea->fcs);
 		} else if (_lastHitArea->id == 0x7FFC) {
-			handle_downarrow_hitarea(_lastHitArea->fcs);
+			inventoryDown(_lastHitArea->fcs);
 		} else if (_lastHitArea->item_ptr != NULL) {
 			_hitAreaObjectItem = _lastHitArea->item_ptr;
 			_variableArray[60] = (_lastHitArea->flags & 1) ? (_lastHitArea->flags / 256) : 0xFFFF;
@@ -1594,6 +1638,8 @@
 	_lastHitArea3 = 0;
 	_lastHitArea = 0;
 	_lastHitArea2Ptr = NULL;
+	_mouseCursor = 0;
+	_noRightClick = 0;
 }
 
 void SimonEngine::endCutscene() {
@@ -1682,7 +1728,7 @@
 
 		if (_rightClick) {
 			_rightClick = false;
-			setVerb_Feeble();
+			setVerb(NULL);
 		}
 	}
 
@@ -2040,9 +2086,9 @@
 
 		if (ha == NULL) {
 		} else if (ha->id == 0x7FFB) {
-			handle_uparrow_hitarea(ha->fcs);
+			inventoryUp(ha->fcs);
 		} else if (ha->id == 0x7FFC) {
-			handle_downarrow_hitarea(ha->fcs);
+			inventoryDown(ha->fcs);
 		} else if (ha->id >= 101 && ha->id < 113) {
 			_verbHitArea = ha->verb;
 			setVerb(ha);
@@ -2671,12 +2717,12 @@
 	_rightClick = false;
 	while (_vgaWaitFor != 0) {
 		if (_rightClick && (getGameType() == GType_SIMON2 || getGameType() == GType_FF)) {
-			if (_vgaWaitFor == 200 && !vcGetBit(14)) {
+			if (_vgaWaitFor == 200 && !getBitFlag(14)) {
 				skipSpeech();
 				break;
 			}
 		} else if (_exitCutscene) {
-			if (vcGetBit(9)) {
+			if (getBitFlag(9)) {
 				endCutscene();
 				break;
 			}
@@ -2869,9 +2915,9 @@
 
 	if (_updateScreen) {
 		if (getGameType() == GType_FF) {
-			if (vcGetBit(78) == false) {
+			if (getBitFlag(78) == false) {
 				oracleLogo();
-			} else if (vcGetBit(76) == true) {
+			} else if (getBitFlag(76) == true) {
 				swapCharacterLogo();
 			}
 		}

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-04 08:50:35 UTC (rev 21588)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-04 10:12:22 UTC (rev 21589)
@@ -255,6 +255,8 @@
 	bool _subtitles;
 	bool _fade;
 	byte _mouseCursor;
+	byte _mouseAnim;
+	byte _mouseAnimMax;
 	bool _vgaVar9;
 	int16 _scriptUnk1;
 	bool _restoreWindow6;
@@ -554,7 +556,6 @@
 	HitArea *findEmptyHitArea();
 	void resetVerbs();
 	void setVerb(HitArea * ha);
-	void setVerb_Feeble();
 	void hitarea_leave(HitArea * ha);
 	void leaveHitAreaById(uint hitarea_id);
 
@@ -630,8 +631,8 @@
 	void defocusHitarea();
 	void endCutscene();
 	void runSubroutine101();
-	void handle_uparrow_hitarea(FillOrCopyStruct *fcs);
-	void handle_downarrow_hitarea(FillOrCopyStruct *fcs);
+	void inventoryUp(FillOrCopyStruct *fcs);
+	void inventoryDown(FillOrCopyStruct *fcs);
 	void hitareaChangedHelper();
 	void focusVerb(uint hitarea_id);
 	HitArea *findHitAreaByID(uint hitarea_id);
@@ -816,8 +817,8 @@
 	void add_vga_timer(uint num, const byte *code_ptr, uint cur_sprite, uint cur_file);
 	VgaSprite *findCurSprite();
 
-	bool vcGetBit(uint bit);
-	void vcSetBitTo(uint bit, bool value);
+	bool getBitFlag(uint bit);
+	void setBitFlag(uint bit, bool value);
 
 	void expire_vga_timers();
 

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-04-04 08:50:35 UTC (rev 21588)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-04-04 10:12:22 UTC (rev 21589)
@@ -388,65 +388,110 @@
 }
 
 void SimonEngine::resetVerbs() {
-	uint id;
-	HitArea *ha;
+	if (getGameType() == GType_FF) {
+		_verbHitArea = 300;
+		int cursor = 0;
+		int animMax = 16;
 
-	if (getGameType() == GType_SIMON2) {
-		id = 2;
-		if (!(_bitArray[4] & 0x8000))
-			id = (_mouseY >= 136) ? 102 : 101;
+		if (getBitFlag(203)) {
+			cursor = 14;
+			animMax = 9;
+		} else if (getBitFlag(204)) {
+			cursor = 15;
+			animMax = 9;
+		} else if (getBitFlag(207)) {
+			cursor = 26;
+			animMax = 2;
+		}
+
+		_mouseCursor = cursor;
+		_mouseAnimMax = animMax;
+		_mouseAnim = 1;
+		_needHitAreaRecalc++;
+
+		if (getBitFlag(99)) {
+			setVerb(NULL);
+		}
 	} else {
-		id = (_mouseY >= 136) ? 102 : 101;
-	}
+		uint id;
+		HitArea *ha;
 
-	_defaultVerb = id;
+		if (getGameType() == GType_SIMON2) {
+			id = 2;
+			if (!(_bitArray[4] & 0x8000))
+				id = (_mouseY >= 136) ? 102 : 101;
+		} else {
+			id = (_mouseY >= 136) ? 102 : 101;
+		}
 
-	ha = findHitAreaByID(id);
-	if (ha == NULL)
-		return;
+		_defaultVerb = id;
 
-	if (ha->flags & 0x40) {
-		_defaultVerb = 999;
-		_currentVerbBox = NULL;
-	} else {
-		_verbHitArea = ha->verb;
-		setVerb(ha);
+		ha = findHitAreaByID(id);
+		if (ha == NULL)
+			return;
+
+		if (ha->flags & 0x40) {
+			_defaultVerb = 999;
+			_currentVerbBox = NULL;
+		} else {
+			_verbHitArea = ha->verb;
+			setVerb(ha);
+		}
 	}
 }
 
 void SimonEngine::setVerb(HitArea *ha) {
-	HitArea *tmp = _currentVerbBox;
+	if (getGameType() == GType_FF) {
+		int cursor = _mouseCursor;
+		if (!_noRightClick)
+			return;
 
-	if (ha == tmp)
-		return;
-
-	if (getGameType() == GType_SIMON1) {
-		if (tmp != NULL) {
-			tmp->flags |= 8;
-			video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA);
+		if (cursor > 13)
+			cursor = 0;
+		cursor++;
+		if (cursor == 5)
+			cursor = 1;
+		if (cursor == 4) {
+			if (getBitFlag(72)) {
+				cursor = 1;
+			}
+		} else if (cursor == 2) {
+			if (getBitFlag(99)) {
+				cursor = 3;
+			}
 		}
 
-		if (ha->flags & 2)
-			video_toggle_colors(ha, 0xda, 0xd5, 0xd5, 5);
-		else
-			video_toggle_colors(ha, 0xdf, 0xda, 0xda, 0xA);
+		_mouseCursor = cursor;
+		_mouseAnimMax = (cursor == 4) ? 14: 16;
+		_mouseAnim = 1;
+		_needHitAreaRecalc++;
+		_verbHitArea = cursor + 300;
+	} else {
+		HitArea *tmp = _currentVerbBox;
 
-		ha->flags &= ~(2 + 8);
-
-	} else {
-		if (ha->id < 101)
+		if (ha == tmp)
 			return;
-		_mouseCursor = ha->id - 101;
-		_needHitAreaRecalc++;
-	}
-	_currentVerbBox = ha;
-}
 
-void SimonEngine::setVerb_Feeble() {
-	if (_noRightClick)
-		return;
+		if (getGameType() == GType_SIMON1) {
+			if (tmp != NULL) {
+				tmp->flags |= 8;
+				video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA);
+			}
 
-	warning("STUB: setVerb_Feeble");
+			if (ha->flags & 2)
+				video_toggle_colors(ha, 0xda, 0xd5, 0xd5, 5);
+			else
+				video_toggle_colors(ha, 0xdf, 0xda, 0xda, 0xA);
+
+			ha->flags &= ~(2 + 8);
+		} else {
+			if (ha->id < 101)
+				return;
+			_mouseCursor = ha->id - 101;
+			_needHitAreaRecalc++;
+		}
+		_currentVerbBox = ha;
+	}
 }
 
 void SimonEngine::hitarea_leave(HitArea *ha) {
@@ -463,7 +508,7 @@
 		hitarea_leave(ha);
 }
 
-void SimonEngine::handle_uparrow_hitarea(FillOrCopyStruct *fcs) {
+void SimonEngine::inventoryUp(FillOrCopyStruct *fcs) {
 	uint index;
 
 	index = get_fcs_ptr_3_index(fcs);
@@ -476,7 +521,7 @@
 	mouseOn();
 }
 
-void SimonEngine::handle_downarrow_hitarea(FillOrCopyStruct *fcs) {
+void SimonEngine::inventoryDown(FillOrCopyStruct *fcs) {
 	uint index;
 
 	index = get_fcs_ptr_3_index(fcs);

Modified: scummvm/trunk/engines/simon/vga.cpp
===================================================================
--- scummvm/trunk/engines/simon/vga.cpp	2006-04-04 08:50:35 UTC (rev 21588)
+++ scummvm/trunk/engines/simon/vga.cpp	2006-04-04 10:12:22 UTC (rev 21589)
@@ -929,7 +929,7 @@
 
 
 			if (state->flags & kDFMasked) {
-				if (vcGetBit(81) == false) {
+				if (getBitFlag(81) == false) {
 					if (state->x  > _feebleRect.right)
 						return;
 					if (state->y > _feebleRect.bottom)
@@ -1110,7 +1110,7 @@
 			dst = state->surf_addr + w * 2;		/* edi */
 
 			h = state->draw_height;
-			if ((getGameType() == GType_SIMON1) && vcGetBit(88)) {
+			if ((getGameType() == GType_SIMON1) && getBitFlag(88)) {
 				/* transparency */
 				do {
 					if (mask[0] & 0xF0) {
@@ -1768,13 +1768,13 @@
 }
 
 void SimonEngine::vc43_skipIfBitClear() {
-	if (!vcGetBit(vcReadNextWord())) {
+	if (!getBitFlag(vcReadNextWord())) {
 		vcSkipNextInstruction();
 	}
 }
 
 void SimonEngine::vc44_skipIfBitSet() {
-	if (vcGetBit(vcReadNextWord())) {
+	if (getBitFlag(vcReadNextWord())) {
 		vcSkipNextInstruction();
 	}
 }
@@ -1866,22 +1866,22 @@
 	}
 }
 
-void SimonEngine::vcSetBitTo(uint bit, bool value) {
+void SimonEngine::setBitFlag(uint bit, bool value) {
 	uint16 *bits = &_bitArray[bit / 16];
 	*bits = (*bits & ~(1 << (bit & 15))) | (value << (bit & 15));
 }
 
-bool SimonEngine::vcGetBit(uint bit) {
+bool SimonEngine::getBitFlag(uint bit) {
 	uint16 *bits = &_bitArray[bit / 16];
 	return (*bits & (1 << (bit & 15))) != 0;
 }
 
 void SimonEngine::vc49_setBit() {
-	vcSetBitTo(vcReadNextWord(), true);
+	setBitFlag(vcReadNextWord(), true);
 }
 
 void SimonEngine::vc50_clearBit() {
-	vcSetBitTo(vcReadNextWord(), false);
+	setBitFlag(vcReadNextWord(), false);
 }
 
 void SimonEngine::vc51_clear_hitarea_bit_0x40() {
@@ -2361,8 +2361,8 @@
 	_variableArray[16] = posy;
 	vsp->y = posy;
 
-	vcSetBitTo(85, false);
-	if (vcGetBit(74) == true) {
+	setBitFlag(85, false);
+	if (getBitFlag(74) == true) {
 		//centreScroll();
 	}
 }
@@ -2404,7 +2404,7 @@
 
 	uint16 var = vcReadNextWord();
 
-	if (vcGetBit(82) == true) {
+	if (getBitFlag(82) == true) {
 		val = _pathValues1[_GPVCount1++];
 	} else {
 		val = _pathValues[_GPVCount++];


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