[Scummvm-cvs-logs] SF.net SVN: scummvm:[40012] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 19 03:01:09 CEST 2009


Revision: 40012
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40012&view=rev
Author:   fingolfin
Date:     2009-04-19 01:01:09 +0000 (Sun, 19 Apr 2009)

Log Message:
-----------
SCUMM:  ScummEngine_v5::o5_oldRoomEffect -> ScummEngine_v4::o4_oldRoomEffect

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/script_v4.cpp
    scummvm/trunk/engines/scumm/script_v5.cpp
    scummvm/trunk/engines/scumm/scumm_v4.h
    scummvm/trunk/engines/scumm/scumm_v5.h

Modified: scummvm/trunk/engines/scumm/script_v4.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v4.cpp	2009-04-19 01:00:49 UTC (rev 40011)
+++ scummvm/trunk/engines/scumm/script_v4.cpp	2009-04-19 01:01:09 UTC (rev 40012)
@@ -42,6 +42,9 @@
 
 	OPCODE(0x50, o4_pickupObject);
 	OPCODE(0xd0, o4_pickupObject);
+
+	OPCODE(0x5c, o4_oldRoomEffect);
+	OPCODE(0xdc, o4_oldRoomEffect);
 }
 
 void ScummEngine_v4::o4_pickupObject() {
@@ -67,4 +70,76 @@
 	runInventoryScript(1);
 }
 
+void ScummEngine_v4::o4_oldRoomEffect() {
+	int a;
+
+	_opcode = fetchScriptByte();
+	if ((_opcode & 0x1F) == 3) {
+		a = getVarOrDirectWord(PARAM_1);
+
+#if 1
+		if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
+			// FIXME / TODO: OK the first thing to note is: at least in Zak256,
+			// maybe also in other games, this opcode does a bit more. I added
+			// some stubs here, but somebody with a full IDA or more knowledge
+			// about this will have to fill in the gaps. At least now we know
+			// that something is missing here :-)
+
+			if (a == 4) {
+				//printf("o5_oldRoomEffect ODDBALL: _opcode = 0x%x, a = 0x%x\n", _opcode, a);
+				// No idea what byte_2FCCF is, but it's a globale boolean flag.
+				// I only add it here as a temporary hack to make the pseudo code compile.
+				// Maybe it is just there as a reentry protection guard, given
+				// how it is used? It might also correspond to _screenEffectFlag.
+				int byte_2FCCF = 0;
+
+				// For now, we force a redraw of the screen background. This
+				// way the Zak end credits seem to work mostly correct.
+				VirtScreen *vs = &_virtscr[kMainVirtScreen];
+				restoreBackground(Common::Rect(0, vs->topline, vs->w, vs->topline + vs->h));
+				vs->setDirtyRange(0, vs->h);
+				updateDirtyScreen(kMainVirtScreen);
+
+				if (byte_2FCCF) {
+					// Here now "sub_1C44" is called, which sets byte_2FCCF to 0 then
+					// calls yet another sub (which also reads byte_2FCCF):
+
+					byte_2FCCF = 0;
+					//call sub_0BB3
+
+
+					// Now sub_085C is called. This is quite simply: it sets
+					// 0xF000 bytes. starting at 0x40000 to 0. No idea what that
+					// buffer is, maybe a screen buffer, though. Note that
+					// 0xF000 = 320*192.
+					// Maybe this is also the charset mask being cleaned?
+
+					// call sub_085C
+
+
+					// And then sub_1C54 is called, which is almost identical to
+					// the above sub_1C44, only it sets byte_2FCCF to 1:
+
+					byte_2FCCF = 1;
+					// call sub_0BB3
+
+				} else {
+					// Here only sub_085C is called (see comment above)
+
+					// call sub_085C
+				}
+			return;
+			}
+#endif
+
+		}
+		if (a) {
+			_switchRoomEffect = (byte)(a & 0xFF);
+			_switchRoomEffect2 = (byte)(a >> 8);
+		} else {
+			fadeIn(_newEffect);
+		}
+	}
+}
+
 } // End of namespace Scumm

Modified: scummvm/trunk/engines/scumm/script_v5.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v5.cpp	2009-04-19 01:00:49 UTC (rev 40011)
+++ scummvm/trunk/engines/scumm/script_v5.cpp	2009-04-19 01:01:09 UTC (rev 40012)
@@ -155,7 +155,7 @@
 	OPCODE(0x5a, o5_add);
 	OPCODE(0x5b, o5_divide);
 	/* 5C */
