bbexplode
---------

bbexplode is a small program to decompress the compressed files used in the game Big Bang. As far as I know, the only compressed files are those in !BigBang.machine, !BigBang.sprites, and !BigBang.sprytes. Once decompressed these can be set to type 'Sprite' (&ff9), as they are normal sprite files.

Usage:

bbexplode <infile> <outfile>


bbimplode
---------

bbimplode is a slightly larger and altogether slower program, designed to recompress the compressed files used in Big Bang. Note that although this is believed to work OK, it hasn't had any testing in game, and Big Bang may have trouble with overly large files.

Usage:

bbimplode <infile> <outfile>


The techie bit
--------------

The Big Bang compressed files are based around a repeating sequence of a control byte followed by 8 data blocks. The control byte specifies whether each data block represents new data, or old data which can be looked up in a rolling 4K buffer.

For new data, the data block is a single byte specifying the value. This is inserted into the output stream, and the 4K data buffer (Which then advances to the next position).

For compressed data, the data block is two bytes. If byte a is the first and b is the second, then:

* The start address in the data buffer is a + (b & 0xF0) << 4
* The length of the sequence is 3 + (b & 0xF) bytes

The data is then read sequentially from the buffer, at the same time as the buffer is updated with the data being output. Care must be taken to ensure the buffer address wraps.

If bit i of the control byte is set then data block i will be new data; else it is compressed data.

The initial state of the data buffer is to have it filled with null bytes, and the pointer placed at index 4078 (i.e. 4096-18). Output is stopped when the input file ends (i.e. some control bits may be left unused in the last control byte).


Legal gumpf
-----------

bbexplode and bbimplode were written by Jeffrey Lee, me@phlamethrower.co.uk
http://www.quote-egnufeb-quote-greaterthan-colon-hash-comma-underscore-at.info/
