[Scummvm-cvs-logs] SF.net SVN: scummvm: [27276] scummvm/branches/branch-0-10-0/engines/agos

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sun Jun 10 06:16:05 CEST 2007


Revision: 27276
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27276&view=rev
Author:   Kirben
Date:     2007-06-09 21:16:04 -0700 (Sat, 09 Jun 2007)

Log Message:
-----------
Fix timer code in Puzzle Pack, to match original speed.

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/engines/agos/agos.cpp
    scummvm/branches/branch-0-10-0/engines/agos/agos.h
    scummvm/branches/branch-0-10-0/engines/agos/event.cpp
    scummvm/branches/branch-0-10-0/engines/agos/gfx.cpp
    scummvm/branches/branch-0-10-0/engines/agos/input.cpp
    scummvm/branches/branch-0-10-0/engines/agos/script.cpp

Modified: scummvm/branches/branch-0-10-0/engines/agos/agos.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/agos.cpp	2007-06-10 04:14:53 UTC (rev 27275)
+++ scummvm/branches/branch-0-10-0/engines/agos/agos.cpp	2007-06-10 04:16:04 UTC (rev 27276)
@@ -136,6 +136,7 @@
 	_numVars = 0;
 	_numVideoOpcodes = 0;
 	_vgaBaseDelay = 0;
+	_vgaPeriod = 0;
 
 	_strippedTxtMem = 0;
 	_textMem = 0;
@@ -353,8 +354,6 @@
 	_curSfxFile = 0;
 
 	_syncCount = 0;
-	_timer5 = 0;
-	_timer4 = 0;
 
  	_iconToggleCount = 0;
  	_voiceCount = 0;
@@ -708,6 +707,7 @@
 	_tableMemSize = 200000;
 	_frameCount = 1;
 	_vgaBaseDelay = 5;
+	_vgaPeriod = (getGameId() == GID_DIMP) ? 35 : 30;
 	_numBitArray1 = 128;
 	_numItemStore = 10;
 	_numTextBoxes = 40;
@@ -728,6 +728,7 @@
 	_tableMemSize = 200000;
 	_frameCount = 1;
 	_vgaBaseDelay = 5;
+	_vgaPeriod = 50;
 	_numBitArray1 = 16;
 	_numBitArray2 = 16;
 	_numBitArray3 = 16;
@@ -758,6 +759,7 @@
 	_soundIndexBase = 1660 / 4;
 	_frameCount = 1;
 	_vgaBaseDelay = 1;
+	_vgaPeriod = 45;
 	_numBitArray1 = 16;
 	_numBitArray2 = 16;
 	_numItemStore = 10;
@@ -787,6 +789,7 @@
 	_soundIndexBase = 0;
 	_frameCount = 1;
 	_vgaBaseDelay = 1;
+	_vgaPeriod = 50;
 	_numBitArray1 = 16;
 	_numBitArray2 = 16;
 	_numItemStore = 10;
@@ -812,6 +815,7 @@
 	_tableMemSize = 50000;
 	_frameCount = 4;
 	_vgaBaseDelay = 1;
+	_vgaPeriod = 50;
 	_numBitArray1 = 16;
 	_numBitArray2 = 15;
 	_numItemStore = 50;
@@ -835,6 +839,7 @@
 	_tableMemSize = 100000;
 	_frameCount = 4;
 	_vgaBaseDelay = 1;
+	_vgaPeriod = 50;
 	_numBitArray1 = 16;
 	_numBitArray2 = 15;
 	_numItemStore = 50;
@@ -857,6 +862,7 @@
 	_tableMemSize = 256000;
 	_frameCount = 4;
 	_vgaBaseDelay = 1;
+	_vgaPeriod = 50;
 	_numVars = 512;
 
 	_numMusic = 14;

Modified: scummvm/branches/branch-0-10-0/engines/agos/agos.h
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/agos.h	2007-06-10 04:14:53 UTC (rev 27275)
+++ scummvm/branches/branch-0-10-0/engines/agos/agos.h	2007-06-10 04:16:04 UTC (rev 27276)
@@ -199,6 +199,7 @@
 	uint _numBitArray1, _numBitArray2, _numBitArray3;
 	uint _numItemStore, _numVars;
 	uint _vgaBaseDelay;
+	uint _vgaPeriod;
 
 	uint _musicIndexBase;
 	uint _soundIndexBase;
@@ -425,7 +426,7 @@
 	byte *_curVgaFile2;
 	byte *_curSfxFile;
 
-	uint16 _syncCount, _timer5, _timer4;
+	uint16 _syncCount;
 
 	int16 _iconToggleCount, _voiceCount;
 	uint32 _lastTickCount, _thisTickCount;

