| Crates.io | uxie |
| lib.rs | uxie |
| version | 0.4.0 |
| created_at | 2026-01-11 18:54:16.662627+00 |
| updated_at | 2026-01-22 17:51:45.093143+00 |
| description | Data fetching library for Pokemon Gen 4 romhacking - map headers, C parsing, and more |
| homepage | https://github.com/KalaayPT/uxie |
| repository | https://github.com/kalaay/uxie |
| max_upload_size | |
| id | 2036217 |
| size | 741,290 |
uxieA data fetching library for Pokemon Gen 4 romhacking. Provides unified access to ROM data from DSPRE projects and decompilation sources.
Working with Pokemon Gen 4 ROMs involves multiple data sources: binary files
extracted via ndstool or ds-rom, DSPRE projects (folders containing arm9.bin and
unpacked/ filesystem), and modern JSON/C source structures from
decompilation projects (pokeplatinum/pokeheartgold). Each source has
different formats and conventions.
uxie provides a unified interface for reading ROM data regardless of source.
Its Workspace::open() function auto-detects the format and returns a
consistent API. The library also includes utilities for reading map headers,
parsing C enums and defines, and querying relationships between game data.
The name comes from Uxie, the legendary Pokemon known as the "Being of Knowledge."
CallCommonScript IDs to their script files and text banks (supports HGSS binary reading and Platinum hardcoded tables)cargo install uxie
cargo add uxie
Or add to Cargo.toml:
[dependencies]
uxie = "0.4.0"
For full API documentation, visit docs.rs/uxie.
All commands support --json for structured output and -p/--project to specify the project path.
| Command | Description | Example |
|---|---|---|
header |
Read ROM header info | uxie header |
map <id> |
Read map header data | uxie map 0 |
event <id> |
Load event data for a map | uxie event 3 |
encounter <id> |
Load encounter data | uxie encounter 100 --json |
symbols <file> |
Parse C headers or symbol files | uxie symbols constants.h |
personal <id> |
Query Pokemon base stats | uxie personal 25 |
move <id> |
Query move data | uxie move 85 |
item <id> |
Query item data | uxie item 1 |
trainer <id> |
Query trainer data | uxie trainer 1 |
evolution <id> |
Query evolution data | uxie evolution 133 |
learnset <id> |
Query level-up moves | uxie learnset 25 |
egg-moves [species] |
Query egg moves | uxie egg-moves 25 |
Use -d/--decomp to specify a decompilation project path for symbol resolution.
The Workspace struct is the primary entry point:
use uxie::Workspace;
let workspace = Workspace::open("path/to/project")?;
// Resolve constants
let val = workspace.resolve_constant("VARS_START"); // Some(16384)
// Bidirectional symbol resolution
let resolved = workspace.resolve_script_symbols("SetFlag FLAG_UNK_0x000A");
println!("{}", resolved); // "SetFlag 10"
// Access global script table for CallCommonScript resolution
if let Some(entry) = workspace.global_script_table.lookup(2050) {
println!("Script file: {}, Text bank: {}", entry.script_file_id, entry.text_bank_id);
}
For parsing C headers and evaluating expressions:
use uxie::SymbolTable;
let mut symbols = SymbolTable::new();
symbols.load_headers_from_dir("include/constants")?;
// Resolve constants
if let Some(val) = symbols.resolve_constant("ITEM_POKE_BALL") {
println!("ID: {}", val);
}
// Evaluate C expressions with correct precedence
let expr_val = symbols.evaluate_expression("(1 << 8) | (2 << 4) | 3");
println!("Value: {:?}", expr_val); // Some(275)
use uxie::RomHeader;
let header = RomHeader::open("path/to/header.bin")?;
println!("Game: {:?}", header.detect_game()); // Some(Platinum)
println!("Region: {:?}", header.region()); // Some("USA")
Note: This library is a work in progress. Platinum is the primary target and has the most complete support. HeartGold/SoulSilver support is partial—some NARC paths and data structures differ and are not yet fully implemented.
| Game | Code | Family |
|---|---|---|
| Diamond | ADAE (US), ADAJ (JP), ADAP (EU) | DP |
| Pearl | APAE (US), APAJ (JP), APAP (EU) | DP |
| Platinum | CPUE (US), CPUJ (JP), CPUP (EU) | Platinum |
| HeartGold | IPKE (US), IPKJ (JP), IPKP (EU) | HGSS |
| SoulSilver | IPGE (US), IPGJ (JP), IPGP (EU) | HGSS |
MIT License. See LICENSE for details.
"It is said that its emergence gave humans the intelligence to improve their quality of life." -- Pokédex entry from Pokémon Pearl