-	OPCODE(0x5c, o5_oldRoomEffect);
+//	OPCODE(0x5c, o5_oldRoomEffect);
 	OPCODE(0x5d, o5_setClass);
 	OPCODE(0x5e, o5_walkActorTo);
 	OPCODE(0x5f, o5_isActorInBox);
@@ -315,7 +315,7 @@
 	OPCODE(0xda, o5_add);
 	OPCODE(0xdb, o5_divide);
 	/* DC */
-	OPCODE(0xdc, o5_oldRoomEffect);
+//	OPCODE(0xdc, o5_oldRoomEffect);
 	OPCODE(0xdd, o5_setClass);
 	OPCODE(0xde, o5_walkActorTo);
 	OPCODE(0xdf, o5_isActorInBox);
@@ -2968,76 +2968,4 @@
 	_string[textSlot].saveDefault();
 }
 
-void ScummEngine_v5::o5_oldRoomEffect() {
-	int a;
-
-	_opcode = fetchScriptByte();
-	if ((_opcode & 0x1F) == 3) {
-		a = getVarOrDirectWord(PARAM_1);
-
-#if 1
-		if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
-			// FIXME / TODO: OK the first thing to note is: at least in Zak256,
-			// maybe also in other games, this opcode does a bit more. I added
-			// some stubs here, but somebody with a full IDA or more knowledge
-			// about this will have to fill in the gaps. At least now we know
-			// that something is missing here :-)
-
-			if (a == 4) {
-				//printf("o5_oldRoomEffect ODDBALL: _opcode = 0x%x, a = 0x%x\n", _opcode, a);
-				// No idea what byte_2FCCF is, but it's a globale boolean flag.
-				// I only add it here as a temporary hack to make the pseudo code compile.
-				// Maybe it is just there as a reentry protection guard, given
-				// how it is used? It might also correspond to _screenEffectFlag.
-				int byte_2FCCF = 0;
-
-				// For now, we force a redraw of the screen background. This
-				// way the Zak end credits seem to work mostly correct.
-				VirtScreen *vs = &_virtscr[kMainVirtScreen];
-				restoreBackground(Common::Rect(0, vs->topline, vs->w, vs->topline + vs->h));
-				vs->setDirtyRange(0, vs->h);
-				updateDirtyScreen(kMainVirtScreen);
-
-				if (byte_2FCCF) {
-					// Here now "sub_1C44" is called, which sets byte_2FCCF to 0 then
-					// calls yet another sub (which also reads byte_2FCCF):
-
-					byte_2FCCF = 0;
-					//call sub_0BB3
-
-
-					// Now sub_085C is called. This is quite simply: it sets
-					// 0xF000 bytes. starting at 0x40000 to 0. No idea what that
-					// buffer is, maybe a screen buffer, though. Note that
-					// 0xF000 = 320*192.
-					// Maybe this is also the charset mask being cleaned?
-
-					// call sub_085C
-
-
-					// And then sub_1C54 is called, which is almost identical to
-					// the above sub_1C44, only it sets byte_2FCCF to 1:
-
-					byte_2FCCF = 1;
-					// call sub_0BB3
-
-				} else {
-					// Here only sub_085C is called (see comment above)
-
-					// call sub_085C
-				}
-			return;
-			}
-#endif
-
-		}
-		if (a) {
-			_switchRoomEffect = (byte)(a & 0xFF);
-			_switchRoomEffect2 = (byte)(a >> 8);
-		} else {
-			fadeIn(_newEffect);
-		}
-	}
-}
-
 } // End of namespace Scumm

Modified: scummvm/trunk/engines/scumm/scumm_v4.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm_v4.h	2009-04-19 01:00:49 UTC (rev 40011)
+++ scummvm/trunk/engines/scumm/scumm_v4.h	2009-04-19 01:01:09 UTC (rev 40012)
@@ -52,6 +52,7 @@
 	virtual void resetRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL);
 
 	/* Version 4 script opcodes */
+	void o4_oldRoomEffect();
 	void o4_pickupObject();
 };
 

Modified: scummvm/trunk/engines/scumm/scumm_v5.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm_v5.h	2009-04-19 01:00:49 UTC (rev 40011)
+++ scummvm/trunk/engines/scumm/scumm_v5.h	2009-04-19 01:01:09 UTC (rev 40012)
@@ -156,7 +156,6 @@
 	void o5_move();
 	void o5_multiply();
 	void o5_notEqualZero();
-	void o5_oldRoomEffect();
 	void o5_or();
 	void o5_beginOverride();
 	void o5_panCameraTo();


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