Crate pkmn_rom_extract

Crate pkmn_rom_extract 

Source
Expand description

§pkmn-rom-extract

This project is in early development. Don’t expect things to work.

Rust library and utility for extracting graphics and other assets from Pokémon games.

§Goals

  • No unsafe code.
  • no_std compatible. Build with no-default-features if you want this.
  • Endianness safe: usable on both little- and big-endian targets.
  • Support all official international releases and revisions of supported games.

§Non-Goals

  • No spinoff games: Mystery Dungeon, Ranger, etc.
  • No PC fan games: RPG Maker, etc.
  • No downloading online assets, such as from PokéAPI. There exist other crates for this.
  • No ROM editing. Use other tools if you want to do this; the Pokémon ROM hacking community is quite large and there are many options.

§Currently Supported Games

  • Generation 3 (GBA)
    • All titles: Ruby, Sapphire, Emerald, FireRed, LeafGreen
    • All language versions: Japanese, English, French, German, Spanish, Italian
    • All official GBA ROM revisions (44 total)
    • Some ROM hacks may work but others will not.

For more details about which ROM hacks will or will not work, see romhacks.md.

§Currently Supported Assets

  • Front sprites: the large sprites that represent each Pokémon in the summary screen, hall of fame, opponents in battle, and more.
  • Box/party icons: the small sprites that represent each Pokémon in the party list and PC box view. (Gen3 and later)
  • Item icons: the sprites used to represent every item in the bag screen. (FRLG and later)
  • Box wallpapers: the background graphics displayed in the PC box view. (Gen3 and later)
  • Base stats: data for each Pokémon species including not only stat calculations but also types, abilities, gender ratio, exp growth curve, and more.

§Usage

Use this crate as a library dependency by adding it to your Cargo.toml. If you build with no standard library, omit the "std" feature but note that alloc is required.

[dependencies]
pkmn-rom-extract = {version = "0.0.1", default-features = false, features = ["std"]}

§Binary

This crate also includes an executable binary that can be installed with cargo install pkmn-rom-extract.

This program will extract all supported assets to a specified target directory. Sprites and other graphics are written as PNG files. Other data is written as JSON files.

$ pkmn-rom-extract "Pokemon - Ruby Version (USA).gba" ruby_extracted

§TODO

  • Add C and C++ bindings (locked behind a feature flag which permits unsafe)
  • Support for a wider variety of GBA ROM hacks.
  • Game Boy games: Red, Green, Blue, Yellow, Gold, Silver, Crystal
  • DS Gen4 games: Diamond, Pearl, Platinum, HeartGold, SoulSilver
  • DS Gen5 games: Black, White, Black 2, White 2
  • Extract strings: Pokémon names, item names, move names, ability names, Pokédex entries
  • Extract more graphics: Pokémon back sprites, trainer sprites
  • Extract more data tables: evolution info, move learnsets
  • Extract music

§Possible further future

These are not a priority and may not ever be implemented.

  • Other asset types like map data, battle tower parties, etc.
  • Extract non-3D assets like box icons and base stats from 3DS and/or Switch games.
  • Extract graphics from Pokémon Home (Switch and/or Android)

Modules§

gba
Types for reading GBA ROM data.
graphics
Graphics types for GBA and DS.
lzss
LZSS utilities for Nintendo’s LZ10 format

Enums§

RomError
Error type used by this crate.

Type Aliases§

Result
Result type used by this crate.