fn combine_status_mode(&self) -> u8 {
        // Mask away any existing read-only bits
        let mut stat = self.registers.status & 0b1111_1000;

        // Set coincidence flag
        if self.registers.ly == self.registers.lyc {
            stat |= 0b0000_0100
        }

        // Set mode flag
        match self.mode {
            Mode::HBlank => stat & 0b1111_1100,
            Mode::VBlank => stat | 0b0000_0001,
            Mode::ReadOam => stat | 0b0000_0010,
            Mode::ReadVram => stat | 0b0000_0011,
        }
    }
/// Build the stat register using its writable value and then overriding the last 4 bits with
/// status information.
Build the stat register using its writable value and then overriding the last 4 bits with
status information.
Build the stat register using its writable value and then overriding the last 4 bits with status information .
fn combine_status_mode(&self) -> u8 {
        // Mask away any existing read-only bits
        let mut stat = self.registers.status & 0b1111_1000;
        // Set coincidence flag
        if self.registers.ly == self.registers.lyc {
            stat |= 0b0000_0100
        }
        // Set mode flag
        match self.mode {
            Mode::HBlank => stat & 0b1111_1100,
            Mode::VBlank => stat | 0b0000_0001,
            Mode::ReadOam => stat | 0b0000_0010,
            Mode::ReadVram => stat | 0b0000_0011,
        }
    }
fn combine_status_mode ( & self ) -> u8 { // Mask away any existing read-only bits let mut stat = self . registers . status & 0b1111_1000 ; // Set coincidence flag if self . registers . ly == self . registers . lyc { stat |= 0b0000_0100 } // Set mode flag match self . mode { Mode :: HBlank => stat & 0b1111_1100 , Mode :: VBlank => stat | 0b0000_0001 , Mode :: ReadOam => stat | 0b0000_0010 , Mode :: ReadVram => stat | 0b0000_0011 , } }
Build the stat register using its writable value and then overriding the last 4 bits with
status information.
Build the stat register using its writable value and then overriding the last 4 bits with status information .
&self
&self