Coder Social home page Coder Social logo

venomalia / auroralib.compression Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 571 KB

Supports a wide range of compression algorithms mainly used in video games, like LZSS, LZ10, LZ11, MIO0, YAZ0, YAY0, PRS and more.

License: MIT License

C# 100.00%
compression decompression development lzss modding yaz0 lz77 lzo yay0 zlib

auroralib.compression's Introduction

AuroraLib.Compression

Provides support for a wide range of compression algorithms primarily used in video games, it offers fast decompression/compression and efficient memory usage. It is written entirely in managed C# and does not rely on external C++ libraries.

Nuget Package

Benchmarks

Supported Algorithms

Algorithm Description
LZ10 Nintendo LZ10 compression used in various GBA, DS and WII games.
LZ11 Nintendo LZ11 compression used in various DS and WII games.
LZ40 Nintendo LZ40 compression mainly used in DS games.
LZ60 Nintendo LZ60 corresponds to LZ40 algorithm.
LZ77 Nintendo LZ77 based on LZ10 used in WII games and data.
MIO0* Nintendo MIO0 compression mainly used in early Nintendo 64 games.
Yay0* Nintendo YAY0 compression used in some Nintendo 64 and GameCube games.
Yaz0* Nintendo Yaz0 compression used in games from the N64 to Switch era.
Yaz1* Identical to Yaz0 used for data on the N64DD.
RLE30 Nintendo RLE compression algorithm used in GBA games.
LZOn Nintendo LZOn compression algorithm mainly used in DS Download Games.
PRS* Sega PRS compression algorithm used in various Sega games.
LZSega A LZSS based compression algorithm used in some Sega GameCube games.
CNX2 Sega CNX2 algorithm, used in some Puyo Puyo.
COMP Sega COMP based on LZ11 algorithm, used in some Puyo Puyo.
CXLZ Sega CXLZ based on LZ10 algorithm, used in some Puyo Puyo.
LZ00 Sega LZ00 is based on LZSS algorithm with encryption.
LZ01 Sega LZ01 based on LZSS algorithm, used in some Puyo Puyo.
AKLZ A LZSS based algorithm used in Skies of Arcadia Legends.
CNS CNS compression algorithm, used in Games from Red Entertainment.
CLZ0 CLZ0 compression algorithm, used in Games from Victor Interactive Software.
FCMP FCMP based on LZSS algorithm, used in Muramasa The Demon Blade.
GCLZ GCLZ based on LZ10 algorithm, used in Pandora's Tower.
LZ02 LZ02 compression algorithm used in Mario Golf: Toadstool Tour.
LZHudson A LZSS based compression algorithm used in Mario Party 4-7.
RLHudson A RLE based compression algorithm used in Mario Party 4-7.
LZShrek LZShrek compression algorithm used in Shrek Super Slam.
LZSS LZSS compression algorithm used in many games.
RefPack RefPack compression algorithm used in some EA games.
GZip GZip based on DEFLATE compression algorithm.
ZLib ZLib based on DEFLATE compression algorithm.
AsuraZlb AsuraZlb based on ZLib compression algorithm used in Simpsons The Game.
ZLB ZLB based on ZLib compression algorithm used in Star Fox Adventures.
ALLZ Aqualead LZ compression algorithm used by a handful of games.
LZO Lempel–Ziv–Oberhumer algorithm, focused on decompression speed
LZ4 LZ4 is similar to LZO focused on decompression speed.
MDF0 Konami MDF0 based on ZLib used in Castlevania: The Adventure ReBirth.
Level5 Level5 compression algorithm, mainly used in Level5 3ds games.
SSZL Level5 SSZL algorithm base on LZSS, used in Inazuma Eleven 3.
IECP IECP algorithm base on LZSS, used in Fate/Extra.

* Big-endian and little-endian version are supported.

How To Use

Decompress a file with a specific algorithm.

    using FileStream source = new("input.dat", FileMode.Open, FileAccess.Read, FileShare.Read);
    using FileStream destination = new("output.dat", FileMode.Create, FileAccess.ReadWrite, FileShare.None);
    new LZSS().Decompress(source, destination);

Compress a file with a specific algorithm.

    using FileStream source = new("input.dat", FileMode.Open, FileAccess.Read, FileShare.Read);
    using FileStream destination = new("output.dat", FileMode.Create, FileAccess.ReadWrite, FileShare.None);
    new LZSS().Compress(source, destination);

Check if the file can be decompressed with a specific algorithm.

    using FileStream source = new("input.dat", FileMode.Open, FileAccess.Read, FileShare.Read);
    bool canDecompressed = new LZSS().IsMatch(source);

Credits

  • Nickworonekin Puyo Tools inspired the LZ Decode and Encode code and reference for CNX2, LZ00, LZ01, LZ10, LZ11, PRS algorithms.
  • Haruhiko Okumura reference his original C implementation of the LZSS algorithm.
  • Daniel-McCarthy reference for MIO0, YAZ0, YAY0 algorithm.
  • Niotso.wiki reference for RefPack algorithm.
  • Sukharah reference for CLZ0 algorithm.
  • Gamemasterplc reference for LZHudson algorithm.
  • KirbyUK reference for LZShrek algorithm.
  • Brolijah reference for ALLZ algorithm.thm.
  • CUE reference for LZ40 algorithm.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.