diff options
author | Travis Howell | 2006-02-15 23:02:37 +0000 |
---|---|---|
committer | Travis Howell | 2006-02-15 23:02:37 +0000 |
commit | bcef7a167cd012c11eecdab91017b318a8b84fd8 (patch) | |
tree | 4dec16ece7902719193978893edefecce10bae79 | |
parent | 389e59d33114311bfc0edd323a1e932ae6c1bedf (diff) | |
download | scummvm-rg350-bcef7a167cd012c11eecdab91017b318a8b84fd8.tar.gz scummvm-rg350-bcef7a167cd012c11eecdab91017b318a8b84fd8.tar.bz2 scummvm-rg350-bcef7a167cd012c11eecdab91017b318a8b84fd8.zip |
Read correct index by block size in HE games again, to help track down unknown versions.
svn-id: r20708
-rw-r--r-- | engines/scumm/he/resource_he.cpp | 168 |
1 files changed, 90 insertions, 78 deletions
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index f7be975ca3..50d5807f3c 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -1662,90 +1662,102 @@ void ScummEngine_v70he::readGlobalObjects() { } void ScummEngine_v99he::readMAXS(int blockSize) { - debug(0, "ScummEngine_v99he readMAXS: MAXS has blocksize %d", blockSize); - - _numVariables = _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _numRoomVariables = _fileHandle->readUint16LE(); - _numLocalObjects = _fileHandle->readUint16LE(); - _numArray = _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _numFlObject = _fileHandle->readUint16LE(); - _numInventory = _fileHandle->readUint16LE(); - _numRooms = _fileHandle->readUint16LE(); - _numScripts = _fileHandle->readUint16LE(); - _numSounds = _fileHandle->readUint16LE(); - _numCharsets = _fileHandle->readUint16LE(); - _numCostumes = _fileHandle->readUint16LE(); - _numGlobalObjects = _fileHandle->readUint16LE(); - _numImages = _fileHandle->readUint16LE(); - _numSprites = _fileHandle->readUint16LE(); - _numLocalScripts = _fileHandle->readUint16LE(); - _HEHeapSize = _fileHandle->readUint16LE(); - _numPalettes = _fileHandle->readUint16LE(); - _numUnk = _fileHandle->readUint16LE(); - _numTalkies = _fileHandle->readUint16LE(); - _numNewNames = 10; - - _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); - _numGlobalScripts = 2048; + if (blockSize == 52) { + debug(0, "ScummEngine_v99he readMAXS: MAXS has blocksize %d", blockSize); + + _numVariables = _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _numRoomVariables = _fileHandle->readUint16LE(); + _numLocalObjects = _fileHandle->readUint16LE(); + _numArray = _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _numFlObject = _fileHandle->readUint16LE(); + _numInventory = _fileHandle->readUint16LE(); + _numRooms = _fileHandle->readUint16LE(); + _numScripts = _fileHandle->readUint16LE(); + _numSounds = _fileHandle->readUint16LE(); + _numCharsets = _fileHandle->readUint16LE(); + _numCostumes = _fileHandle->readUint16LE(); + _numGlobalObjects = _fileHandle->readUint16LE(); + _numImages = _fileHandle->readUint16LE(); + _numSprites = _fileHandle->readUint16LE(); + _numLocalScripts = _fileHandle->readUint16LE(); + _HEHeapSize = _fileHandle->readUint16LE(); + _numPalettes = _fileHandle->readUint16LE(); + _numUnk = _fileHandle->readUint16LE(); + _numTalkies = _fileHandle->readUint16LE(); + _numNewNames = 10; + + _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); + _numGlobalScripts = 2048; + } + + ScummEngine_v90he::readMAXS(blockSize); } void ScummEngine_v90he::readMAXS(int blockSize) { - debug(0, "ScummEngine_v90he readMAXS: MAXS has blocksize %d", blockSize); - - _numVariables = _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _numRoomVariables = _fileHandle->readUint16LE(); - _numLocalObjects = _fileHandle->readUint16LE(); - _numArray = _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _numFlObject = _fileHandle->readUint16LE(); - _numInventory = _fileHandle->readUint16LE(); - _numRooms = _fileHandle->readUint16LE(); - _numScripts = _fileHandle->readUint16LE(); - _numSounds = _fileHandle->readUint16LE(); - _numCharsets = _fileHandle->readUint16LE(); - _numCostumes = _fileHandle->readUint16LE(); - _numGlobalObjects = _fileHandle->readUint16LE(); - _numImages = _fileHandle->readUint16LE(); - _numSprites = _fileHandle->readUint16LE(); - _numLocalScripts = _fileHandle->readUint16LE(); - _HEHeapSize = _fileHandle->readUint16LE(); - _numNewNames = 10; - - _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); - if (_features & GF_HE_985) - _numGlobalScripts = 2048; - else - _numGlobalScripts = 200; + if (blockSize == 46) { + debug(0, "ScummEngine_v90he readMAXS: MAXS has blocksize %d", blockSize); + + _numVariables = _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _numRoomVariables = _fileHandle->readUint16LE(); + _numLocalObjects = _fileHandle->readUint16LE(); + _numArray = _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _numFlObject = _fileHandle->readUint16LE(); + _numInventory = _fileHandle->readUint16LE(); + _numRooms = _fileHandle->readUint16LE(); + _numScripts = _fileHandle->readUint16LE(); + _numSounds = _fileHandle->readUint16LE(); + _numCharsets = _fileHandle->readUint16LE(); + _numCostumes = _fileHandle->readUint16LE(); + _numGlobalObjects = _fileHandle->readUint16LE(); + _numImages = _fileHandle->readUint16LE(); + _numSprites = _fileHandle->readUint16LE(); + _numLocalScripts = _fileHandle->readUint16LE(); + _HEHeapSize = _fileHandle->readUint16LE(); + _numNewNames = 10; + + _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); + if (_features & GF_HE_985) + _numGlobalScripts = 2048; + else + _numGlobalScripts = 200; + } + + ScummEngine_v72he::readMAXS(blockSize); } void ScummEngine_v72he::readMAXS(int blockSize) { - debug(0, "ScummEngine_v72he readMAXS: MAXS has blocksize %d", blockSize); - - _numVariables = _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _numBitVariables = _numRoomVariables = _fileHandle->readUint16LE(); - _numLocalObjects = _fileHandle->readUint16LE(); - _numArray = _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _numVerbs = _fileHandle->readUint16LE(); - _numFlObject = _fileHandle->readUint16LE(); - _numInventory = _fileHandle->readUint16LE(); - _numRooms = _fileHandle->readUint16LE(); - _numScripts = _fileHandle->readUint16LE(); - _numSounds = _fileHandle->readUint16LE(); - _numCharsets = _fileHandle->readUint16LE(); - _numCostumes = _fileHandle->readUint16LE(); - _numGlobalObjects = _fileHandle->readUint16LE(); - _numImages = _fileHandle->readUint16LE(); - _numNewNames = 10; - - _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); - _numGlobalScripts = 200; + if (blockSize == 40) { + debug(0, "ScummEngine_v72he readMAXS: MAXS has blocksize %d", blockSize); + + _numVariables = _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _numBitVariables = _numRoomVariables = _fileHandle->readUint16LE(); + _numLocalObjects = _fileHandle->readUint16LE(); + _numArray = _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _numVerbs = _fileHandle->readUint16LE(); + _numFlObject = _fileHandle->readUint16LE(); + _numInventory = _fileHandle->readUint16LE(); + _numRooms = _fileHandle->readUint16LE(); + _numScripts = _fileHandle->readUint16LE(); + _numSounds = _fileHandle->readUint16LE(); + _numCharsets = _fileHandle->readUint16LE(); + _numCostumes = _fileHandle->readUint16LE(); + _numGlobalObjects = _fileHandle->readUint16LE(); + _numImages = _fileHandle->readUint16LE(); + _numNewNames = 10; + + _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); + _numGlobalScripts = 200; + } + + ScummEngine_v6::readMAXS(blockSize); } byte *ScummEngine_v72he::getStringAddress(int i) { |