From 1e9407be3f12d75e5dfcf094f7e5ce3a3490a7bb Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 9 Nov 2010 11:57:54 +0000 Subject: SCI: Added comments for rev. 54150 and fixed a typo svn-id: r54153 --- engines/sci/engine/savegame.cpp | 3 +-- engines/sci/engine/vm.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'engines') 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 { -- cgit v1.2.3