aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-11-09 11:57:54 +0000
committerFilippos Karapetis2010-11-09 11:57:54 +0000
commit1e9407be3f12d75e5dfcf094f7e5ce3a3490a7bb (patch)
treedcce87327280fddb1f634f4414e110c066204a63
parent63d023964e1523d88463602a7b556e2c8fbe0799 (diff)
downloadscummvm-rg350-1e9407be3f12d75e5dfcf094f7e5ce3a3490a7bb.tar.gz
scummvm-rg350-1e9407be3f12d75e5dfcf094f7e5ce3a3490a7bb.tar.bz2
scummvm-rg350-1e9407be3f12d75e5dfcf094f7e5ce3a3490a7bb.zip
SCI: Added comments for rev. 54150 and fixed a typo
svn-id: r54153
-rw-r--r--engines/sci/engine/savegame.cpp3
-rw-r--r--engines/sci/engine/vm.cpp6
2 files changed, 7 insertions, 2 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 3ced5a4f9d..60cdc494c7 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -402,7 +402,7 @@ void HunkTable::saveLoadWithSerializer(Common::Serializer &s) {
void Script::syncStringHeap(Common::Serializer &s) {
if (getSciVersion() < SCI_VERSION_1_1) {
- // Sync all if the SCI_OBJ_STRINGS blocks
+ // Sync all of the SCI_OBJ_STRINGS blocks
byte *buf = _buf;
bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY);
@@ -418,7 +418,6 @@ void Script::syncStringHeap(Common::Serializer &s) {
blockSize = READ_LE_UINT16(buf + 2);
assert(blockSize > 0);
-
if (blockType == SCI_OBJ_STRINGS)
s.syncBytes(buf, blockSize);
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 8839d51947..71b0b9809c 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1774,6 +1774,12 @@ void run_vm(EngineState *s) {
break;
case op_pushSelf: // 0x3e (62)
+ // Compensate for a bug in non-Sierra compilers, which seem to generate
+ // pushSelf instructions with the low bit set. This makes the following
+ // heuristic fail and leads to endless loops and crashes. Our
+ // interpretation of this seems correct, as other SCI tools, like for
+ // example SCI Viewer, have issues with these scripts (e.g. script 999
+ // in Circus Quest). Fixes bug #3038686.
if (!(extOpcode & 1) || g_sci->getGameId() == GID_FANMADE) {
PUSH32(s->xs->objp);
} else {