[][src]Struct nescore::cart::Cartridge

pub struct Cartridge {
    pub info: CartridgeInfo,
    // some fields omitted
}

Representation of a ROM cartridge A cartridge can be loaded from a byte buffer or from a file on disk. It contains the information parsed from the header, the program ROM, character ROM (tile data) and battery RAM (The area in memory that holds save data).

Fields

info: CartridgeInfo

Implementations

impl Cartridge[src]

pub fn from(rom: Vec<u8>) -> Result<Cartridge, CartridgeError>[src]

Instantiate a Cartridge from a byte buffer

let cart = Cartridge::from(data).unwrap();

pub fn from_path(path: &str) -> Result<Cartridge, CartridgeError>[src]

Instantiate a Cartridge from a file

let cart = Cartridge::from_path("/path/to/rom").unwrap();

pub fn from_parts(
    info: CartridgeInfo,
    prg_rom: Vec<u8>,
    chr_rom: Vec<u8>,
    bat_ram: Vec<u8>
) -> Self
[src]

Construct a Cartridge from parts

pub fn into_parts(self) -> (CartridgeInfo, Vec<u8>, Vec<u8>, Vec<u8>)[src]

Consume the cartridge and return the info, program ROM and character ROM

pub fn add_battery_ram(self, batt: Vec<u8>) -> Self[src]

Insert battery RAM into the cartridge

Trait Implementations

impl From<Cartridge> for Nes[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.