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) -> Result<Self>
pub fn from_path<P: AsRef<Path>>(path: P, ram_state: RamState) -> Result<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,
) -> Result<Self>
pub fn from_rom<S, F>( name: S, rom_data: &mut F, ram_state: RamState, ) -> Result<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_rom(&self) -> bool
pub fn has_chr_ram(&self) -> bool
pub fn has_prg_ram(&self) -> bool
pub const fn is_ines(&self) -> bool
pub const fn is_nes2(&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 fn mapper_num(&self) -> u16
pub fn mapper_num(&self) -> u16
Returns the Mapper number for this Cart.
Sourcepub fn submapper_num(&self) -> u8
pub fn submapper_num(&self) -> u8
Returns the Sub-Mapper number for this Cart.
Sourcepub fn mapper_board(&self) -> &'static str
pub fn mapper_board(&self) -> &'static str
Returns the Mapper and Board name for this Cart.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cart
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