Breaking Eggs And Making Omelettes

Topics On Multimedia Technology and Reverse Engineering


NES Compression

January 25th, 2006 by Multimedia Mike

For budding computer geeks like myself, volume 20/January 1991 issue of Nintendo Power magazine (Mega Man III cover) was of particular interest. In this issue, the editors attempted to shed some light on the technical matters driving the 8-bit Nintendo Entertainment System and give insufferable know-it-alls further opportunity to truly know it all.

8-bit Nintendo Entertainment System

I still recall the puerile, simplistic explanation for compression using a metaphor every Nintendo nerd could relate to: Tetris! I still think about this article sometimes and wonder what compression method they used and for which games. In fact, I located the relevant article section and scanned it for your enjoyment/edification:

NES Compression
Click for larger image

I came across this document describing a compression algorithm used for a Zelda game on the Super NES, the direct successor to the NES, both market-wise and on a technical level. It seems that the scheme is largely a flexible RLE scheme which allows for decoding single- or double-byte runs (output 5 instances of byte 0x56 vs. output 5 instances of 0x56 0x42); decoding runs of an incrementing byte (e.g., output a sequence of 4 incrementing bytes starting with 0xA2: 0xA2 0xA3 0xA4 0xA5); and even using into the encoded buffer as a dictionary and copying runs from a specified index.

Posted in Nintendo, Reverse Engineering | 4 Comments »

4 Responses

  1. Jim Leonard Says:

    That is one fantastic explanation of compression for the non-initiated. I’ve saved that and already passed it to a co-worker who didn’t understand compression… and now he does :-)

  2. Multimedia Mike Says:

    Poor guy– now whenever he opens a ZIP file he’s going to think, “Ah! The computer is playing a little game of Tetris, in reverse, in order to open this file.” :)

  3. Jim Leonard Says:

    Well, on a theoretical sense, isn’t he? :-)

  4. Alexander Strasser Says:

    The Tetris example is really nice :)
    But AFAICT they cheated a bit with 3D-rotating or mirroring the blue stone.