[Scummvm-cvs-logs] SF.net SVN: scummvm:[42209] scummvm/trunk/engines/sci/engine/vm.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Tue Jul 7 09:51:27 CEST 2009
Revision: 42209
http://scummvm.svn.sourceforge.net/scummvm/?rev=42209&view=rev
Author: thebluegr
Date: 2009-07-07 07:51:26 +0000 (Tue, 07 Jul 2009)
Log Message:
-----------
Added a SCI1.1 case in the lofss opcode, like in the lofsa opcode (essentially, lofss and lofsa both load an offset, with lofsa loading it in the accumulator and lofss in the stack). lofss is rarely used in SCI1.1 games, which explains why no lofss-related crashes have been observed in SCI1.1
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/vm.cpp
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2009-07-07 07:51:18 UTC (rev 42208)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2009-07-07 07:51:26 UTC (rev 42209)
@@ -1211,10 +1211,15 @@
case 0x3a: // lofss
r_temp.segment = xs->addr.pc.segment;
- if (s->_kernel->hasLofsAbsolute())
- r_temp.offset = opparams[0];
- else
- r_temp.offset = xs->addr.pc.offset + opparams[0];
+ if (s->_version >= SCI_VERSION_1_1) {
+ r_temp.offset = opparams[0] + local_script->script_size;
+ } else {
+ if (s->_kernel->hasLofsAbsolute())
+ r_temp.offset = opparams[0];
+ else
+ r_temp.offset = xs->addr.pc.offset + opparams[0];
+ }
+
#ifndef DISABLE_VALIDATIONS
if (r_temp.offset >= code_buf_size) {
error("VM: lofss operation overflowed: %04x:%04x beyond end"
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