diff options
author | Travis Howell | 2005-10-14 12:36:46 +0000 |
---|---|---|
committer | Travis Howell | 2005-10-14 12:36:46 +0000 |
commit | dcb2372e23d58f700f25764429f148ddd5d8f73b (patch) | |
tree | 55890eba7f2c8bb76da0485f3ed288f4011ef492 | |
parent | 67eedc08d27e6a3649db5bcb9a4c0ad76e468d35 (diff) | |
download | scummvm-rg350-dcb2372e23d58f700f25764429f148ddd5d8f73b.tar.gz scummvm-rg350-dcb2372e23d58f700f25764429f148ddd5d8f73b.tar.bz2 scummvm-rg350-dcb2372e23d58f700f25764429f148ddd5d8f73b.zip |
Adjust array ids in HE80+ games, to match original.
Otherwise array aren't always nuked by scripts.
svn-id: r19082
-rw-r--r-- | scumm/resource.cpp | 4 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 3 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 3 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 6 |
4 files changed, 16 insertions, 0 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 6e256a62dd..4ddc571c7a 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -753,6 +753,10 @@ byte *ScummEngine::getResourceAddress(int type, int idx) { byte *ptr; CHECK_HEAP + + if (_heversion >= 80 && type == rtString) + idx &= ~0x33539000; + if (!res.validateResource("getResourceAddress", type, idx)) return NULL; diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 7b9557ff83..cd61ab565a 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -460,6 +460,9 @@ void ScummEngine_v6::nukeArray(int a) { data = readVar(a); + if (_heversion >= 80) + data &= ~0x33539000; + if (data) res.nukeResource(rtString, data); if (_heversion >= 60) diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index 74828bfdd6..e6c8210950 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -1152,6 +1152,9 @@ void ScummEngine_v60he::o60_soundOps() { } void ScummEngine_v60he::localizeArray(int slot, byte scriptSlot) { + if (_heversion >= 80) + slot &= ~0x33539000; + if (slot >= _numArray) error("o60_localizeArrayToScript(%d): array slot out of range", slot); diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 281ec6b0e1..fbb022ae68 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -405,8 +405,14 @@ ScummEngine_v72he::ArrayHeader *ScummEngine_v72he::defineArray(int array, int ty size = arrayDataSizes[type]; + if (_heversion >= 80) + id |= 0x33539000; + writeVar(array, id); + if (_heversion >= 80) + id &= ~0x33539000; + size *= dim2end - dim2start + 1; size *= dim1end - dim1start + 1; size >>= 3; |