9.2 Compression

Compression has been known about and fairly well documented for a long time (the 77 in LZ77 refers to the year it was made) but to do it usefully in real time did not really take off until the GBA and to a slightly lesser extent the 16 bit era. Field specific compression (dual and multi tile encoding, palette swapping and all the other methods covered in developer tricks) and simpler methods like run length encoding have however been around for a long time. The GBA and DS both feature decompression algorithms for two popular methods (LZSS and Huffman) of various flavours inbuilt into the BIOS and well supported in official developer kits. The BIOS decompression was not always used as they were a tradeoff between usefulness, resources required, size in the BIOS and overall speed which led to developers either implementing faster methods to decompress files compressed with otherwise standard BIOS compression or implementing a custom method of compression.

Typically custom usually just means it allows for different lengths or compression or uses a custom flag type (the BIOS compression is quite strict as to what it requires in a compressed format) rather than a truly new idea as to how to compress things for as with most areas of science and technology massive leaps are quite rare but small refinements are quite possible. To this end if you know how compression works and can think through what you would change to improve compression you will usually be OK.

Likewise where developers do want to reduce sizes (ROM chip sizes increase in powers of 2 and price does as well and one hundred thousand times the difference in price adds up to quite a bit) but ROM hackers are not always so limited (memory issues aside) so removing the compression in the first place can be done and often is. In some cases removing compression actually speeds up the game as well.

Remember on the GBA you will usually have the whole upper 16 megabytes to play with and the DS is limited to 512 megabytes for the ROM which again few ROMs ever get/got up to not to mention being able to create two ROMs and say play to this point then swap.

GBA