[Scummvm-cvs-logs] SF.net SVN: scummvm:[54301] scummvm/trunk/engines/sci/engine
lskovlun at users.sourceforge.net
lskovlun at users.sourceforge.net
Wed Nov 17 21:29:10 CET 2010
Revision: 54301
http://scummvm.svn.sourceforge.net/scummvm/?rev=54301&view=rev
Author: lskovlun
Date: 2010-11-17 20:29:10 +0000 (Wed, 17 Nov 2010)
Log Message:
-----------
SCI3: relocate operand of the lofsa opcode
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/script.h
scummvm/trunk/engines/sci/engine/vm.cpp
Modified: scummvm/trunk/engines/sci/engine/script.h
===================================================================
--- scummvm/trunk/engines/sci/engine/script.h 2010-11-17 19:58:19 UTC (rev 54300)
+++ scummvm/trunk/engines/sci/engine/script.h 2010-11-17 20:29:10 UTC (rev 54301)
@@ -248,6 +248,12 @@
*/
void syncStringHeap(Common::Serializer &ser);
+ /**
+ * Resolve a relocation in an SCI3 script
+ * @param offset The offset to relocate from
+ */
+ int relocateOffsetSci3(uint32 offset);
+
private:
/**
* Processes a relocation block within a SCI0-SCI2.1 script
@@ -268,12 +274,6 @@
bool relocateLocal(SegmentId segment, int location);
/**
- * Resolve a relocation in an SCI3 script
- * @param offset The offset to relocate from
- */
- int relocateOffsetSci3(uint32 offset);
-
- /**
* Gets a pointer to the beginning of the objects in a SCI3 script
*/
const byte *getSci3ObjectsPointer();
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2010-11-17 19:58:19 UTC (rev 54300)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2010-11-17 20:29:10 UTC (rev 54301)
@@ -1738,7 +1738,9 @@
s->r_acc.offset = opparams[0] + local_script->getScriptSize();
break;
case SCI_VERSION_3:
- s->r_acc.offset = opparams[0];
+ // In theory this can break if the variant with a one-byte argument is
+ // used. For now, assume it doesn't happen.
+ s->r_acc.offset = local_script->relocateOffsetSci3(s->xs->addr.pc.offset-2);
break;
default:
error("Unknown lofs type");
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