Modified: scummvm/branches/branch-0-10-0/engines/agos/event.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/event.cpp	2007-06-10 04:14:53 UTC (rev 27275)
+++ scummvm/branches/branch-0-10-0/engines/agos/event.cpp	2007-06-10 04:16:04 UTC (rev 27276)
@@ -424,28 +424,27 @@
 
 	uint32 start = _system->getMillis();
 	uint32 cur = start;
-	uint this_delay, vga_period;
+	uint this_delay, vgaPeriod;
 
 	AudioCD.updateCD();
 
 	if (_debugger->isAttached())
 		_debugger->onFrame();
 
-	if (_fastMode)
-	 	vga_period = 10;
-	else if (getGameType() == GType_SIMON2)
-		vga_period = 45;
-	else
-		vga_period = 50;
+	vgaPeriod = (_fastMode) ? 10 : _vgaPeriod;
+	if (getGameType() == GType_PP && getGameId() != GID_DIMP) {
+		if (vgaPeriod == 15 && _variableArray[999] == 0)
+			vgaPeriod = 30;
+	}
 
 	_rnd.getRandomNumber(2);
 
 	do {
-		while (!_inCallBack && cur >= _lastVgaTick + vga_period && !_pause) {
-			_lastVgaTick += vga_period;
+		while (!_inCallBack && cur >= _lastVgaTick + vgaPeriod && !_pause) {
+			_lastVgaTick += vgaPeriod;
 
 			// don't get too many frames behind
-			if (cur >= _lastVgaTick + vga_period * 2)
+			if (cur >= _lastVgaTick + vgaPeriod * 2)
 				_lastVgaTick = cur;
 
 			_inCallBack = true;
@@ -549,32 +548,10 @@
 }
 
 void AGOSEngine::timer_callback() {
-	// FIXME: _timer5 is never set
-	if (_timer5) {
-		_syncFlag2 = true;
-		_timer5--;
-	} else {
-		if (getGameId() == GID_DIMP) {
-			_thisTickCount = _system->getMillis();
-			if (_thisTickCount < _lastTickCount)
-				_lastTickCount = 0;
-
-			if ((_thisTickCount - _lastTickCount) <= 35)
-				return;
-
-			_lastTickCount = _thisTickCount;
-
-			timer_proc1();
-			dimp_idle();
-		} else {
-			timer_proc1();
-		}
-	}
+	timer_proc1();
 }
 
 void AGOSEngine_Feeble::timer_proc1() {
-	_timer4++;
-
 	if (_lockWord & 0x80E9 || _lockWord & 2)
 		return;
 
@@ -626,8 +603,6 @@
 }
 
 void AGOSEngine::timer_proc1() {
-	_timer4++;
-
 	if (_lockWord & 0x80E9 || _lockWord & 2)
 		return;
 

Modified: scummvm/branches/branch-0-10-0/engines/agos/gfx.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/gfx.cpp	2007-06-10 04:14:53 UTC (rev 27275)
+++ scummvm/branches/branch-0-10-0/engines/agos/gfx.cpp	2007-06-10 04:16:04 UTC (rev 27276)
@@ -1388,9 +1388,6 @@
 				dst++;
 			}
 		}
-
-		_syncFlag2 = 1;
-		_timer5 = 0;
 	}
 
 	_lockWord &= ~0x20;

Modified: scummvm/branches/branch-0-10-0/engines/agos/input.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/input.cpp	2007-06-10 04:14:53 UTC (rev 27275)
+++ scummvm/branches/branch-0-10-0/engines/agos/input.cpp	2007-06-10 04:16:04 UTC (rev 27276)
@@ -542,6 +542,14 @@
 		if (getGameType() == GType_FF)
 			setBitFlag(73, !getBitFlag(73));
 		break;
+	case 37: // F12
+		if (getGameType() == GType_PP && getGameId() != GID_DIMP) {
+			if (!getBitFlag(110)) {
+				setBitFlag(107, !getBitFlag(107));
+				_vgaPeriod = (getBitFlag(107) != 0) ? 15 : 30;
+			}
+		}
+		break;
 	case 'p':
 		pause();
 		break;

Modified: scummvm/branches/branch-0-10-0/engines/agos/script.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/script.cpp	2007-06-10 04:14:53 UTC (rev 27275)
+++ scummvm/branches/branch-0-10-0/engines/agos/script.cpp	2007-06-10 04:16:04 UTC (rev 27276)
@@ -539,7 +539,14 @@
 		return;
 	}
 
-	_picture8600 = (vga_res == 8600);
+	if (getGameType() == GType_PP && getGameId() != GID_DIMP) {
+		if (vga_res == 8700 && getBitFlag(107)) {
+			_vgaPeriod = 30;
+		}
+
+		_picture8600 = (vga_res == 8600);
+	}
+
 	setWindowImageEx(mode, vga_res);
 }
 


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