[−][src]Struct nescore::cart::Cartridge
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]
info: CartridgeInfo,
prg_rom: Vec<u8>,
chr_rom: Vec<u8>,
bat_ram: Vec<u8>
) -> Self
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
Auto Trait Implementations
impl RefUnwindSafe for Cartridge
impl Send for Cartridge
impl Sync for Cartridge
impl Unpin for Cartridge
impl UnwindSafe for Cartridge
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,