[Scummvm-cvs-logs] CVS: scummvm/sky control.cpp,1.5,1.6 control.h,1.3,1.4 logic.cpp,1.105,1.106 logic.h,1.29,1.30 screen.cpp,1.33,1.34 sky.cpp,1.66,1.67

Robert G?ffringmann lavosspawn at users.sourceforge.net
Tue Jul 1 06:05:04 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv4111/sky

Modified Files:
	control.cpp control.h logic.cpp logic.h screen.cpp sky.cpp 
Log Message:
bypassed copy protection, fixed crash when disconnecting from link space, fixed logix swing seqs

Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- control.cpp	1 Jul 2003 01:29:29 -0000	1.5
+++ control.cpp	1 Jul 2003 13:04:00 -0000	1.6
@@ -1298,4 +1298,6 @@
 	_skyScreen->halvePalette();
 	_skyScreen->showScreen(screenData);
 	free(textBuf1); free(textBuf2);
+	delay(1500);
+	_system->quit();
 }

Index: control.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- control.h	1 Jul 2003 01:29:29 -0000	1.3
+++ control.h	1 Jul 2003 13:04:00 -0000	1.4
@@ -31,6 +31,10 @@
 #include "sky/mouse.h"
 #include "sky/logic.h"
 
+class SkyScreen;
+class SkyLogic;
+class SkyMouse;
+
 #define MAX_SAVE_GAMES 999
 #define MAX_TEXT_LEN 80
 #define PAN_LINE_WIDTH 184

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.cpp,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- logic.cpp	1 Jul 2003 01:29:29 -0000	1.105
+++ logic.cpp	1 Jul 2003 13:04:00 -0000	1.106
@@ -69,6 +69,20 @@
 	initScriptVariables();
 }
 
+bool SkyLogic::checkProtection(void) {
+
+	if (!_scriptVariables[ENTER_DIGITS]) return false;
+	if (_scriptVariables[CONSOLE_TYPE] == 5) { // reactor code
+		_scriptVariables[FS_COMMAND] = 240;
+		_scriptVariables[ENTER_DIGITS] = 0;
+		return true;
+	} else {								   // copy protection
+		_scriptVariables[FS_COMMAND] = 337;
+		_scriptVariables[ENTER_DIGITS] = 0;
+		return true;
+	}
+}
+
 void SkyLogic::engine() {
 	uint16 *logicList = (uint16 *)SkyState::fetchCompact(_scriptVariables[LOGIC_LIST_NO]);
 
@@ -1026,7 +1040,8 @@
 	UP_MOUSE,
 	DOWN_MOUSE,
 	LEFT_MOUSE,
-	RIGHT_MOUSE
+	RIGHT_MOUSE,
+	DISCONNECT_FOSTER
 };
 
 void SkyLogic::initScriptVariables() {
@@ -2311,7 +2326,8 @@
 }
 
 bool SkyLogic::fnQuitToDos(uint32 a, uint32 b, uint32 c) {
-	error("Stub: fnQuitToDos");
+	_skyControl->showGameQuitMsg();  // calls _system->quit()
+	return true;
 }
 
 bool SkyLogic::fnPauseFx(uint32 a, uint32 b, uint32 c) {
@@ -2359,7 +2375,7 @@
             target->extCompact->spTime = 10;
 			target->logic = L_TALK; 
 			return ;
-	}	
+	}
 
 	//now form the text sprite
 	struct lowTextManager_t textInfo;

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- logic.h	1 Jul 2003 01:29:29 -0000	1.29
+++ logic.h	1 Jul 2003 13:04:00 -0000	1.30
@@ -29,6 +29,7 @@
 #include "sky/music/musicbase.h"
 #include "sky/mouse.h"
 #include "sky/screen.h"
+#include "sky/control.h"
 
 enum scriptVariableOffsets {
 	RESULT = 0,
@@ -64,7 +65,10 @@
 	MENU = 102,
 	RND = 115,
 	CUR_SECTION = 143,
+	CONSOLE_TYPE = 345,
 	REICH_DOOR_FLAG = 470,
+	FS_COMMAND = 643,
+	ENTER_DIGITS = 644,
 	LINC_DIGIT_0 = 646,
 	LINC_DIGIT_1 = 647,
 	LINC_DIGIT_2 = 648,
@@ -80,11 +84,14 @@
 class SkyAutoRoute;
 class SkyScreen;
 class SkyMouse;
+class SkyControl;
 
 class SkyLogic {
 public:
 	SkyLogic(SkyScreen *skyScreen, SkyDisk *skyDisk, SkyText *skyText, SkyMusicBase *skyMusic, SkyMouse *skyMouse, SkySound *skySound);
 	void engine();
+	bool checkProtection(void);
+	void useControlInstance(SkyControl *control) { _skyControl = control; };
 
 	void nop();
 	void logicScript();
@@ -257,6 +264,7 @@
 	SkySound *_skySound;
 	SkyAutoRoute *_skyAutoRoute;
 	SkyMouse *_skyMouse;
+	SkyControl *_skyControl;
 };
 
 #endif

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/screen.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- screen.cpp	1 Jul 2003 01:29:29 -0000	1.33
+++ screen.cpp	1 Jul 2003 13:04:00 -0000	1.34
@@ -383,7 +383,7 @@
 void SkyScreen::startSequenceItem(uint16 itemNum) {
 
 	_seqInfo.seqData = (uint8*)SkyState::fetchItem(itemNum);
-	_seqInfo.framesLeft = _seqInfo.seqData[0];
+	_seqInfo.framesLeft = _seqInfo.seqData[0] - 1;
 	_seqInfo.seqDataPos = _seqInfo.seqData + 1;
 	_seqInfo.delay = SEQ_DELAY;
 	_seqInfo.running = true;

Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- sky.cpp	1 Jul 2003 01:29:29 -0000	1.66
+++ sky.cpp	1 Jul 2003 13:04:00 -0000	1.67
@@ -116,12 +116,14 @@
 		}
 		_skyMouse->mouseEngine((uint16)_sdl_mouse_x, (uint16)_sdl_mouse_y);
 		_skyLogic->engine();
-		//_skyScreen->forceRefresh();
-		_skyScreen->recreate();
-		_skyScreen->spriteEngine();
-		_skyScreen->flip();
-		//_skyScreen->showGrid(_skyLogic->_skyGrid->giveGrid(SkyLogic::_scriptVariables[SCREEN]));
-		_system->update_screen();
+		if (!_skyLogic->checkProtection()) { // don't let copy prot. screen flash up
+			//_skyScreen->forceRefresh();
+			_skyScreen->recreate();
+			_skyScreen->spriteEngine();
+			_skyScreen->flip();
+			//_skyScreen->showGrid(_skyLogic->_skyGrid->giveGrid(SkyLogic::_scriptVariables[SCREEN]));
+			_system->update_screen();
+		}
 	}
 }
 
@@ -164,6 +166,7 @@
 	_timer->installProcedure(&timerHandler, 1000000 / 50); //call 50 times per second
 
 	_skyControl = new SkyControl(_skyScreen, _skyDisk, _skyMouse, _skyText, _skyMusic, _skyLogic, _system, getSavePath());
+	_skyLogic->useControlInstance(_skyControl);
 }
 
 void SkyState::initItemList() {
@@ -279,9 +282,7 @@
 					break;
 
 				case OSystem::EVENT_QUIT:
-					_skyControl->showGameQuitMsg();
-					delay(1500);
-					_system->quit();
+					_skyControl->showGameQuitMsg(); // will call _system->quit()
 					break;
 
 				default:





More information about the Scummvm-git-logs mailing list