gbafix

Struct GBAHeader

Source
#[repr(C)]
pub struct GBAHeader { pub start_code: [u8; 4], pub logo: [u8; 156], pub title: [u8; 12], pub game_code: [u8; 4], pub maker_code: [u8; 2], pub ninety_six: u8, pub main_unit: u8, pub device_type: u8, pub reserved_zeroed: [u8; 7], pub version: u8, pub checksum: u8, pub reserved_zeroed2: [u8; 2], }
Expand description

GBA Header struct.

For details, read GBATEK - GBA Cartridge Header.

Fields§

§start_code: [u8; 4]

b label

logo data, don’t touch.

§title: [u8; 12]

Game’s uppercase ASCII title

§game_code: [u8; 4]

Game’s uppercase code name

§maker_code: [u8; 2]

Manufacturer’s uppercase shorthand

§ninety_six: u8

This is just always 0x96

§main_unit: u8

This is always 0 for all commercial GBA models.

§device_type: u8

Generally 0, or enable bit 7 for hardware debugger support, if you have such a device.

§reserved_zeroed: [u8; 7]

zeroed space

§version: u8

Release version of the game, just using 0 is fine.

§checksum: u8

This is set by all the other fields. Set all your fields and then call update_checksum.

§reserved_zeroed2: [u8; 2]

more zeroed space

Implementations§

Source§

impl GBAHeader

Source

pub fn update_checksum(&mut self)

Source

pub fn calculate_checksum(&self) -> u8

Source

pub fn set_debugging(&mut self, debug: bool)

Trait Implementations§

Source§

impl Clone for GBAHeader

Source§

fn clone(&self) -> GBAHeader

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for GBAHeader

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Zeroable for GBAHeader

Source§

fn zeroed() -> Self

Source§

impl Copy for GBAHeader

Source§

impl Pod for GBAHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.