pub struct Stat(/* private fields */);Expand description
LCD status (STAT).
| Bit | Field | Access | Meaning |
|---|---|---|---|
| 7 | — | Unused. | |
| 6 | lyc_int | R/W | Raise the STAT interrupt on LYC=LY. |
| 5 | mode2_int | R/W | Raise the STAT interrupt on mode 2 (OAM scan). |
| 4 | mode1_int | R/W | Raise the STAT interrupt on mode 1 (VBlank). |
| 3 | mode0_int | R/W | Raise the STAT interrupt on mode 0 (HBlank). |
| 2 | lyc_eq_ly | RO | Set while LY equals LYC. |
| 1-0 | mode | RO | Current PPU mode. |
Implementations§
Source§impl Stat
impl Stat
Sourcepub const fn with_mode0_int_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_mode0_int_checked(self, value: bool) -> Result<Self, ()>
Raise the STAT interrupt on mode 0 (HBlank).
Bits: 3..4
Sourcepub const fn with_mode0_int(self, value: bool) -> Self
pub const fn with_mode0_int(self, value: bool) -> Self
Raise the STAT interrupt on mode 0 (HBlank).
Bits: 3..4
Sourcepub const fn set_mode0_int(&mut self, value: bool)
pub const fn set_mode0_int(&mut self, value: bool)
Raise the STAT interrupt on mode 0 (HBlank).
Bits: 3..4
Sourcepub const fn set_mode0_int_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_mode0_int_checked(&mut self, value: bool) -> Result<(), ()>
Raise the STAT interrupt on mode 0 (HBlank).
Bits: 3..4
Sourcepub const fn with_mode1_int_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_mode1_int_checked(self, value: bool) -> Result<Self, ()>
Raise the STAT interrupt on mode 1 (VBlank).
Bits: 4..5
Sourcepub const fn with_mode1_int(self, value: bool) -> Self
pub const fn with_mode1_int(self, value: bool) -> Self
Raise the STAT interrupt on mode 1 (VBlank).
Bits: 4..5
Sourcepub const fn set_mode1_int(&mut self, value: bool)
pub const fn set_mode1_int(&mut self, value: bool)
Raise the STAT interrupt on mode 1 (VBlank).
Bits: 4..5
Sourcepub const fn set_mode1_int_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_mode1_int_checked(&mut self, value: bool) -> Result<(), ()>
Raise the STAT interrupt on mode 1 (VBlank).
Bits: 4..5
Sourcepub const fn mode2_int(&self) -> bool
pub const fn mode2_int(&self) -> bool
Raise the STAT interrupt on mode 2 (OAM scan).
Bits: 5..6
Sourcepub const fn with_mode2_int_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_mode2_int_checked(self, value: bool) -> Result<Self, ()>
Raise the STAT interrupt on mode 2 (OAM scan).
Bits: 5..6
Sourcepub const fn with_mode2_int(self, value: bool) -> Self
pub const fn with_mode2_int(self, value: bool) -> Self
Raise the STAT interrupt on mode 2 (OAM scan).
Bits: 5..6
Sourcepub const fn set_mode2_int(&mut self, value: bool)
pub const fn set_mode2_int(&mut self, value: bool)
Raise the STAT interrupt on mode 2 (OAM scan).
Bits: 5..6
Sourcepub const fn set_mode2_int_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_mode2_int_checked(&mut self, value: bool) -> Result<(), ()>
Raise the STAT interrupt on mode 2 (OAM scan).
Bits: 5..6
Sourcepub const fn lyc_int(&self) -> bool
pub const fn lyc_int(&self) -> bool
Raise the STAT interrupt on the LYC=LY condition.
Bits: 6..7
Sourcepub const fn with_lyc_int_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_lyc_int_checked(self, value: bool) -> Result<Self, ()>
Raise the STAT interrupt on the LYC=LY condition.
Bits: 6..7
Sourcepub const fn with_lyc_int(self, value: bool) -> Self
pub const fn with_lyc_int(self, value: bool) -> Self
Raise the STAT interrupt on the LYC=LY condition.
Bits: 6..7
Sourcepub const fn set_lyc_int(&mut self, value: bool)
pub const fn set_lyc_int(&mut self, value: bool)
Raise the STAT interrupt on the LYC=LY condition.
Bits: 6..7