From d64ea1ad87066aae2fae5f06b70d7b0358b78af9 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Thu, 1 Jun 2006 12:06:53 +0000 Subject: Fix wait timeout during introduction of demo version of Simon the Sorcerer 1 (With speech) svn-id: r22815 --- engines/simon/simon.cpp | 15 +++++++++++++++ engines/simon/simon.h | 4 ++-- engines/simon/vga.cpp | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'engines/simon') diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index 865a3c9765..ea8fedfc68 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -281,7 +281,10 @@ SimonEngine::SimonEngine(OSystem *syst) _frameRate = 0; _zoneNumber = 0; + _vgaWaitFor = 0; + _lastVgaWaitFor = 0; + _vgaCurZoneNum = 0; _vgaCurSpriteId = 0; _vgaCurSpritePriority = 0; @@ -1571,6 +1574,15 @@ void SimonEngine::set_video_mode_internal(uint16 mode, uint16 vga_res_id) { void SimonEngine::waitForSync(uint a) { const uint maxCount = (getGameType() == GType_SIMON1) ? 500 : 1000; + if (getGameType() == GType_SIMON1 && (getFeatures() & GF_TALKIE)) { + if (a != 200) { + uint16 tmp = _lastVgaWaitFor; + _lastVgaWaitFor = 0; + if (tmp == a) + return; + } + } + _vgaWaitFor = a; _syncCount = 0; _exitCutscene = false; @@ -1779,6 +1791,9 @@ void SimonEngine::loadSprite(uint windowNum, uint zoneNum, uint vgaSpriteId, uin byte *p, *pp; uint count; + if (vgaSpriteId >= 400) + _lastVgaWaitFor = 0; + _lockWord |= 0x40; if (isSpriteLoaded(vgaSpriteId, zoneNum)) { diff --git a/engines/simon/simon.h b/engines/simon/simon.h index 6e4dc1805b..1d1b8ba85c 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -377,8 +377,8 @@ protected: uint16 _frameRate; uint16 _zoneNumber; - uint16 _vgaWaitFor, _vgaCurZoneNum; - uint16 _vgaCurSpriteId; + uint16 _vgaWaitFor, _lastVgaWaitFor; + uint16 _vgaCurSpriteId, _vgaCurZoneNum; uint16 _vgaCurSpritePriority; int16 _baseY; diff --git a/engines/simon/vga.cpp b/engines/simon/vga.cpp index dd381b1887..98a0c4953c 100644 --- a/engines/simon/vga.cpp +++ b/engines/simon/vga.cpp @@ -1540,6 +1540,7 @@ void SimonEngine::vc15_sync() { } } + _lastVgaWaitFor = id; /* clear a wait event */ if (id == _vgaWaitFor) _vgaWaitFor = 0; @@ -1713,6 +1714,8 @@ void SimonEngine::vc27_resetSprite() { _lockWord |= 8; + _lastVgaWaitFor = 0; + memset(&bak, 0, sizeof(bak)); vsp = _vgaSprites; -- cgit v1.2.3