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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Mon Apr 3 19:27:01 CEST 2006


Revision: 21583
Author:   kirben
Date:     2006-04-03 18:38:53 -0700 (Mon, 03 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21583&view=rev

Log Message:
-----------
More work on oracle in FF

Modified Paths:
--------------
    scummvm/trunk/engines/simon/items.cpp
    scummvm/trunk/engines/simon/oracle.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/verb.cpp
Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp	2006-04-03 22:06:42 UTC (rev 21582)
+++ scummvm/trunk/engines/simon/items.cpp	2006-04-04 01:38:53 UTC (rev 21583)
@@ -704,7 +704,7 @@
 				if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2)
 					goto invalid_opcode;
 
-				warning("STUB: script opcode 122");
+				oracleTextDown();
 			}
 			break;
 
@@ -712,7 +712,7 @@
 				if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2)
 					goto invalid_opcode;
 
-				warning("STUB: script opcode 123");
+				oracleTextUp();
 			}
 			break;
 
@@ -795,7 +795,7 @@
 
 		case 134:{									/* dummy opcode? */
 				if (getGameType() == GType_FF) {
-					warning("STUB: script opcode 134");
+					listSaveGames(1);
 				} else {
 					midi.stop();
 					_lastMusicPlayed = -1;

Modified: scummvm/trunk/engines/simon/oracle.cpp
===================================================================
--- scummvm/trunk/engines/simon/oracle.cpp	2006-04-03 22:06:42 UTC (rev 21582)
+++ scummvm/trunk/engines/simon/oracle.cpp	2006-04-04 01:38:53 UTC (rev 21583)
@@ -21,6 +21,9 @@
  */
 
 #include "common/stdafx.h"
+
+#include "common/savefile.h"
+
 #include "simon/simon.h"
 #include "simon/intern.h"
 #include "simon/vga.h"
@@ -29,8 +32,7 @@
 
 namespace Simon {
 
-void SimonEngine::hyperLinkOn(uint16 x)
-{
+void SimonEngine::hyperLinkOn(uint16 x) {
 	if ((_bitArray[3] & (1 << 3)) == 0)
 		return;
 
@@ -41,8 +43,7 @@
 }
 
 
-void SimonEngine::hyperLinkOff()
-{
+void SimonEngine::hyperLinkOff() {
 	if ((_bitArray[3] & (1 << 3)) == 0)
 		return;
 
@@ -52,6 +53,169 @@
 	_hyperLink = 0;
 }
 
+void SimonEngine::oracleTextDown() {
+	Subroutine *sub;
+	int i = 0;
+	changeWindow(3);
+	_noOracleScroll = 0;
+
+	if(_textWindow->textColumnOffset > _oracleMaxScrollY) 		// For scroll up
+		_oracleMaxScrollY = _textWindow->textColumnOffset;
+
+	while(1) {
+		if(_textWindow->textColumnOffset == 0)
+			break;
+		for (i = 0; i < 5; i++) {
+			_newLines = 0;
+			_textWindow->textColumn = 0;
+			_textWindow->textRow = (i + 1) * 3;
+			if(i == 4) {
+				_textWindow->textColumnOffset -= 1;
+				_textWindow->textRow = 0;
+				linksDown();
+			}
+			scrollOracleDown();
+			_bitArray[5] |= (1 << 13);
+			sub = getSubroutineByID(_variableArray[104]);
+			if (sub)
+				startSubroutineEx(sub);
+			_bitArray[5] &= ~(1 << 13);
+			bltOracleText();
+		}
+		if (_currentBoxNumber != 600 || _leftButtonDown)
+			break;
+	}
+}
+
+void SimonEngine::oracleTextUp() {
+	Subroutine *sub;
+	int i = 0;
+	changeWindow(3);
+	_noOracleScroll = 0;
+
+	if(_textWindow->textColumnOffset > _oracleMaxScrollY) 		// For scroll up
+		_oracleMaxScrollY = _textWindow->textColumnOffset;
+
+	while(1) {
+		if(_textWindow->textColumnOffset == _oracleMaxScrollY)
+			break;
+		_textWindow->textRow = 105;
+		for (i = 0; i < 5; i++) {
+			_newLines = 0;
+			_textWindow->textColumn = 0;
+			_textWindow->textRow -= 3;
+			if(i == 2) {
+				_textWindow->textColumnOffset += 1;
+				_textWindow->textRow += 15;
+				linksUp();
+			}
+			scrollOracleUp();
+			_bitArray[5] |= (1 << 14);
+			sub = getSubroutineByID(_variableArray[104]);
+			if(sub)
+				startSubroutineEx(sub);
+			_bitArray[5] &= ~(1 << 14);
+			bltOracleText();
+		}
+		if (_currentBoxNumber != 600 || _leftButtonDown)
+			break;
+	}
+}
+
+void SimonEngine::linksUp() {	// Scroll Oracle Links
+	uint16 j;
+	for (j = 700; j < _variableArray[53]; j++) {
+		moveBox(j, 0, -15);
+	}
+}
+
+void SimonEngine::linksDown() {
+	uint16 i;
+	for (i = 700; i < _variableArray[53]; i++) {
+		moveBox(i,0, 15);
+	}
+}
+
+void SimonEngine::listSaveGames(int n) {
+	char b[108];
+	Common::InSaveFile *in;
+	uint16 j, k, z, maxFiles;
+	int OK;
+	memset(b, 0, 108);
+
+	maxFiles = countSaveGames();
+	j = maxFiles - n + 1;
+	k = maxFiles - j + 1;
+	z = maxFiles;
+	if ((_bitArray[5] & (1 << 15)) != 0) {
+		j++;
+		z++;
+	}
+
+	while(1) {
+		OK=1;
+		if ((_bitArray[5] & (3 << 13)) != 0) {
+			OK = 0;
+			if(j > z)
+				break;
+		}
+
+		if ((_bitArray[5] & (1 << 13)) != 0) {
+			if (((_newLines + 1) >= _textWindow->textColumnOffset) && (
+						(_newLines + 1) < (_textWindow->textColumnOffset + 3)))
+				OK = 1;
+		}
+
+		if ((_bitArray[5] & (1 << 14)) != 0) {
+			if ((_newLines + 1) == (_textWindow->textColumnOffset + 7))
+				OK = 1;
+		}
+
+
+		if (OK == 1) {
+			if (j == maxFiles + 1) {
+				showMessageFormat("\n");
+				hyperLinkOn(j + 400);
+				o_setTextColor(116);
+	    			showMessageFormat(" %d. ",1);
+				hyperLinkOff();
+				o_setTextColor(113);
+				k++;
+				j--;
+			}
+
+			if (!(in = _saveFileMan->openForLoading(gen_savename(j))))
+				break;
+			in->read(b, 100);
+			delete in;
+		}
+
+		showMessageFormat("\n");
+		hyperLinkOn(j + 400);
+		o_setTextColor(116);
+		if (k < 10)
+			showMessageFormat(" ");
+		showMessageFormat("%d. ",k);
+		o_setTextColor(113);
+		showMessageFormat("%s ",b);
+		hyperLinkOff();
+		j--;
+		k++;
+	}
+}
+
+void SimonEngine::scrollOracleUp() {
+	// TODO
+}
+
+void SimonEngine::scrollOracleDown() {
+	// TODO
+}
+
+void SimonEngine::bltOracleText() {
+	// TODO
+}
+
 void SimonEngine::oracleLogo() {
 	Common::Rect srcRect, dstRect;
 	byte *src, *dst;

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-04-03 22:06:42 UTC (rev 21582)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-04-04 01:38:53 UTC (rev 21583)
@@ -280,6 +280,7 @@
 	_objectItem = 0;
 	_item1 = 0;
 
+	_currentBoxNumber = 0;
 	_hitAreaObjectItem = 0;
 	_lastHitArea = 0;
 	_lastHitArea2Ptr = 0;
@@ -1660,7 +1661,7 @@
 
 	if (getGameType() == GType_FF) {
 		if (_bitArray[6] & 0x8) { // Oracle
-			if (_mouseX >= 10 && _mouseX <= 635 && _mouseY >= 5 && _mouseX <= 475) {
+			if (_mouseX >= 10 && _mouseX <= 635 && _mouseY >= 5 && _mouseY <= 475) {
 				_bitArray[6] |= 0x4;
 			} else {
 				if (_bitArray[6] & 0x4) {
@@ -1668,7 +1669,7 @@
 				}
 			}
 		} else if (_bitArray[5] & 0x0100) { // Close Up
-			if (_mouseX >= 10 && _mouseX <= 635 && _mouseY >= 5 && _mouseX <= 475) {
+			if (_mouseX >= 10 && _mouseX <= 635 && _mouseY >= 5 && _mouseY <= 475) {
 				_bitArray[5] |= 0x80;
 			} else {
 				if (_bitArray[5] & 0x80) {

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-03 22:06:42 UTC (rev 21582)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-04 01:38:53 UTC (rev 21583)
@@ -264,7 +264,7 @@
 	const byte *_scrollImage;
 	byte _vgaVar8;
 
- 	uint16 _hyperLink;
+ 	uint16 _hyperLink, _newLines;
  	uint16 _oracleMaxScrollY, _noOracleScroll;
  
 	int16 _scriptVerb, _scriptNoun1, _scriptNoun2;
@@ -287,6 +287,7 @@
 	uint _verbHitArea;
 	uint16 _defaultVerb;
 	uint _mouseHideCount;
+	uint _currentBoxNumber;
 
 	uint16 _windowNum;
 
@@ -589,7 +590,16 @@
 
  	void hyperLinkOn(uint16 x);
  	void hyperLinkOff();
+	void linksUp();
+	void linksDown();
+	void listSaveGames(int n);
+	void oracleTextUp();
+	void oracleTextDown();
+
+	void bltOracleText();
 	void oracleLogo();
+	void scrollOracleUp();
+	void scrollOracleDown();
 	void swapCharacterLogo();
 
 	void mouseOff();

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-04-03 22:06:42 UTC (rev 21582)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-04-04 01:38:53 UTC (rev 21583)
@@ -519,6 +519,8 @@
 		return;
 	}
 
+	_currentBoxNumber = best_ha->id;
+
 	if (mode != 0 && mode != 3) {
 		_lastHitArea = best_ha;
 		_variableArray[1] = x;


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