#[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: [u8; 156]
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
impl GBAHeader
pub fn update_checksum(&mut self)
pub fn calculate_checksum(&self) -> u8
pub fn set_debugging(&mut self, debug: bool)
Trait Implementations§
impl Copy for GBAHeader
impl Pod for GBAHeader
Auto Trait Implementations§
impl Freeze for GBAHeader
impl RefUnwindSafe for GBAHeader
impl Send for GBAHeader
impl Sync for GBAHeader
impl Unpin for GBAHeader
impl UnwindSafe for GBAHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)