There are (at least) 2 versions of DL files: version 1 and 2.
DL version 1 file format is:
Size (bytes) Description ----------------------------------------------------------- 1 Version number (1). Image format (implicit) is 1 (medium) 20 Title (XOR'ed with 0xff). 1 Number of screens (nscr). 1 Number of commands (ncmd). 1 Unknown. Something to do with colormap and border colors. 768 Colormap (3 bytes per color, 256 colors) 320*200*nscr Data for each screen (always 64000 bytes). ncmd Commands in an unknown format. The last command can be negative (unknown reason) and is to be ignored.
DL version 2 file format is:
Size (bytes) Description ----------------------------------------------------------- 1 Version number (2). 1 Format (0=large320x200, 1=medium160x100). 20 Title (XOR'ed with 0xff). 20 Author (XOR'ed with 0xff). 1 Number of screens (nscr). 1 Number of commands (ncmd). 3 Unknown. Something to do with colormap and border colors. 768 Colormap (3 bytes per color, 256 colors). 320*200*nscr Data for each screen (if format==0, single image per screen, if format==1, 4 images per screen) 2*ncmd Commands, little-endian (byte swapped 16-bit words). The last command can be negative (unknown reason) and is to be ignored.
Commands appear to be just a list of frames to display in a loop. For example, given four frame images (0 through 3), the commands:
can create an animation showing these frames in succession. You can thus have far fewer actual bitmap images that "frames" in the animation loop.