Skip to main content

Lcdc

Struct Lcdc 

Source
pub struct Lcdc(/* private fields */);
Expand description

LCD control (LCDC). Each field’s name describes the meaning when set.

BitFieldAccessMeaning
7lcd_enableR/WLCD and PPU enable.
6window_tilemap_highR/WWindow tile map at 0x9C00 instead of 0x9800.
5window_enableR/WWindow enable.
4tiledata_8000R/WBG/window tile data from the 0x8000 area instead of 0x8800.
3bg_tilemap_highR/WBG tile map at 0x9C00 instead of 0x9800.
2obj_tallR/WObject size 8x16 instead of 8x8.
1obj_enableR/WObject (sprite) rendering enable.
0bg_window_enableR/WBG and window enable (DMG); BG/window master priority (CGB).

Implementations§

Source§

impl Lcdc

Source

pub const fn new() -> Self

Creates a new default initialized bitfield.

Source

pub const fn from_bits(bits: u8) -> Self

Convert from bits.

Source

pub const fn into_bits(self) -> u8

Convert into bits.

Source

pub const fn bg_window_enable(&self) -> bool

BG and window enable (DMG); BG/window master priority (CGB).

Bits: 0..1

Source

pub const fn with_bg_window_enable_checked( self, value: bool, ) -> Result<Self, ()>

BG and window enable (DMG); BG/window master priority (CGB).

Bits: 0..1

Source

pub const fn with_bg_window_enable(self, value: bool) -> Self

BG and window enable (DMG); BG/window master priority (CGB).

Bits: 0..1

Source

pub const fn set_bg_window_enable(&mut self, value: bool)

BG and window enable (DMG); BG/window master priority (CGB).

Bits: 0..1

Source

pub const fn set_bg_window_enable_checked( &mut self, value: bool, ) -> Result<(), ()>

BG and window enable (DMG); BG/window master priority (CGB).

Bits: 0..1

Source

pub const fn obj_enable(&self) -> bool

Object (sprite) rendering enable.

Bits: 1..2

Source

pub const fn with_obj_enable_checked(self, value: bool) -> Result<Self, ()>

Object (sprite) rendering enable.

Bits: 1..2

Source

pub const fn with_obj_enable(self, value: bool) -> Self

Object (sprite) rendering enable.

Bits: 1..2

Source

pub const fn set_obj_enable(&mut self, value: bool)

Object (sprite) rendering enable.

Bits: 1..2

Source

pub const fn set_obj_enable_checked(&mut self, value: bool) -> Result<(), ()>

Object (sprite) rendering enable.

Bits: 1..2

Source

pub const fn obj_tall(&self) -> bool

Object size is 8x16 instead of 8x8.

Bits: 2..3

Source

pub const fn with_obj_tall_checked(self, value: bool) -> Result<Self, ()>

Object size is 8x16 instead of 8x8.

Bits: 2..3

Source

pub const fn with_obj_tall(self, value: bool) -> Self

Object size is 8x16 instead of 8x8.

Bits: 2..3

Source

pub const fn set_obj_tall(&mut self, value: bool)

Object size is 8x16 instead of 8x8.

Bits: 2..3

Source

pub const fn set_obj_tall_checked(&mut self, value: bool) -> Result<(), ()>

Object size is 8x16 instead of 8x8.

Bits: 2..3

Source

pub const fn bg_tilemap_high(&self) -> bool

BG tile map at 0x9C00 instead of 0x9800.

Bits: 3..4

Source

pub const fn with_bg_tilemap_high_checked(self, value: bool) -> Result<Self, ()>

BG tile map at 0x9C00 instead of 0x9800.

Bits: 3..4

Source

pub const fn with_bg_tilemap_high(self, value: bool) -> Self

BG tile map at 0x9C00 instead of 0x9800.

Bits: 3..4

Source

pub const fn set_bg_tilemap_high(&mut self, value: bool)

BG tile map at 0x9C00 instead of 0x9800.

Bits: 3..4

Source

pub const fn set_bg_tilemap_high_checked( &mut self, value: bool, ) -> Result<(), ()>

