pub struct Cart { /* private fields */ }
Expand description
An NES cartridge.
Implementations§
source§impl Cart
impl Cart
pub fn empty() -> Self
sourcepub fn from_path<P: AsRef<Path>>(
path: P,
ram_state: RamState
) -> NesResult<Self>
pub fn from_path<P: AsRef<Path>>( path: P, ram_state: RamState ) -> NesResult<Self>
Load Cart
from a ROM path.
Errors
If the NES header is corrupted, the ROM file cannot be read, or the data does not match the header, then an error is returned.
sourcepub fn from_rom<S, F>(
name: S,
rom_data: &mut F,
ram_state: RamState
) -> NesResult<Self>
pub fn from_rom<S, F>( name: S, rom_data: &mut F, ram_state: RamState ) -> NesResult<Self>
Load Cart
from ROM data.
Errors
If the NES header is invalid, or the ROM data does not match the header, then an error is returned.
pub fn name(&self) -> &str
pub fn chr_rom(&self) -> &[u8] ⓘ
pub fn chr_ram(&self) -> &[u8] ⓘ
pub fn prg_rom(&self) -> &[u8] ⓘ
pub fn prg_ram(&self) -> &[u8] ⓘ
pub fn has_chr(&self) -> bool
pub fn chr_len(&self) -> usize
pub fn has_prg_ram(&self) -> bool
sourcepub const fn battery_backed(&self) -> bool
pub const fn battery_backed(&self) -> bool
Returns whether this cartridge has battery-backed Save RAM.
sourcepub const fn mapper_num(&self) -> u16
pub const fn mapper_num(&self) -> u16
Returns the Mapper number for this Cart.
sourcepub const fn submapper_num(&self) -> u8
pub const fn submapper_num(&self) -> u8
Returns the Sub-Mapper number for this Cart.
sourcepub const fn mapper_board(&self) -> &'static str
pub const fn mapper_board(&self) -> &'static str
Returns the Mapper and Board name for this Cart.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Cart
impl Send for Cart
impl Sync for Cart
impl Unpin for Cart
impl UnwindSafe for Cart
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more