#snes #memory #memory-address #pc #memory-map #conversion #game

bin+lib snes_address

A library for translating memory address for SNES games

2 releases

0.1.1 Oct 24, 2022
0.1.0 Oct 23, 2022

#8 in #pc

MIT license

7KB
144 lines

snes_address

For converting between PC and SNES memory map addresses.

Supported Memory Map Conversions

  • LoRom
  • HiRom
  • ExLoRom
  • ExHiRom Others to be added...

Usage

Rust Library:

Add dependency https://crates.io/crates/snes_address

use snes_address::errors::AddressError;

fn lorom_to_pc(lorom_address: usize) -> Result<usize, AddressError> {
    snes_address::lorom_to_pc(lorom_address)
}

fn pc_to_lorom(pc_address: usize) -> Result<usize, AddressError> {
    snes_address::pc_to_lorom(pc_address)
}

Shared Library:

TODO: Add wrapper project to compile this to so (linux), dll (windows), and dylib (mac)

Binary:

cargo install snes_address

Usage:");
    snes_address [option] <address_in_hex>

Options:
    -P2L: decompress
    -L2P: LoRom to PC

lib.rs:

snes_address provides functions for translating between PC and SNES memory map address

Supported Memory Map Conversions

  • LoRom
  • HiRom
  • ExLoRom
  • ExHiRom Others to be added...

Example

use snes_address::errors::AddressError;

fn lorom_to_pc(lorom_address: usize) -> Result<usize, AddressError> {
snes_address::lorom_to_pc(lorom_address)
}

fn compress_data(pc_address: usize) -> Result<usize, AddressError> {
snes_address::pc_to_lorom(pc_address)
}

Dependencies

~230–680KB
~16K SLoC