[Scummvm-cvs-logs] SF.net SVN: scummvm:[40070] scummvm/tags/release-0-13-1/engines/agos

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Wed Apr 22 13:52:57 CEST 2009


Revision: 40070
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40070&view=rev
Author:   Kirben
Date:     2009-04-22 11:52:57 +0000 (Wed, 22 Apr 2009)

Log Message:
-----------
Sync fixes for AGOS game engine:
Add work around for bug in English 4CD version of The Feeble Files.
Fix crash that occurs when OmniTV video is played completely, in The Feeble Files.
Fix possible overwriting of sound data in earlier games.
Fix sound effects regression in Waxworks.

Modified Paths:
--------------
    scummvm/tags/release-0-13-1/engines/agos/agos.cpp
    scummvm/tags/release-0-13-1/engines/agos/agos.h
    scummvm/tags/release-0-13-1/engines/agos/animation.cpp
    scummvm/tags/release-0-13-1/engines/agos/event.cpp
    scummvm/tags/release-0-13-1/engines/agos/script_ff.cpp
    scummvm/tags/release-0-13-1/engines/agos/subroutine.cpp
    scummvm/tags/release-0-13-1/engines/agos/vga_e2.cpp
    scummvm/tags/release-0-13-1/engines/agos/zones.cpp

Modified: scummvm/tags/release-0-13-1/engines/agos/agos.cpp
===================================================================
--- scummvm/tags/release-0-13-1/engines/agos/agos.cpp	2009-04-22 11:38:39 UTC (rev 40069)
+++ scummvm/tags/release-0-13-1/engines/agos/agos.cpp	2009-04-22 11:52:57 UTC (rev 40070)
@@ -175,6 +175,7 @@
 	_lastVgaTick = 0;
 
 	_marks = 0;
+ 	_omniTV = false;
 
 	_scriptVar2 = 0;
 	_runScriptReturn1 = 0;

Modified: scummvm/tags/release-0-13-1/engines/agos/agos.h
===================================================================
--- scummvm/tags/release-0-13-1/engines/agos/agos.h	2009-04-22 11:38:39 UTC (rev 40069)
+++ scummvm/tags/release-0-13-1/engines/agos/agos.h	2009-04-22 11:52:57 UTC (rev 40070)
@@ -276,6 +276,7 @@
 	uint32 _lastVgaTick;
 
 	uint16 _marks;
+ 	bool _omniTV;
 
 	bool _scriptVar2;
 	bool _runScriptReturn1;
@@ -855,10 +856,10 @@
 	void writeChar(WindowBlock *window, int x, int y, int offs, int val);
 
 	byte *allocBlock(uint32 size);
-	virtual void checkNoOverWrite();
+	void checkNoOverWrite();
 	void checkRunningAnims();
-	virtual void checkAnims(uint a);
-	virtual void checkZonePtrs();
+	void checkAnims(uint a);
+	void checkZonePtrs();
 	void setZoneBuffers();
 
 	void runVgaScript();
@@ -1710,10 +1711,6 @@
 	void saveUserGame(int slot);
 	void windowBackSpace(WindowBlock *window);
 
-	virtual void checkNoOverWrite();
-	virtual void checkAnims(uint a);
-	virtual void checkZonePtrs();
-
 	virtual char *genSaveName(int slot);
 };
 

Modified: scummvm/tags/release-0-13-1/engines/agos/animation.cpp
===================================================================
--- scummvm/tags/release-0-13-1/engines/agos/animation.cpp	2009-04-22 11:38:39 UTC (rev 40069)
+++ scummvm/tags/release-0-13-1/engines/agos/animation.cpp	2009-04-22 11:52:57 UTC (rev 40070)
@@ -324,6 +324,7 @@
 		copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);
 	} else {
 		closeFile();
+		_vm->_omniTV = false;
 		_vm->_variableArray[254] = 6747;
 	}
 }
@@ -431,11 +432,6 @@
 }
 
 void MoviePlayerSMK::nextFrame() {
-	if (_vm->getBitFlag(42)) {
-		closeFile();
-		return;
-	}
-
 	if (getCurFrame() < getFrameCount()) {
 		decodeNextFrame();
 		copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);

Modified: scummvm/tags/release-0-13-1/engines/agos/event.cpp
===================================================================
--- scummvm/tags/release-0-13-1/engines/agos/event.cpp	2009-04-22 11:38:39 UTC (rev 40069)
+++ scummvm/tags/release-0-13-1/engines/agos/event.cpp	2009-04-22 11:52:57 UTC (rev 40070)
@@ -580,9 +580,10 @@
 			}
 		}
 
