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

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Thu Oct 15 22:13:19 CEST 2009


Revision: 45131
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45131&view=rev
Author:   wjpalenstijn
Date:     2009-10-15 20:13:19 +0000 (Thu, 15 Oct 2009)

Log Message:
-----------
SCI: Make send varselector reads more verbose. Add notes.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2009-10-15 20:01:24 UTC (rev 45130)
+++ scummvm/trunk/engines/sci/console.cpp	2009-10-15 20:13:19 UTC (rev 45131)
@@ -2261,6 +2261,8 @@
 		}
 	}
 
+	reg_t old_acc = _vm->_gamestate->r_acc;
+
 	// Now commit the actual function:
 	ExecStack *old_xstack, *xstack;
 	old_xstack = &_vm->_gamestate->_executionStack.back();
@@ -2271,6 +2273,24 @@
 	if (old_xstack != xstack) {
 		_vm->_gamestate->_executionStackPosChanged = true;
 		DebugPrintf("Message scheduled for execution\n");
+
+		// TODO (maybe): Executing this function will leave most of the
+		// state of the current function intact, but will likely destroy
+		// r_acc. We may want to save/restore this to avoid disturbing
+		// the current function as much as possible.
+		//
+		// To do this, we may want to call run_vm() here to run until
+		// returning from this function, and restore r_acc afterwards.
+	} else {
+		if (argc == 3) {
+			// varselector read
+
+			DebugPrintf("Value returned: %04x:%04x\n", PRINT_REG(_vm->_gamestate->r_acc));
+			DebugPrintf("(Previous value of acc was: %04x:%04x )\n", PRINT_REG(old_acc));
+
+			// Maybe we want to leave the value of r_acc unchanged instead,
+			// and only report the read value?
+		}
 	}
 
 	return true;


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