This is an attempt to get better tile data compression, without going all the way into entropy coding slowness.
It beats LZ4 by 8-15%, and since it currently compresses one tile at a time, SNESTC1 data can be re-compressed to make it even smaller. It should still decompress faster than gzip even when combined with LZ4/LZO.
It also beats one solution commonly used in the SNES commercial era, RNC ProPack, but then so do many others.
Comparison on one game’s BG graphics, 1943680 bytes total:
| Algo | Compressed size | % |
|---|---|---|
LZ4HC |
1389504 |
71 |
LZO |
1323101 |
68 |
gzip |
1195581 |
61 |
SNESTC1 |
1185733 |
61 |
SNESTC1 + LZ4 |
1174945 |
60 |
SNESTC1 + gzip |
1086042 |
56 |
SNESTC1 + LZO |
1078091 |
55 |
Gzip decompression takes about 12200 cycles per tile. SNESTC1 takes 6436 cycles per tile on average, being about twice as fast (measured with the 65c02 code).
This means that decompressing 500 tiles would take ~1.2s on slowROM and ~0.9s on fastROM.