pub struct NesHeader {
pub variant: NesVariant,
pub mapper_num: u16,
pub submapper_num: u8,
pub flags: u8,
pub prg_rom_banks: u16,
pub chr_rom_banks: u16,
pub prg_ram_shift: u8,
pub chr_ram_shift: u8,
pub tv_mode: u8,
pub vs_data: u8,
}Expand description
An iNES or NES 2.0 formatted header representing hardware specs of a given NES cartridge.
https://wiki.nesdev.org/w/index.php/INES https://wiki.nesdev.org/w/index.php/NES_2.0 https://nesdev.org/NESDoc.pdf (page 28)
Fields§
§variant: NesVariant§mapper_num: u16§submapper_num: u8§flags: u8§prg_rom_banks: u16§chr_rom_banks: u16§prg_ram_shift: u8§chr_ram_shift: u8§tv_mode: u8§vs_data: u8Implementations§
Source§impl NesHeader
impl NesHeader
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Load NesHeader 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.
pub const fn mapper_board(mapper_num: u16) -> &'static str
Trait Implementations§
impl Copy for NesHeader
impl Eq for NesHeader
impl StructuralPartialEq for NesHeader
Auto Trait Implementations§
impl Freeze for NesHeader
impl RefUnwindSafe for NesHeader
impl Send for NesHeader
impl Sync for NesHeader
impl Unpin for NesHeader
impl UnwindSafe for NesHeader
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