Crates.io | pokemon-sprite-compression |
lib.rs | pokemon-sprite-compression |
version | 0.1.2 |
source | src |
created_at | 2023-05-02 16:26:53.111101 |
updated_at | 2023-05-08 12:47:35.600323 |
description | A library for dealing with compressed Pokemon sprites |
homepage | |
repository | https://github.com/LinusU/pokemon-sprite-compression |
max_upload_size | |
id | 854717 |
size | 30,128 |
A library for dealing with compressed Pokemon sprites.
Implementation status:
cargo add pokemon-sprite-compression
const rom = std::fs::read("pokeyellow.gbc").unwrap();
// Aerodactyl fossil sprite
let sprite = pokemon_sprite_compression::gen1::decompress(&rom[0x0367a1..]);
const rom = std::fs::read("pokecrystal.gbc").unwrap();
// Pikachu back sprite
let sprite = pokemon_sprite_compression::gen2::decompress(&rom[0x156ea1..]);
Huge thanks to the pret team and Andrew Ekstedt for their work on gen I decompression.
Huge thanks to wgjordan on Hacker News for reverse engineering and documenting the gen II compression algorithm. I've included a copy of the documentation in this repository for convenience, as the file doc/gen2.txt
.