[Scummvm-cvs-logs] SF.net SVN: scummvm:[55514] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Tue Jan 25 03:50:27 CET 2011


Revision: 55514
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55514&view=rev
Author:   drmccoy
Date:     2011-01-25 02:50:26 +0000 (Tue, 25 Jan 2011)

Log Message:
-----------
GOB: o7_draw0x8C is o7_getSystemProperty

Modified Paths:
--------------
    scummvm/trunk/engines/gob/inter.h
    scummvm/trunk/engines/gob/inter_v7.cpp

Modified: scummvm/trunk/engines/gob/inter.h
===================================================================
--- scummvm/trunk/engines/gob/inter.h	2011-01-25 02:17:05 UTC (rev 55513)
+++ scummvm/trunk/engines/gob/inter.h	2011-01-25 02:50:26 UTC (rev 55514)
@@ -600,7 +600,7 @@
 	void o7_draw0x57();
 	void o7_draw0x89();
 	void o7_draw0x8A();
-	void o7_draw0x8C();
+	void o7_getSystemProperty();
 	void o7_draw0x90();
 	void o7_draw0x93();
 	void o7_draw0xA1();
@@ -609,6 +609,10 @@
 	void o7_draw0xC4();
 	void o7_draw0xC5();
 	void o7_draw0xC6();
+
+private:
+	void storeValue(uint16 index, uint16 type, uint32 value);
+	void storeValue(uint32 value);
 };
 
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/inter_v7.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v7.cpp	2011-01-25 02:17:05 UTC (rev 55513)
+++ scummvm/trunk/engines/gob/inter_v7.cpp	2011-01-25 02:50:26 UTC (rev 55514)
@@ -29,6 +29,7 @@
 #include "gob/inter.h"
 #include "gob/game.h"
 #include "gob/script.h"
+#include "gob/expression.h"
 
 namespace Gob {
 
@@ -50,7 +51,7 @@
 	OPCODEDRAW(0x57, o7_draw0x57);
 	OPCODEDRAW(0x89, o7_draw0x89);
 	OPCODEDRAW(0x8A, o7_draw0x8A);
-	OPCODEDRAW(0x8C, o7_draw0x8C);
+	OPCODEDRAW(0x8C, o7_getSystemProperty);
 	OPCODEDRAW(0x90, o7_draw0x90);
 	OPCODEDRAW(0x93, o7_draw0x93);
 	OPCODEDRAW(0xA1, o7_draw0xA1);
@@ -135,13 +136,30 @@
 	warning("Addy Stub Draw 0x8A: \"%s\", %d, %d", str0.c_str(), index0, index1);
 }
 
-void Inter_v7::o7_draw0x8C() {
+void Inter_v7::o7_getSystemProperty() {
 	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
 
-	int16 index0 = _vm->_game->_script->readVarIndex();
+	if (!scumm_stricmp(_vm->_game->_script->getResultStr(), "TotalPhys")) {
+		// HACK
+		storeValue(1000000);
+		return;
+	}
 
-	warning("Addy Stub Draw 0x8C: \"%s\", %d", str0.c_str(), index0);
+	if (!scumm_stricmp(_vm->_game->_script->getResultStr(), "AvailPhys")) {
+		// HACK
+		storeValue(1000000);
+		return;
+	}
+
+	if (!scumm_stricmp(_vm->_game->_script->getResultStr(), "TimeGMT")) {
+		renewTimeInVars();
+		storeValue(0);
+		return;
+	}
+
+	warning("Inter_v7::o7_getSystemProperty(): Unknown property \"%s\"",
+			_vm->_game->_script->getResultStr());
+	storeValue(0);
 }
 
 void Inter_v7::o7_draw0x90() {
@@ -239,4 +257,29 @@
 			str0.c_str(), str1.c_str(), str2.c_str(), str3.c_str(), index0);
 }
 
+void Inter_v7::storeValue(uint16 index, uint16 type, uint32 value) {
+	switch (type) {
+	case OP_ARRAY_INT8:
+	case TYPE_VAR_INT8:
+		WRITE_VARO_UINT8(index, value);
+		break;
+
+	case TYPE_VAR_INT16:
+	case TYPE_VAR_INT32_AS_INT16:
+	case TYPE_ARRAY_INT16:
+		WRITE_VARO_UINT16(index, value);
+		break;
+
+	default:
+		WRITE_VARO_UINT32(index, value);
+	}
+}
+
+void Inter_v7::storeValue(uint32 value) {
+	uint16 type;
+	uint16 index = _vm->_game->_script->readVarIndex(0, &type);
+
+	storeValue(index, type, value);
+}
+
 } // End of namespace Gob


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