name tables compression routines

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply

name tables compression routines

Post by Guest » Mon Jan 03, 2005 8:47 pm

hi all,

are there any sample routines on compressing
nametables with algorithms like RLE ...


Posts: 22284
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)

Post by tepples » Mon Jan 03, 2005 10:46 pm

Source code for compressing data with PackBits RLE (in C) and decompressing it to VRAM (6502 asm) is included in the Pin Eight NES Tools distribution.

If you can find any of my games' source code somewhere (I'm afraid to make it available again because I wrote it back when much less was known about the NES's hardware bugs, and I still fear what Michel Iwaniec can do to my reputation if I again make a ROM that hasn't been tested on hardware publicly available), you can probably find an example of how to use it.

Posts: 162
Joined: Mon Nov 22, 2004 3:24 pm
Location: Sweden

Re: name tables compression routines

Post by doynax » Tue Jan 04, 2005 5:42 am

The algorithm choice depends a lot on the kind of scrolling you require.
If it's a single static screen or you can fit the entire level into a RAM buffer then just about any general purpose compression should work.
And then there's a big difference between uni-, an bidirectional scrolling scrolling. Since backing up is impossible with most algorithms, however it should be possible with RLE.
Full scrolling in all directions is really limiting. Even RLE might be impossible.

Another problem with the more advanced algorithms is that they generally eighter require large memory buffers or access to the decompressed data, neighter of which works well with the NES's hardware. So a memory expansion really makes a big difference.

The most popular name table compression is using meta tiles, since it works in just about any situation and can easily be combined with other algorithms.

Post Reply