[Scummvm-cvs-logs] SF.net SVN: scummvm:[40481] scummvm/trunk/engines/sci

waltervn at users.sourceforge.net waltervn at users.sourceforge.net
Tue May 12 14:31:09 CEST 2009


Revision: 40481
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40481&view=rev
Author:   waltervn
Date:     2009-05-12 12:31:09 +0000 (Tue, 12 May 2009)

Log Message:
-----------
SCI: Merged Message() and GetMessage(). Set SCI1.1 to use SCI1 kernel table (for now).

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kstring.cpp
    scummvm/trunk/engines/sci/engine/message.cpp
    scummvm/trunk/engines/sci/scicore/vocab_debug.cpp

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-05-12 12:30:59 UTC (rev 40480)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-05-12 12:31:09 UTC (rev 40481)
@@ -201,7 +201,6 @@
 	/*(?)*/	DEFUN("TimesCot", kTimesCot, "ii"),
 	/*(?)*/	DEFUN("TimesTan", kTimesTan, "ii"),
 	DEFUN("Message", kMessage, ".*"),
-	DEFUN("GetMessage", kGetMessage, "iiir"),
 	DEFUN("DoAudio", kDoAudio, ".*"),
 	DEFUN("DoSync", kDoSync, ".*"),
 

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-05-12 12:30:59 UTC (rev 40480)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-05-12 12:31:09 UTC (rev 40481)
@@ -451,7 +451,6 @@
 reg_t kTextSize(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kIsItSkip(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kMessage(EngineState *s, int funct_nr, int argc, reg_t *argv);
-reg_t kGetMessage(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kDoSync(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t k_Unknown(EngineState *s, int funct_nr, int argc, reg_t *argv);

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-05-12 12:30:59 UTC (rev 40480)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-05-12 12:31:09 UTC (rev 40481)
@@ -729,6 +729,27 @@
 reg_t kMessage(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	MessageTuple tuple;
 
+	if (argc == 4) {
+		// Earlier version of of this function (GetMessage)
+		tuple.noun = UKPV(0);
+		int module = UKPV(1);
+		tuple.verb = UKPV(2);
+		tuple.cond = 0;
+		tuple.seq = 1;
+
+		if (state.loadRes(s->resmgr, module, true) && state.getMessage(&tuple)) {
+			int len = state.getLength();
+			char *buffer = kernel_dereference_char_pointer(s, argv[3], len + 1);
+
+			if (buffer) {
+				state.getText(buffer);
+				return argv[3];
+			}
+		}
+
+		return NULL_REG;
+	}
+
 	switch (UKPV(0)) {
 	case 0:
 	case 2:
@@ -807,25 +828,4 @@
 	return NULL_REG;
 }
 
-reg_t kGetMessage(EngineState *s, int funct_nr, int argc, reg_t *argv) {
-	MessageTuple tuple;
-	tuple.noun = UKPV(0);
-	int module = UKPV(1);
-	tuple.verb = UKPV(2);
-	tuple.cond = 0;
-	tuple.seq = 0;
-
-	if (state.loadRes(s->resmgr, module, true) && state.getMessage(&tuple)) {
-		int len = state.getLength();
-		char *buffer = kernel_dereference_char_pointer(s, argv[3], len + 1);
-
-		if (buffer) {
-			state.getText(buffer);
-			return argv[3];
-		}
-	}
-
-	return NULL_REG;
-}
-
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/engine/message.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/message.cpp	2009-05-12 12:30:59 UTC (rev 40480)
+++ scummvm/trunk/engines/sci/engine/message.cpp	2009-05-12 12:31:09 UTC (rev 40481)
@@ -33,7 +33,7 @@
 	t->verb = *(cursor->index_record + 1);
 	if (_version == 2101) {
 		t->cond = 0;
-		t->seq = 0;
+		t->seq = 1;
 	} else {
 		t->cond = *(cursor->index_record + 2);
 		t->seq = *(cursor->index_record + 3);

Modified: scummvm/trunk/engines/sci/scicore/vocab_debug.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/vocab_debug.cpp	2009-05-12 12:30:59 UTC (rev 40480)
+++ scummvm/trunk/engines/sci/scicore/vocab_debug.cpp	2009-05-12 12:31:09 UTC (rev 40481)
@@ -276,7 +276,7 @@
 	/*0x79*/ "ATan",
 	/*0x7a*/ "Lock",         
 	/*0x7b*/ "StrSplit",       
-	/*0x7c*/ "GetMessage",
+	/*0x7c*/ "Message",
 	/*0x7d*/ "IsItSkip"
 };
 
@@ -456,7 +456,7 @@
 		names[i] = sci1_default_knames[i];
 }
 
-//
+#ifdef ENABLE_SCI32
 static void vocabulary_get_knames11(ResourceManager *resmgr, Common::StringList &names) {
 /*
  999.voc format for SCI1.1 games:
@@ -481,6 +481,7 @@
 		names[i] = Common::String((char *)r->data + off + 2, len);
 	}
 }
+#endif
 
 void vocabulary_get_knames(ResourceManager *resmgr, Common::StringList &names) {
 	names.clear();
@@ -502,7 +503,7 @@
 		vocabulary_get_knames1(resmgr, names);
 		break;
 	case SCI_VERSION_1_1:
-		vocabulary_get_knames11(resmgr, names);
+		vocabulary_get_knames1(resmgr, names);
 		break;
 #ifdef ENABLE_SCI32
 	case SCI_VERSION_32:


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