[Scummvm-cvs-logs] SF.net SVN: scummvm: [25311] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Wed Jan 31 17:23:35 CET 2007


Revision: 25311
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25311&view=rev
Author:   drmccoy
Date:     2007-01-31 08:23:34 -0800 (Wed, 31 Jan 2007)

Log Message:
-----------
Replaced the delay in o1_keyFunc with a (skipable) busy-wait detection

Modified Paths:
--------------
    scummvm/trunk/engines/gob/detection.cpp
    scummvm/trunk/engines/gob/inter.cpp
    scummvm/trunk/engines/gob/inter.h
    scummvm/trunk/engines/gob/inter_v1.cpp
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/sound.cpp

Modified: scummvm/trunk/engines/gob/detection.cpp
===================================================================
--- scummvm/trunk/engines/gob/detection.cpp	2007-01-31 15:19:42 UTC (rev 25310)
+++ scummvm/trunk/engines/gob/detection.cpp	2007-01-31 16:23:34 UTC (rev 25311)
@@ -388,6 +388,17 @@
 	{
 		{
 			"gob3",
+			"",
+			AD_ENTRY1("intro.stk", "bd679eafde2084d8011f247e51b5a805"),
+			UNK_LANG,
+			kPlatformAmiga,
+		},
+		GF_GOB2,
+		"intro"
+	},
+	{
+		{
+			"gob3",
 			"CD 1.000",
 			AD_ENTRY1("intro.stk", "6f2c226c62dd7ab0ab6f850e89d3fc47"),
 			UNK_LANG,

Modified: scummvm/trunk/engines/gob/inter.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter.cpp	2007-01-31 15:19:42 UTC (rev 25310)
+++ scummvm/trunk/engines/gob/inter.cpp	2007-01-31 16:23:34 UTC (rev 25311)
@@ -42,6 +42,7 @@
 Inter::Inter(GobEngine *vm) : _vm(vm) {
 	int i;
 
+	_noBusyWait = false;
 	_terminate = false;
 	_breakFlag = false;
 	

Modified: scummvm/trunk/engines/gob/inter.h
===================================================================
--- scummvm/trunk/engines/gob/inter.h	2007-01-31 15:19:42 UTC (rev 25310)
+++ scummvm/trunk/engines/gob/inter.h	2007-01-31 16:23:34 UTC (rev 25311)
@@ -74,6 +74,9 @@
 protected:
 	GobEngine *_vm;
 
+	// The busy-wait detection in o1_keyFunc breaks fast scrolling in Ween
+	bool _noBusyWait;
+
 	virtual void setupOpcodes(void) = 0;
 	virtual void executeDrawOpcode(byte i) = 0;
 	virtual bool executeFuncOpcode(byte i, byte j, char &cmdCount, int16 &counter, int16 &retFlag) = 0;

Modified: scummvm/trunk/engines/gob/inter_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v1.cpp	2007-01-31 15:19:42 UTC (rev 25310)
+++ scummvm/trunk/engines/gob/inter_v1.cpp	2007-01-31 16:23:34 UTC (rev 25311)
@@ -1335,13 +1335,19 @@
 bool Inter_v1::o1_keyFunc(char &cmdCount, int16 &counter, int16 &retFlag) {
 	int16 flag;
 	int16 key;
+	uint32 now;
+	static uint32 lastCalled = 0;
 
 	flag = load16();
 	animPalette();
 	_vm->_draw->blitInvalidated();
 
-	// Gob2 busy-waits here, so add a delay
-	_vm->_util->longDelay(1);
+	now = _vm->_util->getTimeKey();
+	if (!_noBusyWait)
+		if ((now - lastCalled) <= 20)
+			_vm->_util->longDelay(20);
+	lastCalled = now;
+	_noBusyWait = false;
 
 	if (flag != 0) {
 
@@ -1774,7 +1780,6 @@
 	// Skipping the copy protection screen in Gobliins 2
 	if (!_vm->_copyProtection && (_vm->_features & GF_GOB2) && (offset == 1746)
 			&& !scumm_stricmp(_vm->_game->_curTotFile, _vm->_startTot0)) {
-		warning("=> Skipping copy protection screen");
 		debugC(2, kDebugGameFlow, "Skipping copy protection screen");
 		_vm->_global->_inter_execPtr += 2;
 		return false;

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2007-01-31 15:19:42 UTC (rev 25310)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2007-01-31 16:23:34 UTC (rev 25311)
@@ -2205,6 +2205,8 @@
 		_vm->_draw->_word_2FC9C = _vm->_parse->parseValExpr();
 	}
 	_vm->_video->_scrollOffset = _vm->_draw->_word_2FC9E;
+	_vm->_video->waitRetrace(_vm->_global->_videoMode);
+	_noBusyWait = true;
 
 /*
 	if (_vm->_draw->_off_2E51B != 0)

Modified: scummvm/trunk/engines/gob/sound.cpp
===================================================================
--- scummvm/trunk/engines/gob/sound.cpp	2007-01-31 15:19:42 UTC (rev 25310)
+++ scummvm/trunk/engines/gob/sound.cpp	2007-01-31 16:23:34 UTC (rev 25311)
@@ -262,18 +262,18 @@
 		}
 
 		if (_fade) {
-			if (++_curFadeSamples < _fadeSamples) {
-				_fadeVol -= _fadeVolStep;
-			} else {
+			if (++_curFadeSamples >= _fadeSamples) {
 				if (_fadeVolStep > 0) {
 					_data = 0;
 					_end = true;
 					_playingSound = 0;
+					_compositionPos = -1;
 				} else {
 					_fadeVol = 255.0;
 					_fade = false;
 				}
-			}
+			} else
+				_fadeVol -= _fadeVolStep;
 		}
 	}
 	return numSamples;


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