[Scummvm-cvs-logs] SF.net SVN: scummvm:[47684] scummvm/trunk/engines/sci/engine/vm.cpp

lskovlun at users.sourceforge.net lskovlun at users.sourceforge.net
Fri Jan 29 23:29:04 CET 2010


Revision: 47684
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47684&view=rev
Author:   lskovlun
Date:     2010-01-29 22:29:03 +0000 (Fri, 29 Jan 2010)

Log Message:
-----------
Document my last change

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/vm.cpp

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2010-01-29 22:17:27 UTC (rev 47683)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-01-29 22:29:03 UTC (rev 47684)
@@ -896,6 +896,17 @@
 		case op_uge_: // 0x14 (20)
 			s->r_prev = s->r_acc;
 			r_temp = POP32();
+
+			// SCI0/SCI1 scripts use this to check whether a
+			// parameter is a pointer or a far text
+			// reference. It is used e.g. by the standard library
+			// Print function to distinguish two ways of calling it:
+			//
+			// (Print "foo") // Pointer to a string
+			// (Print 420 5) // Reference to the fifth message in text resource 420
+
+			// It works because in those games, the maximum resource number is 999, 
+			// so any parameter value above that threshold must be a pointer. 
 			if (s->r_acc == make_reg(0, 0x3e8))
 				s->r_acc = make_reg(0, r_temp.segment);
 			else if (r_temp.segment && s->r_acc.segment)
@@ -907,6 +918,8 @@
 		case op_ult_: // 0x15 (21)
 			s->r_prev = s->r_acc;
 			r_temp = POP32();
+
+			// See above
 			if (s->r_acc == make_reg(0, 0x3e8))
 				s->r_acc = make_reg(0, !r_temp.segment);
 			else if (r_temp.segment && s->r_acc.segment)


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