[Scummvm-cvs-logs] CVS: scummvm/simon charset.cpp,1.45,1.46 debug.h,1.25,1.26 items.cpp,1.141,1.142 saveload.cpp,1.23,1.24 simon.cpp,1.551,1.552 simon.h,1.171,1.172 verb.cpp,1.34,1.35 vga.cpp,1.170,1.171

kirben kirben at users.sourceforge.net
Wed Dec 7 22:13:04 CET 2005


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

Modified Files:
	charset.cpp debug.h items.cpp saveload.cpp simon.cpp simon.h 
	verb.cpp vga.cpp 
Log Message:

Cleanup.


Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/charset.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- charset.cpp	19 Nov 2005 10:48:30 -0000	1.45
+++ charset.cpp	8 Dec 2005 06:11:59 -0000	1.46
@@ -53,11 +53,11 @@
 	FillOrCopyStruct *fcs;
 
 	if (_fcsData2[i]) {
-		lock();
+		mouseOff();
 		fcs = _windowArray[i];
 		drawIconArray(i, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2);
 		_fcsData2[i] = 0;
-		unlock();
+		mouseOn();
 	}
 }
 

Index: debug.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debug.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- debug.h	18 Nov 2005 22:34:41 -0000	1.25
+++ debug.h	8 Dec 2005 06:12:01 -0000	1.26
@@ -1136,10 +1136,10 @@
 	/* 120 */
 	"W|UNK_120",
 	"BI|SET_VGA_ITEM",
-	NULL,
-	NULL,
+	"ORACLE_TEXT_DOWN",
+	"ORACLE_TEXT_UP",
 	/* 124 */
-	NULL,
+	"WJ|IF_TIME",
 	"IJ|IS_SIBLING_WITH_A",
 	"IBB|UNK_126",
 	"WW|PLAY_MUSIC_RESOURCE",
@@ -1151,7 +1151,7 @@
 	/* 132 */
 	"|SAVE_GAME",
 	"|LOAD_GAME",
-	"|DUMMYPROC_134",
+	"|LIST_SAVED_GAMES",
 	"|SWITCH_CD",
 	/* 136 */
 	"IV|GET_ITEM_UNK3",

Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- items.cpp	18 Nov 2005 22:34:41 -0000	1.141
+++ items.cpp	8 Dec 2005 06:12:03 -0000	1.142
@@ -645,9 +645,9 @@
 		case 114:{
 				Item *item = getNextItemPtr();
 				uint fcs_index = getVarOrByte();
-				lock();
+				mouseOff();
 				drawIconArray(fcs_index, item, 0, 0);
-				unlock();
+				mouseOn();
 			}
 			break;
 
@@ -690,6 +690,32 @@
 			}
 			break;
 
+		case 122:{									/* oracle text down */
+				if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2)
+					goto invalid_opcode;
+
+				warning("STUB: script opcode 122");
+			}
+			break;
+
+		case 123:{									/* oracle text down */
+				if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2)
+					goto invalid_opcode;
+
+				warning("STUB: script opcode 123");
+			}
+			break;
+
+		case 124:{									/* if time */
+				if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2)
+					goto invalid_opcode;
+
+				uint time = getVarOrWord();
+				condition = 1;
+				warning("STUB: script opcode 124 (%d)", time);
+			}
+			break;
+
 		case 125:{									/* item is sibling with item 1 */
 				Item *item = getNextItemPtr();
 				condition = (getItem1Ptr()->parent == item->parent);
@@ -700,9 +726,9 @@
 				Item *item = getNextItemPtr();
 				uint fcs_index = getVarOrByte();
 				uint a = 1 << getVarOrByte();
-				lock();
+				mouseOff();
 				drawIconArray(fcs_index, item, 1, a);
-				unlock();
+				mouseOn();
 			}
 			break;
 
