N64 Compression

From en64 wiki
Jump to navigation Jump to search

The N64 accesses data from cartridges and disks through the Parallel interface (registers start at 0xA4600000|0x84600000). For example you can identify if a compression is used, what type it is, and locate the decompression routine by stopping the game every time something is loaded from ROM through the PI registers. Set a write breapoint on 0xA460000C, press "step" so the size is set and the interrupt is tripped, then set a read breakpoint on the first few words of data at the RDRAM address being shoved into it. It's fairly straight forward to see how the data is manipulated/treated if the game you're hacking has a compression type or not.

Compression Types

MIO0 compressed data format

The following is a list of all the Nintendo 64 compression types that have been documented as of yet. You can thank Zoinkity's for the following list, and Midwaydec for his program that supports all these compression and archive types.

Type Description
LZ Midway LZSS derivative
WLM Williams LZSS derivative
AVL Traditional LZSS without a header, first noticed in Avalanche titles
AVL_0 Avalanche in binary mode (00 fills rather than spaces)
LZSS Traditional LZSS file
LZSS_0 Traditional LZSS file in binary mode (00 fills rather than spaces)
LZSS_B Traditional LZSS file with big-endian header
LZSS_0B Traditional LZSS file, big-endian header, in binary mode (00 fills rather than spaces)
HUFF Traditional Huffman compression
LHUF Traditional Huffman compression in binary mode (00 fills rather than spaces)
ARI Traditional LZSS-Arithmetic file
ARI_0 Traditional LZSS-Arithmetic file in binary mode (00 fills rather than spaces)
ARI_B Traditional LZSS-Arithmetic file with big-endian header
ARI_0B Traditional LZSS-Arithmetic file, big-endian header, in binary mode (00 fills rather than spaces)
02TG Sydney 2000 compression
Asmic Asmic LZSS compression
Aidyn Aidyn Chronicles LZB variant (compression type 2)
BLTZ NFL Blitz series RLE compression
SUB MK Mythologies compression
CSR RLE compression from Stunt Racer 64
CR Custom Robo and Custom Robo V2 compression format
CSR Stunt Racer 64 RLE file
DLZ Titus LZW file
EA EA's LZ derivative
EAHD Format internally used by OVLN and BIGF, bearing the header 10FB.
EB Excitebike64 compressed file, autodetected format, always in a single part.
EB-raw Excitebike64 compressed file, no header.
EDL Eurocom Decompression Library; autodetects EDL0-EDL2
EDL0 Eurocom Decompression Library (Store)
EDL1 Eurocom Decompression Library (LZ)
EDL2 Eurocom Decompression Library (RLE)
FLA2 Glover LZSS compression
GO 1kb LZSS derivative, first identified in Densha de Go!
H2O File wrapper for certain H2O titles
LE LZE compression scheme
LZYF LZ format used in the Treasure game Bangaioh
MADF Compression format in EA's Madden games; direct output not supported
Mass Mass Media headerless compression; requires passing decompressed size
MMHdr Mass Media file with long, big-endian filesize preceeding data
MIL Theoretical stream format of MIO, mostly for giggles
MIO Older Nintendo sliding window compression format
Nagano Interleavable LZW found in Konami Nisitenma-Ichigo titles
Night Nightmare Creatures compressed files
NL_Old Nintendo old filelist table games; ie. StarFox64
NL_New Nintendo later filelist table games; ie. Zelda Series
NTarc Nushi Tsuri archived huffman files
ODT O.D.T.'s compression format
OVLN Structured format used by EA Games
PERS-SZP Pokémon Stadium Compressed File Wrapper
Polaris LZO1x implementation in Polaris SnoCross and H2O titles
RareLZB LZB implementation for Blast Corps sound banks
RNC Rob Northern Computing file format, also handling indexed and archive types
RNX Custom multipart Rob Northern Computing files
Sno 16bit LZ format in Snowboard Kids 2
Sphere Tetrisphere compressed files
Taz Taz Express files
TBR Titus bitwise RLE format, no header
TBR8 Titus bitwise RLE format, with decompressed size and target rdram address in header
Tigger Archive for multipart files in Tigger's Honey Hunt
TGR Top Gear Rally multi-part zlib files
Twisted Twisted Edge LZ file
vpk HAL Laboratories bitwise lzss with huffman encoding
WAD Compressed format in WAD-structured files (iD Software)
Yaz Nintendo compressed stream format (LZSS variant)
Yay Nintendo compressed file format

Header Types

Many games use different variations on the gzip/zlib headers. These types act as wrappers to allow extraction.

Type Description
GEZip RareZip (.rz) file in GoldenEye
KIZip RareZip (.rz) file in Killer Instinct Gold
PDZip RareZip (.rz) file in Perfect Dark
BKZip RareZip (.rz) file in Banjo Kazooie
BTZip RareZip (.rz) file in Banjo Tooie
DKZip RareZip (.rz) file in Donkey Kong 64
BFDZip RareZip (.rz) file in Conker's Bad Fur Day
F5ZLB Factor5 zlib file
REzip Resident Evil II zlib file
MALzip Milo's Astro Lanes zlib file
WDC World Driver Championship/Stunt Racer 64 Zlib implementation
ZLB Dinosaur Planet zlib wrapper
Z Headerless Z format (zlib); autodetects Z0-Z2
Z0 Z format 0
Z1 Z format 1
Z2 Z format 2

Archive Types

These may be extracted as either archives or individual files.

Type Description
BIGF Bigfile format used by EA Games
BOFS GameTek BOFS Archive
BOLT Mass Media BOLT files, probably specific to N64 (or at least this era)
Burp Unloads content of Infogrames Burp archives
GZ GZip files, alias by extension
GZIP Gzip files
MAD EA's Madden archive file, containing MADF and BIN files
PKMNARC Pokémon Stadium archive
RNCA Dedicated type for Rob Northern Computing archives
SRT Super Robot Taisen 64 archives
TUT Unpacks contents of Dezeamon 3D TUT_SRAM.SYS archive.
XG2 XG2 Archive
ZIP PKZip implementation in V-Rally
Excitebike Uniquely has individual files that are assembled from multiple parts.
EB-Brs Excitebike64 4-part compressed archive
EB-Big Excitebike64 Big multipart file.
Soundbanks May be extracted as either raw or midi files
S1raw Soundbank (S1 type) Midi files
S1lz Soundbank (S1 type) Midi files w/ Midway compression
S1lzs Soundbank (S1 type) Midi files w/ LZSS compression
S1wlm Soundbank (S1 type) Midi files w/ Williams compression
AKItext Text banks in AKI Wrestling titles
GO Extract unformatted Densha de Go! image data
GScodes GameShark/Pro Action Replay codelist, formatted as text
IDX Extract STR.SYS using IDX.SYS in Dezeamon 3D
PRESJPEG Pokémon Stadium JPEG wrapper
TEX TEX texture files in AKI Wrestling titles
TEXarc TEX texture archives in AKI Wrestling titles