diff options
author | Sven Hesse | 2007-01-31 16:23:34 +0000 |
---|---|---|
committer | Sven Hesse | 2007-01-31 16:23:34 +0000 |
commit | 8b4001f4908c2653338521d297661fc6faa169ea (patch) | |
tree | 35eced088b6119ad29efad121ec1ce5d35eb884f /engines/gob | |
parent | 17e70efe13a77d94a78e09591ab84ed78abcdda0 (diff) | |
download | scummvm-rg350-8b4001f4908c2653338521d297661fc6faa169ea.tar.gz scummvm-rg350-8b4001f4908c2653338521d297661fc6faa169ea.tar.bz2 scummvm-rg350-8b4001f4908c2653338521d297661fc6faa169ea.zip |
Replaced the delay in o1_keyFunc with a (skipable) busy-wait detection
svn-id: r25311
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/detection.cpp | 11 | ||||
-rw-r--r-- | engines/gob/inter.cpp | 1 | ||||
-rw-r--r-- | engines/gob/inter.h | 3 | ||||
-rw-r--r-- | engines/gob/inter_v1.cpp | 11 | ||||
-rw-r--r-- | engines/gob/inter_v2.cpp | 2 | ||||
-rw-r--r-- | engines/gob/sound.cpp | 8 |
6 files changed, 29 insertions, 7 deletions
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 1b3c5ac5af..91a65c5700 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -388,6 +388,17 @@ static const GOBGameDescription gameDescriptions[] = { { { "gob3", + "", + AD_ENTRY1("intro.stk", "bd679eafde2084d8011f247e51b5a805"), + UNK_LANG, + kPlatformAmiga, + }, + GF_GOB2, + "intro" + }, + { + { + "gob3", "CD 1.000", AD_ENTRY1("intro.stk", "6f2c226c62dd7ab0ab6f850e89d3fc47"), UNK_LANG, diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp index 2fa2f79645..ca3733818a 100644 --- a/engines/gob/inter.cpp +++ b/engines/gob/inter.cpp @@ -42,6 +42,7 @@ namespace Gob { Inter::Inter(GobEngine *vm) : _vm(vm) { int i; + _noBusyWait = false; _terminate = false; _breakFlag = false; diff --git a/engines/gob/inter.h b/engines/gob/inter.h index 10d32a1e97..f0c4812bc9 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -74,6 +74,9 @@ public: 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; diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index e130293d63..703a4d6d64 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -1335,13 +1335,19 @@ bool Inter_v1::o1_loadTot(char &cmdCount, int16 &counter, int16 &retFlag) { 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 @@ bool Inter_v1::o1_callSub(char &cmdCount, int16 &counter, int16 &retFlag) { // 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; diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 83c8819ec2..53fb283d01 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -2205,6 +2205,8 @@ void Inter_v2::o2_setScrollOffset(void) { _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) diff --git a/engines/gob/sound.cpp b/engines/gob/sound.cpp index c29c8ff80d..9ee1cb2f98 100644 --- a/engines/gob/sound.cpp +++ b/engines/gob/sound.cpp @@ -262,18 +262,18 @@ int Snd::readBuffer(int16 *buffer, const int numSamples) { } 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; |