Newest Translations

Theme Park Last Armageddon Finding Nemo Cyber Knight

Featured Hack Images

F-Zero DXP Mega Man 5 - Ridley X Hack 2 Mario's 2 Ways to Victory Rockman 3 - KBON

Featured Translation Images

Final Fantasy IV Monstania Squashed Banana Prince

Recent Updates


sf_crunch and sf_decrunch are compression and decompression utilities for the graphics data in Star Fox and Star Fox 2. This format was used for most of the background and sprite graphics, as well as the tilemaps (also known as “name tables”). It does not apply to any of the 3D graphics in the game. Star Fox and Star Fox 2 both use the same format, which is a variant of LZW compression.

I was motivated to make this utility after the source code became available via the recent Nintendo source code leak. This utility obviously doesn’t contain any of the leaked code, but I did use the decompression source code to help reverse engineer the format. The decompression subroutine in the ROM runs on the Super FX chip, and its source code is in a file called MDECRU.MC which was apparently written by Krister Wombell. I liked the name “decrunch” that Krister used, so I used it for this utility.

The compressed graphics data was also included in the leak. The files have extension .CCR (compressed graphics) and .PCR (compressed tilemap/name table data). The filenames from the source code are listed in readme.txt along with their location in the U.S. version of the Star Fox ROM.

This compression format is unique in that control sequences are stored _after_ the data sequences that they correspond to, so the decompressor must parse the data backwards, starting at the end of the compressed stream and progressing to the beginning.

Because of this quirk, I added a command-line option for the decompressor to specify the offset of the _end_ of a compressed data segment in a file. The offsets of the compressed data segments in the U.S. version of the Star Fox ROM are listed below. I didn’t include an option to specify an offset for the compressor because it would ostensibly be used to compress an entire file.

The only other utility that I’m aware of which supports this format is FuSoYa’s Lunar Compress library, but since it is closed source and only for Windows, I wanted to make an open source utility that could be compiled on a computer running any operating system.

With that in mind, this archive does not contain any executable files. It only contains the C++ source files for the compressor (sf_crunch.cpp) and decompressor (sf_decrunch.cpp). They are very simple programs, so they should be easy to compile with any C++ compiler. You are also free to use and modify this code if you would like to use it in your own work. I’ve tested both programs pretty thoroughly, but please let me know if you find any problems.


User Review Information

Many Thanks!

Reviewed By: SpyderTL on 30 Aug 2020

I was planning on writing this utility months ago, but I am not too familiar with the MARIO assembly instruction set, so I had put it on the shelf and moved on to other projects. I decided to pick it back up tonight, and to start looking through the leaked source. Once I realized that it was LZW compressed, I started googling for a decrunch algorithm, and luckily noticed this link before I started writing my own from scratch. I’m off to port this code to C#, and I’ll put it up on github, as well. You just saved me weeks of effort. Thank you so much!!

Version 1.0 Recommended - Yes

User Reviews
Many Thanks!SpyderTL30 Aug 20201.0Yes