aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-24 21:42:08 +0000
committerMartin Kiewitz2010-06-24 21:42:08 +0000
commitf014c9ed7ef5a193ce17ba870698a389a65a985a (patch)
tree5bcb00ea62e357863886f1deabaa7a651ee1a060
parent06a65d5c331bd009827f9fa711f7cdf5cc7905eb (diff)
downloadscummvm-rg350-f014c9ed7ef5a193ce17ba870698a389a65a985a.tar.gz
scummvm-rg350-f014c9ed7ef5a193ce17ba870698a389a65a985a.tar.bz2
scummvm-rg350-f014c9ed7ef5a193ce17ba870698a389a65a985a.zip
SCI: ignore segment 0xFFFF in segmanager getchar, when offset > 1 - so we dont write a warning, if the scripts use some uninitialized temp variable as terminator
svn-id: r50236
-rw-r--r--engines/sci/engine/seg_manager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index b464438553..6a03a959b3 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -612,8 +612,12 @@ static inline char getChar(const SegmentRef &ref, uint offset) {
reg_t val = ref.reg[offset / 2];
+ // segment 0xFFFF means that the scripts are using uninitialized temp-variable space
+ // we can safely ignore this, if it isn't one of the first 2 chars.
+ // foreign lsl3 uses kFileIO(readraw) and then immediately uses kReadNumber right at the start
if (val.segment != 0)
- warning("Attempt to read character from non-raw data");
+ if ((offset > 1) && val.segment == 0xFFFF)
+ warning("Attempt to read character from non-raw data");
return (offset & 1 ? val.offset >> 8 : val.offset & 0xff);
}