Changes

From DoomWiki.org

Lump

610 bytes added, 13:34, 5 October 2018
Explain hard-won knowledge regarding the padding bytes present in between the lumps of DOOM.WAD and DOOM2.WAD
During [[Development_of_Doom|development]] of the Doom games id Software created many of the contents of the [[IWAD]]s as separate lumps which could be merged into the WAD files, or loaded separately. Using [[DeHackEd]] or a [[Wikipedia:Hex_editor|hex editor]] to read Doom's executable, it's possible to see development mode loading commands that read some data, such as [[TEXTURE1_and_TEXTURE2|TEXTURE1]], directly from a lump file. Not long after the release of Doom's source code, the developers released the sources for the [[Doom utilities|utilities]] with which they handled lumps and wads, including [[Wadlink]], their lump merging tool.
 
In [[DOOM.WAD]] and [[DOOM2.WAD]], each lump is padded such that the following lump is aligned on a four-byte boundary. The padding, when present, is always the first byte of the preceding lump repeated either one, two, or three times. For example, the DEMO1 lump of DOOM.WAD is 6,854 bytes long. The remainder of 6,854 divided by 4 is 2, and so two padding bytes appear after the DEMO1 lump data and before the DEMO2 lump data. Both of those padding bytes are 0x6D because the first byte in the DEMO1 lump is 0x6D. Note that many modern [[WAD]] editing tools do not pad lumps in this way when saving a file.
== Sources ==
1
edit