diff options
author | Max Horn | 2003-04-28 13:16:16 +0000 |
---|---|---|
committer | Max Horn | 2003-04-28 13:16:16 +0000 |
commit | dc7446f46986d396a92566b9c561645bdfa00e65 (patch) | |
tree | 6da3ac4ff2ec91d2df910f3d68f035629e01b503 /scumm/scummvm.cpp | |
parent | a1a8c3ed0515f471532975c7315df70e06c6c366 (diff) | |
download | scummvm-rg350-dc7446f46986d396a92566b9c561645bdfa00e65.tar.gz scummvm-rg350-dc7446f46986d396a92566b9c561645bdfa00e65.tar.bz2 scummvm-rg350-dc7446f46986d396a92566b9c561645bdfa00e65.zip |
make it possible to override dump length in Scumm::dumpResource; fix V2 entry script offset (I believe); fix exit script dumping for GF_OLD_BUNDLE games
svn-id: r7176
Diffstat (limited to 'scumm/scummvm.cpp')
-rw-r--r-- | scumm/scummvm.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 76f7cb13aa..c055eb302e 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -931,23 +931,26 @@ void Scumm::initRoomSubBlocks() { // // Look for an exit script // - if (_features & GF_AFTER_V2) + int EXCD_len = -1; + if (_features & GF_AFTER_V2) { _EXCD_offs = READ_LE_UINT16(roomptr + 0x18); - else if (_features & GF_OLD_BUNDLE) + EXCD_len = READ_LE_UINT16(roomptr + 0x1A) - _EXCD_offs + _resourceHeaderSize; // HACK + } else if (_features & GF_OLD_BUNDLE) { _EXCD_offs = READ_LE_UINT16(roomptr + 0x19); - else { + EXCD_len = READ_LE_UINT16(roomptr + 0x1B) - _EXCD_offs + _resourceHeaderSize; // HACK + } else { ptr = findResourceData(MKID('EXCD'), roomResPtr); if (ptr) _EXCD_offs = ptr - roomResPtr; } if (_dumpScripts && _EXCD_offs) - dumpResource("exit-", _roomResource, roomResPtr + _EXCD_offs - _resourceHeaderSize); + dumpResource("exit-", _roomResource, roomResPtr + _EXCD_offs - _resourceHeaderSize, EXCD_len); // // Look for an entry script // if (_features & GF_AFTER_V2) - _ENCD_offs = READ_LE_UINT16(roomptr + 0x1C); + _ENCD_offs = READ_LE_UINT16(roomptr + 0x1A); else if (_features & GF_OLD_BUNDLE) _ENCD_offs = READ_LE_UINT16(roomptr + 0x1B); else { @@ -1210,12 +1213,14 @@ void Scumm::setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, i _scaleSlots[slot-1].scale1 = scale1; } -void Scumm::dumpResource(char *tag, int idx, byte *ptr) { +void Scumm::dumpResource(char *tag, int idx, byte *ptr, int length) { char buf[256]; File out; uint32 size; - if (_features & GF_OLD_BUNDLE) + if (length >= 0) + size = length; + else if (_features & GF_OLD_BUNDLE) size = READ_LE_UINT16(ptr); else if (_features & GF_SMALL_HEADER) size = READ_LE_UINT32(ptr); |