Expand description
Extract tilesets, palettes, sprites, and field effects from GBA Pokemon ROMs (Emerald, FireRed, LeafGreen, Ruby, Sapphire).
§Quickstart
use hypercutter::{Extractor, Rom, SymbolTable};
let rom = Rom::open("pokeemerald.gba")?;
let symbols = SymbolTable::resolve_for_rom(&rom)?;
let extractor = Extractor::new(&rom, &symbols);
let metatiles = extractor.metatiles()?;Re-exports§
pub use cli::Cli;Non-WebAssembly
Modules§
- cli
Non-WebAssembly - CLI implementation: argument parsing, symbol lookup, output writing.
- sprite_
pack Non-WebAssembly - Sprite and field effect extraction.
Structs§
- Extract
Options - Configuration for extraction.
- Extractor
- High-level extraction facade.
- Footprint
- A 16×16 1bpp footprint image (32 bytes: 4 GBA tiles of 1bpp × 8 bytes each).
- Form
Sprite - An alternate-form sprite (e.g. Unown B, Deoxys Attack).
- MapLayout
- Packed on-disk representation of a GBA
MapLayout. - Metatile
- A metatile: 8 layers (4 bottom + 4 top).
- Metatile
Data - Decoded metatile bank.
- Metatile
Entry - One metatile entry: a primary tileset plus an optional secondary.
- Metatile
Layer - Decoded metatile layer.
- Metatile
Layer Bits - Packed 16-bit metatile layer entry.
- Metatiles
- All metatiles extracted from a ROM, indexed by name.
- MonCoords
- Decoded mon coords.
- MonCoords
OnDisk - On-disk
MonCoordsstruct (4 bytes, 2 padding). - Palette
- One palette of 16 RGBA colors.
- Palette
Data - A bank of up to 16 palettes, decoded from a contiguous BGR555 block.
- Rgba
- An RGBA color with 8 bits per channel.
- Rgba
Image - A row-major RGBA image buffer.
- Rom
- A fully loaded GBA Pokemon ROM.
- Species
Id - Identifier for a Pokemon species.
- Sprite
- A full base-species sprite (front, back, normal and shiny palettes).
- Sprite
Renderer - Render a single Pokemon battle sprite sheet (64×64 4bpp) using a palette.
- Sprite
Sheet - A single Pokemon battle sprite sheet (64×64 frame at 4bpp).
- Symbol
- One entry in a parsed symbol table.
- Symbol
Table - In-memory symbol table with O(1) name and address lookups.
- Tile
Data - One 8×8 tile of 4bpp graphics, stored as 32 raw bytes.
- Tileset
- A fully decoded tileset, ready for rendering.
- Tileset
Header - Packed on-disk representation of a GBA
Tileset. - Tileset
Renderer - Tileset renderer that composites metatiles into a single RGBA image.
Enums§
- Error
- Errors that can occur when extracting data from a Pokemon ROM.
- Game
- One of the five supported GBA Pokemon games.
- Scope
- Scope of a symbol.
Constants§
- DEFAULT_
ROM_ BASE_ ADDRESS - Default GBA ROM base address.
- GAME_
CODE_ LENGTH - Length of the game code in bytes.
- GAME_
CODE_ OFFSET - Byte offset of the 4-byte game code within the ROM header.
- MAP_
LAYOUT_ SIZE - Size of the GBA
MapLayoutstruct in bytes. - METATILE_
LAYER_ COUNT - Number of tiles in a metatile (2×2 = 4 bottom + 4 top).
- MON_
PIC_ HEIGHT_ TILES - Height of a Pokemon battle sprite frame in tiles.
- MON_
PIC_ PIXELS - Pixels per side of a 4bpp Pokemon frame.
- MON_
PIC_ WIDTH_ TILES - Width of a Pokemon battle sprite frame in tiles.
- PALETTE_
COLORS - Number of colors in a single palette.
- PALETTE_
COUNT - Number of palettes in a tileset palette bank.
- POKEMON_
PALETTE_ BYTES - Bytes in a single 16-color Pokemon palette.
- POKEMON_
PIC_ BYTES - Bytes in a fully-populated 64Ã64 4bpp sprite frame (used by the form-packing heuristic).
- TILESET_
SIZE - Size of the GBA
Tilesetstruct in bytes. - TILE_
SIZE - Size of a single 4bpp tile in bytes.
Functions§
- bgr555_
to_ rgba - Convert a 16-bit BGR555 color to 8-bit RGBA with full opacity.
- decode_
tile_ 4bpp - Decode 32 bytes of 4bpp tile data into 64 palette indices (row-major, 8×8).
- decompress_
lzss - Decompress an LZSS-compressed buffer.
- is_lzss
- Returns
trueif the buffer starts with a valid LZSS magic byte (0x10or0x11). - pokemon_
char - Map a single Pokemon GBA character byte to its ASCII rendering.
- read_
ptr_ table - Read a
u32pointer table (array of ROM addresses) starting ataddress. - read_
slice_ at - Read a contiguous slice of
Tfrom a ROM starting ataddress. - read_
struct_ at - Read a
BinRead-derived struct from a ROM at a given address. - read_
u32_ at - Read a single
u32little-endian from a ROM address. - render_
footprint - Render a Pokemon footprint (16×16 1bpp) into an RGBA image.
- renderer_
for_ sprite - Helper for converting a
Spriteto aSpriteRenderer. - sprite_
palette - Helper for picking a palette out of a
PaletteDatafor a sprite.
Type Aliases§
- Result
- Result alias for the library.