[Scummvm-cvs-logs] SF.net SVN: scummvm:[50203] scummvm/trunk/engines/sci/engine/vm.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Jun 24 09:54:03 CEST 2010
Revision: 50203
http://scummvm.svn.sourceforge.net/scummvm/?rev=50203&view=rev
Author: thebluegr
Date: 2010-06-24 07:54:02 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
Fixed script 140 in the Island of Dr. Brain by adding a workaround for it inside op_link
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-06-24 07:32:34 UTC (rev 50202)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2010-06-24 07:54:02 UTC (rev 50203)
@@ -757,6 +757,9 @@
int old_executionStackBase = s->executionStackBase;
// Used to detect the stack bottom, for "physical" returns
const byte *code_buf = NULL; // (Avoid spurious warning)
+ // Used for a workaround in op_link below, in order to avoid string matching (which can
+ // be slow if used in the game script interpreter)
+ bool isIslandOfDrBrain = (g_sci->getGameId() == "islandbrain");
if (!local_script) {
error("run_vm(): program counter gone astray (local_script pointer is null)");
@@ -1128,8 +1131,15 @@
break;
case op_link: // 0x1f (31)
- for (int i = 0; i < opparams[0]; i++)
- s->xs->sp[i] = NULL_REG;
+ if (local_script->_nr == 140 && isIslandOfDrBrain) {
+ // WORKAROUND for The Island of Dr. Brain, room 140.
+ // Script 140 runs in an endless loop if we set its
+ // variables to 0 here.
+ } else {
+ for (int i = 0; i < opparams[0]; i++)
+ s->xs->sp[i] = NULL_REG;
+ }
+
s->xs->sp += opparams[0];
break;
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