aboutsummaryrefslogtreecommitdiff
path: root/scumm/script.cpp
diff options
context:
space:
mode:
authorMax Horn2002-12-23 00:23:36 +0000
committerMax Horn2002-12-23 00:23:36 +0000
commit58f2ee45cdcdf9b9f644dc9a9119ec0b80aac8a8 (patch)
treea6aa76512abc7198721be5edc2bc6e2ac55be306 /scumm/script.cpp
parent11a48a2b01db68a81bc5c0a1c15098c3cf4dc7c6 (diff)
downloadscummvm-rg350-58f2ee45cdcdf9b9f644dc9a9119ec0b80aac8a8.tar.gz
scummvm-rg350-58f2ee45cdcdf9b9f644dc9a9119ec0b80aac8a8.tar.bz2
scummvm-rg350-58f2ee45cdcdf9b9f644dc9a9119ec0b80aac8a8.zip
word size for V8 games is 4 bytes, as opposed to 2 bytes in V6/V7 games. Hence we adjust fetchScriptWord - this way we can reuse all sorts of code (and no, this is not really a hack - word size by tradition is something which varies depending on the architecture, so it is even consistent)
svn-id: r6064
Diffstat (limited to 'scumm/script.cpp')
-rw-r--r--scumm/script.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index ff957955c0..182e0ce5f4 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -297,7 +297,7 @@ byte Scumm::fetchScriptByte()
return *_scriptPointer++;
}
-int Scumm::fetchScriptWord()
+uint Scumm::fetchScriptWord()
{
int a;
if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) {
@@ -310,6 +310,11 @@ int Scumm::fetchScriptWord()
return a;
}
+int Scumm::fetchScriptWordSigned()
+{
+ return (int16)fetchScriptWord();
+}
+
#ifndef BYPASS_COPY_PROT
#define BYPASS_COPY_PROT
#endif
@@ -1010,7 +1015,11 @@ int Scumm::defineArray(int array, int type, int dim2, int dim1)
writeVar(array, id);
- size = (type == 5) ? 16 : 8;
+ if (_features & GF_AFTER_V8) {
+ size = 32; // FIXME - this is just a guess
+ } else {
+ size = (type == 5) ? 16 : 8;
+ }
size *= dim2 + 1;
size *= dim1 + 1;
size >>= 3;