-		if (getGameType() == GType_FF && _moviePlayer) {
+		if (getGameType() == GType_FF && _omniTV) {
 			// Controls Omni TV videos
 			if (getBitFlag(42)) {
+				_omniTV = false;
 				_moviePlayer->stopVideo();
 				delete _moviePlayer;
 				_moviePlayer = NULL;

Modified: scummvm/tags/release-0-13-1/engines/agos/script_ff.cpp
===================================================================
--- scummvm/tags/release-0-13-1/engines/agos/script_ff.cpp	2009-04-22 11:38:39 UTC (rev 40069)
+++ scummvm/tags/release-0-13-1/engines/agos/script_ff.cpp	2009-04-22 11:52:57 UTC (rev 40070)
@@ -574,6 +574,8 @@
 	if (getBitFlag(40)) {
 		// Omni TV controls
 		if (_moviePlayer) {
+			setBitFlag(42, false);
+			_omniTV = true;
 			_moviePlayer->play();
 		} else {
 			_variableArray[254] = 6747;

Modified: scummvm/tags/release-0-13-1/engines/agos/subroutine.cpp
===================================================================
--- scummvm/tags/release-0-13-1/engines/agos/subroutine.cpp	2009-04-22 11:38:39 UTC (rev 40069)
+++ scummvm/tags/release-0-13-1/engines/agos/subroutine.cpp	2009-04-22 11:52:57 UTC (rev 40070)
@@ -578,6 +578,22 @@
 		sl = (SubroutineLine *)((byte *)sub + sl->next);
 	}
 
+	// WORKAROUND: Feeble walks in the incorrect direction, when looking at the Vent in the Research and Testing area of
+	// the Company Central Command Compound. We manually add the extra script code from the updated English 2CD release, 
+	// which fixed this particular script bug.
+	if (getGameType() == GType_FF && _language == Common::EN_ANY) {
+		if (sub->id == 39125 && readVariable(84) == 2) {
+			writeVariable(1, 1136);
+			writeVariable(2, 346);
+		}
+		if (sub->id == 39126 && readVariable(84) == 2) {
+			Subroutine *tmpSub = getSubroutineByID(80);
+			if (tmpSub != NULL) {
+				startSubroutine(tmpSub);
+			}
+		}
+	}
+
 	if (_classMode1) {
 		_subjectItem = nextInByClass(_subjectItem, _classMask);
 		if (!_subjectItem) {

Modified: scummvm/tags/release-0-13-1/engines/agos/vga_e2.cpp
===================================================================
--- scummvm/tags/release-0-13-1/engines/agos/vga_e2.cpp	2009-04-22 11:38:39 UTC (rev 40069)
+++ scummvm/tags/release-0-13-1/engines/agos/vga_e2.cpp	2009-04-22 11:52:57 UTC (rev 40070)
@@ -195,6 +195,8 @@
 		_sound->playEffects(sound);
 	} else if (getGameId() == GID_SIMON1DOS) {
 		playSting(sound);
+	} else if (getGameType() == GType_WW) {
+		// TODO: Sound effects in PC version only
 	} else {
 		loadSound(sound);
 	}

Modified: scummvm/tags/release-0-13-1/engines/agos/zones.cpp
===================================================================
--- scummvm/tags/release-0-13-1/engines/agos/zones.cpp	2009-04-22 11:38:39 UTC (rev 40069)
+++ scummvm/tags/release-0-13-1/engines/agos/zones.cpp	2009-04-22 11:52:57 UTC (rev 40070)
@@ -140,7 +140,7 @@
 
 void AGOSEngine::checkRunningAnims() {
 	VgaSprite *vsp;
-	if (getGameType() != GType_FF && getGameType() != GType_PP &&
+	if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&
 		(_lockWord & 0x20)) {
 		return;
 	}
@@ -152,7 +152,7 @@
 	}
 }
 
-void AGOSEngine_Feeble::checkNoOverWrite() {
+void AGOSEngine::checkNoOverWrite() {
 	VgaPointersEntry *vpe;
 
 	if (_noOverWrite == 0xFFFF)
@@ -174,7 +174,7 @@
 	}
 }
 
-void AGOSEngine_Feeble::checkAnims(uint a) {
+void AGOSEngine::checkAnims(uint a) {
 	VgaPointersEntry *vpe;
 
 	vpe = &_vgaBufferPointers[a];
@@ -193,7 +193,7 @@
 	}
 }
 
-void AGOSEngine_Feeble::checkZonePtrs() {
+void AGOSEngine::checkZonePtrs() {
 	uint count = ARRAYSIZE(_vgaBufferPointers);
 	VgaPointersEntry *vpe = _vgaBufferPointers;
 	do {
@@ -210,49 +210,6 @@
 	} while (++vpe, --count);
 }
 
-void AGOSEngine::checkNoOverWrite() {
-	VgaPointersEntry *vpe;
-
-	if (_noOverWrite == 0xFFFF)
-		return;
-
-	vpe = &_vgaBufferPointers[_noOverWrite];
-
-	if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) ||
-		((_vgaMemPtr <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) {
-		_rejectBlock = true;
-		_vgaMemPtr = vpe->vgaFile1 + 0x5000;
-	} else {
-		_rejectBlock = false;
-	}
-}
-
-void AGOSEngine::checkAnims(uint a) {
-	VgaPointersEntry *vpe;
-
-	vpe = &_vgaBufferPointers[a];
-
-	if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) ||
-			((_block <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) {
-		_rejectBlock = true;
-		_vgaMemPtr = vpe->vgaFile1 + 0x5000;
-	} else {
-		_rejectBlock = false;
-	}
-}
-
-void AGOSEngine::checkZonePtrs() {
-	uint count = ARRAYSIZE(_vgaBufferPointers);
-	VgaPointersEntry *vpe = _vgaBufferPointers;
-	do {
-		if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) ||
-			((_block <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) {
-			vpe->vgaFile1 = NULL;
-			vpe->vgaFile2 = NULL;
-		}
-	} while (++vpe, --count);
-}
-
 } // End of namespace AGOS
 
 


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