diff options
author | Max Horn | 2004-01-19 20:27:31 +0000 |
---|---|---|
committer | Max Horn | 2004-01-19 20:27:31 +0000 |
commit | 923adce4562897a6df4f023622f1770d0eac4c15 (patch) | |
tree | 8da9ef77ee87ffa0b98c5d85cf496ae697e51673 /scumm/script_v8.cpp | |
parent | 8e89f7d060ca5fac1efc7c244df91b678f7e2c9d (diff) | |
download | scummvm-rg350-923adce4562897a6df4f023622f1770d0eac4c15.tar.gz scummvm-rg350-923adce4562897a6df4f023622f1770d0eac4c15.tar.bz2 scummvm-rg350-923adce4562897a6df4f023622f1770d0eac4c15.zip |
fix endian bug when dealing with ArrayHeader's; added a hack to permit save games broken due to this to still work; moved the whole 'Array' stuff into ScummEngine_v6
svn-id: r12521
Diffstat (limited to 'scumm/script_v8.cpp')
-rw-r--r-- | scumm/script_v8.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index d33a445b64..2d40dc2b62 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -535,6 +535,27 @@ void ScummEngine_v8::decodeParseString(int m, int n) { } } +void ScummEngine_v8::readArrayFromIndexFile() { + int num; + int a, b; + + while ((num = _fileHandle.readUint32LE()) != 0) { + a = _fileHandle.readUint32LE(); + b = _fileHandle.readUint32LE(); + + // FIXME - seems the COMI scripts have a bug related to array 436. + // and visible in script 2015, room 20. Basically, the dimensions + // are swapped in the definition of the array, but its obvious + // that this must be a script bug simply by looking at the defintions + // of other arrays and how they are used. + // Talk to fingolfin if you have questions about this :-) + if (num == 436) + defineArray(num, 5, b, a); + else + defineArray(num, 5, a, b); + } +} + void ScummEngine_v8::o8_mod() { int a = pop(); push(pop() % a); @@ -646,8 +667,7 @@ void ScummEngine_v8::o8_arrayOps() { case 0x14: // SO_ASSIGN_STRING b = pop(); len = resStrLen(_scriptPointer); - c = defineArray(array, 4, 0, len + 1); - ah = (ArrayHeader *)getResourceAddress(rtString, c); + ah = defineArray(array, 4, 0, len + 1); copyScriptString(ah->data + b); break; case 0x15: // SO_ASSIGN_SCUMMVAR_LIST |