diff options
author | Max Horn | 2005-04-10 13:16:49 +0000 |
---|---|---|
committer | Max Horn | 2005-04-10 13:16:49 +0000 |
commit | 0553720ca0cf56b5d755bd824a7f0afd79db3060 (patch) | |
tree | 8c202bb09027cc26e0a14c42c644b8460bc30cee | |
parent | 232860bc44f6fc6706e554288992483ce0966918 (diff) | |
download | scummvm-rg350-0553720ca0cf56b5d755bd824a7f0afd79db3060.tar.gz scummvm-rg350-0553720ca0cf56b5d755bd824a7f0afd79db3060.tar.bz2 scummvm-rg350-0553720ca0cf56b5d755bd824a7f0afd79db3060.zip |
Read the RNAM data (might be useful for debugging)
svn-id: r17510
-rw-r--r-- | scumm/resource.cpp | 19 | ||||
-rw-r--r-- | scumm/resource_v4.cpp | 12 |
2 files changed, 22 insertions, 9 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 43199daeff..781195d43c 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -345,10 +345,15 @@ void ScummEngine::readIndexFile() { break; case MKID('RNAM'): - // Names of rooms. Maybe we should read them and put them - // into a table, for use by the debugger? - _fileHandle->seek(itemsize - 8, SEEK_CUR); - debug(9, "found RNAM block, skipping"); + // Names of rooms. Maybe we should put them into a table, for use by the debugger? + for (int room; (room = _fileHandle->readByte()); ) { + char buf[10]; + _fileHandle->read(buf, 9); + buf[9] = 0; + for (i = 0; i < 9; i++) + buf[i] ^= 0xFF; + debug(5, "Room %d: '%s'\n", room, buf); + } break; case MKID('DLFL'): @@ -994,7 +999,8 @@ void ScummEngine_v5::readMAXS(int blockSize) { void ScummEngine_v8::readMAXS(int blockSize) { debug(9, "readMAXS: MAXS has blocksize %d", blockSize); - _fileHandle->seek(50 + 50, SEEK_CUR); // 176 - 8 + _fileHandle->seek(50, SEEK_CUR); // Skip over SCUMM engine version + _fileHandle->seek(50, SEEK_CUR); // Skip over data file version _numVariables = _fileHandle->readUint32LE(); // 1500 _numBitVariables = _fileHandle->readUint32LE(); // 2048 _fileHandle->readUint32LE(); // 40 @@ -1023,7 +1029,8 @@ void ScummEngine_v8::readMAXS(int blockSize) { void ScummEngine_v7::readMAXS(int blockSize) { debug(9, "readMAXS: MAXS has blocksize %d", blockSize); - _fileHandle->seek(50 + 50, SEEK_CUR); + _fileHandle->seek(50, SEEK_CUR); // Skip over SCUMM engine version + _fileHandle->seek(50, SEEK_CUR); // Skip over data file version _numVariables = _fileHandle->readUint16LE(); _numBitVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); diff --git a/scumm/resource_v4.cpp b/scumm/resource_v4.cpp index afcb39a7e8..a17b0ef7eb 100644 --- a/scumm/resource_v4.cpp +++ b/scumm/resource_v4.cpp @@ -87,9 +87,15 @@ void ScummEngine_v4::readIndexFile() { switch (blocktype) { case 0x4E52: // 'NR' - // Names of rooms. Maybe we should read them and put them - // into a table, for use by the debugger? - _fileHandle->seek(itemsize - 6, SEEK_CUR); + // Names of rooms. Maybe we should put them into a table, for use by the debugger? + for (int room; (room = _fileHandle->readByte()); ) { + char buf[10]; + _fileHandle->read(buf, 9); + buf[9] = 0; + for (int i = 0; i < 9; i++) + buf[i] ^= 0xFF; + debug(5, "Room %d: '%s'\n", room, buf); + } break; case 0x5230: // 'R0' |