[Scummvm-cvs-logs] SF.net SVN: scummvm: [24081] scummvm/trunk/engines/agos/vga.cpp

kirben at users.sourceforge.net kirben at users.sourceforge.net
Mon Oct 2 23:41:24 CEST 2006


Revision: 24081
          http://svn.sourceforge.net/scummvm/?rev=24081&view=rev
Author:   kirben
Date:     2006-10-02 14:41:18 -0700 (Mon, 02 Oct 2006)

Log Message:
-----------
Fix crashes in swampy when moving blocks

Modified Paths:
--------------
    scummvm/trunk/engines/agos/vga.cpp

Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp	2006-10-02 21:38:39 UTC (rev 24080)
+++ scummvm/trunk/engines/agos/vga.cpp	2006-10-02 21:41:18 UTC (rev 24081)
@@ -637,7 +637,13 @@
 }
 
 void AGOSEngine::vc5_skip_if_neq() {
-	uint16 var = vcReadNextWord();
+	uint16 var;
+
+	if (getGameType() == GType_PP)
+		var = vcReadVarOrWord();
+	else
+		var = vcReadNextWord();
+
 	uint16 value = vcReadNextWord();
 	if (vcReadVar(var) != value)
 		vcSkipNextInstruction();
@@ -1254,7 +1260,15 @@
 		return;
 
 	uint offs, offs2;
-	if (getGameType() == GType_WW) {
+	if (getGameType() == GType_ELVIRA) {
+		if (_windowNum == 2 || _windowNum == 3) {
+			offs = state->x * 8;
+			offs2 = state->y;
+		} else {
+			offs = ((vlut[0] - _video_windows[16]) * 2 + state->x) * 8;
+			offs2 = (vlut[1] - _video_windows[17] + state->y);
+		}
+	} else if (getGameType() == GType_WW) {
 		//if (_windowNum == 4 || _windowNum >= 10) {
 			offs = state->x * 8;
 			offs2 = state->y;
@@ -1981,13 +1995,23 @@
 }
 
 void AGOSEngine::vc38_skipIfVarZero() {
-	uint16 var = vcReadNextWord();
+	uint16 var;
+	if (getGameType() == GType_PP)
+		var = vcReadVarOrWord();
+	else
+		var = vcReadNextWord();
+
 	if (vcReadVar(var) == 0)
 		vcSkipNextInstruction();
 }
 
 void AGOSEngine::vc39_setVar() {
-	uint16 var = vcReadNextWord();
+	uint16 var;
+	if (getGameType() == GType_PP)
+		var = vcReadVarOrWord();
+	else
+		var = vcReadNextWord();
+
 	int16 value = vcReadNextWord();
 	vcWriteVar(var, value);
 }
@@ -2403,14 +2427,19 @@
 }
 
 void AGOSEngine::vc60_killSprite() {
-	uint16 zoneNum;
+	uint16 sprite, zoneNum;
 
-	if (getGameType() == GType_SIMON1) {
+	if (getGameType() == GType_PP) {
+		zoneNum = vcReadNextWord();
+		sprite = vcReadVarOrWord();
+	} else if (getGameType() == GType_SIMON2 || getGameType() == GType_FF) {
+		zoneNum = vcReadNextWord();
+		sprite = vcReadNextWord();
+	} else {
 		zoneNum = _vgaCurZoneNum;
-	} else {
-		zoneNum = vcReadNextWord();
+		sprite = vcReadNextWord();
 	}
-	uint16 sprite = vcReadNextWord();
+
 	vc_kill_sprite(zoneNum, sprite);
 }
 


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