fix: properly implement LY==LYC behaviour
This commit is contained in:
@@ -13,6 +13,16 @@ bitfield! {
|
||||
pub from into PpuMode, mode, set_mode: 1, 0;
|
||||
}
|
||||
|
||||
impl LCDStatus {
|
||||
pub fn update(&mut self, byte: u8) {
|
||||
// Bytes 2 -> 0 are read only
|
||||
let mask = 0b00000111;
|
||||
|
||||
let read_only = self.0 & mask;
|
||||
self.0 = (byte & !mask) | read_only;
|
||||
}
|
||||
}
|
||||
|
||||
impl Copy for LCDStatus {}
|
||||
impl Clone for LCDStatus {
|
||||
fn clone(&self) -> Self {
|
||||
@@ -26,12 +36,6 @@ impl Default for LCDStatus {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<u8> for LCDStatus {
|
||||
fn from(byte: u8) -> Self {
|
||||
Self(byte)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<LCDStatus> for u8 {
|
||||
fn from(status: LCDStatus) -> Self {
|
||||
status.0
|
||||
|
Reference in New Issue
Block a user