BG tile map at 0x9C00 instead of 0x9800.

Bits: 3..4

Source

pub const fn tiledata_8000(&self) -> bool

BG/window tile data uses the 0x8000 (unsigned) instead of 0x8800 area.

Bits: 4..5

Source

pub const fn with_tiledata_8000_checked(self, value: bool) -> Result<Self, ()>

BG/window tile data uses the 0x8000 (unsigned) instead of 0x8800 area.

Bits: 4..5

Source

pub const fn with_tiledata_8000(self, value: bool) -> Self

BG/window tile data uses the 0x8000 (unsigned) instead of 0x8800 area.

Bits: 4..5

Source

pub const fn set_tiledata_8000(&mut self, value: bool)

BG/window tile data uses the 0x8000 (unsigned) instead of 0x8800 area.

Bits: 4..5

Source

pub const fn set_tiledata_8000_checked(&mut self, value: bool) -> Result<(), ()>

BG/window tile data uses the 0x8000 (unsigned) instead of 0x8800 area.

Bits: 4..5

Source

pub const fn window_enable(&self) -> bool

Window enable.

Bits: 5..6

Source

pub const fn with_window_enable_checked(self, value: bool) -> Result<Self, ()>

Window enable.

Bits: 5..6

Source

pub const fn with_window_enable(self, value: bool) -> Self

Window enable.

Bits: 5..6

Source

pub const fn set_window_enable(&mut self, value: bool)

Window enable.

Bits: 5..6

Source

pub const fn set_window_enable_checked(&mut self, value: bool) -> Result<(), ()>

Window enable.

Bits: 5..6

Source

pub const fn window_tilemap_high(&self) -> bool

Window tile map at 0x9C00 instead of 0x9800.

Bits: 6..7

Source

pub const fn with_window_tilemap_high_checked( self, value: bool, ) -> Result<Self, ()>

Window tile map at 0x9C00 instead of 0x9800.

Bits: 6..7

Source

pub const fn with_window_tilemap_high(self, value: bool) -> Self

Window tile map at 0x9C00 instead of 0x9800.

Bits: 6..7

Source

pub const fn set_window_tilemap_high(&mut self, value: bool)

Window tile map at 0x9C00 instead of 0x9800.

Bits: 6..7

Source

pub const fn set_window_tilemap_high_checked( &mut self, value: bool, ) -> Result<(), ()>

Window tile map at 0x9C00 instead of 0x9800.

Bits: 6..7

Source

pub const fn lcd_enable(&self) -> bool

LCD and PPU enable.

Bits: 7..8

Source

pub const fn with_lcd_enable_checked(self, value: bool) -> Result<Self, ()>

LCD and PPU enable.

Bits: 7..8

Source

pub const fn with_lcd_enable(self, value: bool) -> Self

LCD and PPU enable.

Bits: 7..8

Source

pub const fn set_lcd_enable(&mut self, value: bool)

LCD and PPU enable.

Bits: 7..8

Source

pub const fn set_lcd_enable_checked(&mut self, value: bool) -> Result<(), ()>

LCD and PPU enable.

Bits: 7..8

Trait Implementations§

Source§

impl Clone for Lcdc

Source§

fn clone(&self) -> Lcdc

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Lcdc

Source§

impl Debug for Lcdc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Lcdc

Source§

fn default() -> Self

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

impl Eq for Lcdc

Source§

impl From<Lcdc> for u8

Source§

fn from(v: Lcdc) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Lcdc

Source§

fn from(v: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Lcdc

Source§

fn eq(&self, other: &Lcdc) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Lcdc

Auto Trait Implementations§

§

impl BankSafe for Lcdc

§

impl Freeze for Lcdc

§

impl RefUnwindSafe for Lcdc

§

impl Send for Lcdc

§

impl Sync for Lcdc

§

impl Unpin for Lcdc

§

impl UnsafeUnpin for Lcdc

§

impl UnwindSafe for Lcdc

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CellValue for T
where T: Copy + BankSafe,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.