[][src]Struct gameboy_rom::data::RomHeader

pub struct RomHeader<'a> {
    pub begin_code_execution_point: &'a [u8],
    pub scrolling_graphic: &'a [u8],
    pub game_title: &'a str,
    pub gameboy_color: bool,
    pub licensee_code_new: [u8; 2],
    pub super_gameboy: bool,
    pub rom_type: RomType,
    pub rom_size: u16,
    pub ram_banks: u8,
    pub ram_bank_size: u16,
    pub japanese: bool,
    pub licensee_code: u8,
    pub mask_rom_version: u8,
    pub complement: u8,
    pub checksum: u16,
}

Metadata about the ROM

Fields

begin_code_execution_point: &'a [u8]scrolling_graphic: &'a [u8]

Logo at the start, should match Nintendo Logo

game_title: &'a str

up to 10 ASCII characters

gameboy_color: bool

gbc bit

licensee_code_new: [u8; 2]

2 ASCII hex digits or zeros

super_gameboy: bool

sgb bit

rom_type: RomType

how the data after the header will be parsed

rom_size: u16

How many 16KB ROM banks to use

ram_banks: u8

How many RAM banks are available on the cart

ram_bank_size: u16

The size of the RAM bank in bytes (normal values are 2kB and 8kB)

japanese: bool

jp bit

licensee_code: u8mask_rom_version: u8complement: u8checksum: u16

the sum of all bytes in the ROM except these two bytes, truncated to 2 bytes

Methods

impl<'a> RomHeader<'a>[src]

pub fn validate(&self) -> Result<(), HeaderValidationError>[src]

checks that the ROM header is internally consistent. warning: this doesn't guarantee that the entire ROM header is well formed TODO: consider parsing into unvalidated form (just segmented bytes and then doing a translation step...)

Trait Implementations

impl<'a> Eq for RomHeader<'a>[src]

impl<'a> PartialEq<RomHeader<'a>> for RomHeader<'a>[src]

impl<'a> Debug for RomHeader<'a>[src]

impl<'a> Serialize for RomHeader<'a>[src]

impl<'de: 'a, 'a> Deserialize<'de> for RomHeader<'a>[src]

Auto Trait Implementations

impl<'a> Sync for RomHeader<'a>

impl<'a> Send for RomHeader<'a>

impl<'a> Unpin for RomHeader<'a>

impl<'a> RefUnwindSafe for RomHeader<'a>

impl<'a> UnwindSafe for RomHeader<'a>

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]