[Scummvm-git-logs] scummvm master -> e12496bd0c2a15d4e7701422ca9fd860482dcb1f
csnover
csnover at users.noreply.github.com
Fri Oct 28 03:23:15 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e12496bd0c SCI32: Read byte/string array values as signed in SCI2.1early-
Commit: e12496bd0c2a15d4e7701422ca9fd860482dcb1f
https://github.com/scummvm/scummvm/commit/e12496bd0c2a15d4e7701422ca9fd860482dcb1f
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-10-27T20:23:10-05:00
Commit Message:
SCI32: Read byte/string array values as signed in SCI2.1early-
KQ7 1.51 writes int16s from the save game catalogue into a Str
object, then retrieves byte 0 from the string and compares it to
-1. This happens to work out because (1) characters were treated
as signed in SCI2.1early and earlier, and (2) int16s in the save
game catalogue were little-endian.
In SCI2.1mid and later, this trick no longer works because
characters are treated as unsigned and get zero-extended instead.
Fixes Trac#9632.
Changed paths:
engines/sci/engine/segment.h
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 361c1cb..e8f0be3 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -552,8 +552,17 @@ public:
case kArrayTypeID:
return ((reg_t *)_data)[index];
case kArrayTypeByte:
- case kArrayTypeString:
- return make_reg(0, ((byte *)_data)[index]);
+ case kArrayTypeString: {
+ int16 value;
+
+ if (getSciVersion() < SCI_VERSION_2_1_MIDDLE) {
+ value = ((int8 *)_data)[index];
+ } else {
+ value = ((uint8 *)_data)[index];
+ }
+
+ return make_reg(0, value);
+ }
default:
error("Invalid array type %d", _type);
}
More information about the Scummvm-git-logs
mailing list