By playing around with the file MAP100.GDT pretty much one byte at a time, replacing TITLE1.GDT in disk B1 with it, and loading the game over and over, I've figured out a few different ways the pixels get encoded. I was mostly working on this a few months ago and lost steam with it. Here are my findings so far:
Code: Select all
*Headers:
**BIGBOMB.GDT 88-E4-00-00-00-00-80-02-C8-00-11-... (big, animated)
**TITLE1.GDT: 88-E4-00-00-00-00-80-02-C8-00-11-... (640x400)
**TITLE2.GDT: 88-E4-00-00-00-00-80-02-C8-00-11-... (640x400)
**TITLE3.GDT: 88-E4-00-00-00-00-80-02-C8-00-11-... (640x400)
**TITLE4.GDT: 88-E4-00-00-00-00-80-02-C8-00-11-... (640x400)
**TITLE5.GDT: 88-E4-00-00-00-00-80-02-C8-00-11-... (640x400)
**GAMEOVER.GDT88-E4-18-00-08-00-A0-01-90-00-11-... (416x288)
**SEN04.GDT: 88-E4-18-00-09-00-A0-01-8F-00-11-... (416x288)
**SEN09.GDT: 88-E4-18-00-08-00-A0-01-90-00-11-... (416x288)
**SEN10.GDT: 88-E4-18-00-08-00-A0-01-90-00-11-... (416x288)
**MAP100.GDT: 88-E4-C8-01-08-00-A0-00-40-00-11-... (160x128)
**MAP200.GDT: 88-E4-C8-01-08-00-A0-00-40-00-11-... (160x128)
**MAP300.GDT: 88-E4-C8-01-08-00-A0-00-40-00-11-... (160x128)
**MAP400.GDT: 88-E4-C8-01-08-00-A0-00-40-00-11-... (160x128)
**MAP500.GDT: 88-E4-C8-01-08-00-A0-00-40-00-11-... (160x128)
*Header Bytes:
**01-00: Begin header
**03-02: (?)
**05-04: (?)
**07-06: Image width (640 for titles, 416 for sad ends, 160 for maps)
**09-08: Image height, scanlines subtracted (200 for titles, 143-144 for sad ends, 64 for map)
**11-10: End of header (11=(decimal) length of header)
*Encoding Modes
The image is divided into skinny blocks, 8px wide and image-height tall. You have some number of color planes, each introduced with a byte specifying the encoding mode:
**04, 0C?: Run-length encoding. Two bytes:
***First byte: Pattern of the line in binary (which pixels are filled in).
***Second byte: how many lines to repeat the pattern in the first byte.
**81, 80?: Positional encoding. Two bytes:
***First byte: Position of the next line.
***Second byte: Pattern of the line in binary.
**06: Pattern encoding. One byte:
***First half-byte: Number of lines to repeat the pattern.
***Second half-byte: Pattern. See "Patterns" below.
*Patterns
**x0: 0000 0000
**x1: 0010 0010
**x2: 0101 0101
**x3: 0111 0111
**x4: 1111 1111
**x5: 1101 1101
**x6: 1010 1010
**x7: ? (breaks everything)
**x8: 1111 1111
**x9: checkerboard 0010 0010 / 1000 1000
**xa: checkerboard 0101 0101 / 1010 1010
**xb: checkerboard 0111 0111 / 1101 1101
**xc: 1111 1111
**xd: rev. checkerboard 1101 1101/ 0111 0111
**xe: rev. checkerboard 1010 1010 / 0101 0101
**xf: ? (breaks everything)
*Control Codes
**10: Ends a block (?)
**FF 84: Repeat the next line 4 times.
**00 00 00: Blank. The block is completely black. Skip it and start the next one.
Does anyone with more experience in image formats have any insights, or see any resemblances to file formats familiar to them? I will continue to buckle down and mess around with the individual bytes, but I feel like i'm missing some pieces in what I need to know to do it.