@@ -753,8 +779,12 @@
 			break;
 
 		case 134:{									/* dummy opcode? */
-				midi.stop();
-				_lastMusicPlayed = -1;
+				if (getGameType() == GType_FF) {
+					warning("STUB: script opcode 134");
+				} else {
+					midi.stop();
+					_lastMusicPlayed = -1;
+				}
 			}
 			break;
 
@@ -998,12 +1028,12 @@
 			}
 			break;
 
-		case 180:{									/* force unlock */
+		case 180:{									/* force mouseOn */
 				o_mouseOn();
 			}
 			break;
 
-		case 181:{									/* force lock */
+		case 181:{									/* force mouseOff */
 				o_mouseOff();
 				if (getGameType() == GType_SIMON2) {
 					changeWindow(1);
@@ -1652,10 +1682,10 @@
 }
 
 void SimonEngine::o_unk_103() {
-	lock();
+	mouseOff();
 	removeIconArray(_curWindow);
 	showMessageFormat("\x0C");
-	unlock();
+	mouseOn();
 }
 
 void SimonEngine::o_kill_sprite_simon1(uint a) {

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/saveload.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- saveload.cpp	18 Nov 2005 02:31:24 -0000	1.23
+++ saveload.cpp	8 Dec 2005 06:12:03 -0000	1.24
@@ -122,9 +122,9 @@
 			sprintf(buf, "Failed to load game state to file:\n\n%s", filename);
 		} else {
 			// Redraw Inventory
-			lock();
+			mouseOff();
 			drawIconArray(2, getItem1Ptr(), 0, 0);
-			unlock();
+			mouseOn();
 			// Reset engine?
 			vc_set_bit_to(97, true);
 			sub = getSubroutineByID(100);

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.551
retrieving revision 1.552
diff -u -d -r1.551 -r1.552
--- simon.cpp	8 Dec 2005 03:34:46 -0000	1.551
+++ simon.cpp	8 Dec 2005 06:12:03 -0000	1.552
@@ -376,7 +376,7 @@
 	_needHitAreaRecalc = 0;
 	_verbHitArea = 0;
 	_hitAreaUnk4 = 0;
-	_lockCounter = 0;
+	_mouseHideCount = 0;
 
 	_windowNum = 0;
 
@@ -1140,7 +1140,7 @@
 	if (_noParentNotify)
 		return;
 
-	lock();
+	mouseOff();
 
 	for (i = 0; i != 8; i++) {
 		fcs = _windowArray[i];
@@ -1154,7 +1154,7 @@
 		}
 	}
 
-	unlock();
+	mouseOn();
 }
 
 void SimonEngine::unlinkItem(Item *item) {
@@ -1663,15 +1663,15 @@
 	return 0;
 }
 
-void SimonEngine::lock() {
-	_lockCounter++;
+void SimonEngine::mouseOff() {
+	_mouseHideCount++;
 }
 
-void SimonEngine::unlock() {
+void SimonEngine::mouseOn() {
 	_lockWord |= 1;
 
-	if (_lockCounter != 0)
-		_lockCounter--;
+	if (_mouseHideCount != 0)
+		_mouseHideCount--;
 
 	_lockWord &= ~1;
 }
@@ -1679,7 +1679,7 @@
 void SimonEngine::handle_mouse_moved() {
 	uint x;
 
-	if (_lockCounter) {
+	if (_mouseHideCount) {
 		_system->showMouse(false);
 		return;
 	}
@@ -1705,6 +1705,26 @@
 			hitarea_proc_1();
 	}
 
+	if (getGameType() == GType_FF) {
+		if (_bitArray[6] & 0x8) { // Oracle
+			if (_mouseX >= 10 && _mouseX <= 635 && _mouseY >= 5 && _mouseX <= 475) {
+				_bitArray[6] |= 0x4;
+			} else {
+				if (_bitArray[6] & 0x4) {
+					_variableArray[254] = 63;
+				}
+			}
+		} else if (_bitArray[5] & 0x0100) { // Close Up
+			if (_mouseX >= 10 && _mouseX <= 635 && _mouseY >= 5 && _mouseX <= 475) {
+				_bitArray[5] |= 0x80;
+			} else {
+				if (_bitArray[5] & 0x80) {
+					_variableArray[254] = 75;
+				}
+			}
+		}
+	}
+
 	if (getGameType() == GType_SIMON2) {
 		if (_bitArray[4] & 0x8000) {
 			if (!_vgaVar9) {
@@ -2672,7 +2692,7 @@
 void SimonEngine::o_mouseOn() {
 	if (getGameType() == GType_SIMON2 && _bitArray[4] & 0x8000)
 		_mouseCursor = 0;
-	_lockCounter = 0;
+	_mouseHideCount = 0;
 }
 
 void SimonEngine::o_mouseOff() {
@@ -2867,7 +2887,7 @@
 		if (!_cepeFlag)
 			expire_vga_timers();
 
-		if (_lockCounter != 0 && _syncFlag2) {
+		if (_mouseHideCount != 0 && _syncFlag2) {
 			_lockWord &= ~2;
 			return;
 		}
@@ -4086,7 +4106,7 @@
 
 					// We should only allow a load or save when it was possible in original
 					// This stops load/save during copy protection, conversations and cut scenes
-					if (!_lockCounter && !_showPreposition)
+					if (!_mouseHideCount && !_showPreposition)
 						quick_load_or_save();
 				} else if (event.kbd.flags == OSystem::KBD_CTRL) {
 					if (event.kbd.keycode == 'a') {

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- simon.h	19 Nov 2005 11:37:40 -0000	1.171
+++ simon.h	8 Dec 2005 06:12:03 -0000	1.172
@@ -284,7 +284,7 @@
 	uint _needHitAreaRecalc;
 	uint _verbHitArea;
 	uint16 _hitAreaUnk4;
-	uint _lockCounter;
+	uint _mouseHideCount;
 
 	uint16 _windowNum;
 
@@ -583,8 +583,8 @@
 
 	void o_inventory_descriptions();
 
-	void lock();
-	void unlock();
+	void mouseOff();
+	void mouseOn();
 
 	void drawIconArray(uint i, Item *item_ptr, int unk1, int unk2);
 

Index: verb.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/verb.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- verb.cpp	18 Nov 2005 02:31:24 -0000	1.34
+++ verb.cpp	8 Dec 2005 06:12:04 -0000	1.35
@@ -463,9 +463,9 @@
 	if (fcs->fcs_data->unk1 == 0)
 		return;
 
-	lock();
+	mouseOff();
 	drawIconArray(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 - 1, fcs->fcs_data->unk2);
-	unlock();
+	mouseOn();
 }
 
 void SimonEngine::handle_downarrow_hitarea(FillOrCopyStruct *fcs) {
@@ -473,9 +473,9 @@
 
 	index = get_fcs_ptr_3_index(fcs);
 
-	lock();
+	mouseOff();
 	drawIconArray(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 + 1, fcs->fcs_data->unk2);
-	unlock();
+	mouseOn();
 }
 
 void SimonEngine::setup_hitarea_from_pos(uint x, uint y, uint mode) {

Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -d -r1.170 -r1.171
--- vga.cpp	20 Nov 2005 10:26:14 -0000	1.170
+++ vga.cpp	8 Dec 2005 06:12:04 -0000	1.171
@@ -1528,15 +1528,15 @@
 }
 
 void SimonEngine::vc33_setMouseOn() {
-	if (_lockCounter != 0) {
-		_lockCounter = 1;
-		unlock();
+	if (_mouseHideCount != 0) {
+		_mouseHideCount = 1;
+		mouseOn();
 	}
 }
 
 void SimonEngine::vc34_setMouseOff() {
-	lock();
-	_lockCounter = 200;
+	mouseOff();
+	_mouseHideCount = 200;
 	_leftButtonDown = 0;
 }
 





More information about the Scummvm-git-logs mailing list