fn read8(&self, addr: u16) -> u8 {
        match addr {
            0x8000..=0x9FFF => self.vram[(addr as usize) & 0x1FFF],
            0xFE00..=0xFE9F => self.oam[(addr as usize) & 0x00FF],
            0xFF40 => self.registers.control.bits(),
            0xFF41 => self.combine_status_mode(),
            0xFF42 => self.registers.scroll_y,
            0xFF43 => self.registers.scroll_x,
            0xFF44 => self.registers.ly,
            0xFF45 => self.registers.lyc,
            0xFF46 => self.registers.dma,
            0xFF47 => self.registers.bg_palette,
            0xFF48 => self.registers.obj0_palette,
            0xFF49 => self.registers.obj1_palette,
            0xFF4A => self.registers.window_y,
            0xFF4B => self.registers.window_x,
            _ => panic!(
                "Attempted to access [RD] PPU memory from an invalid address: {:#X}",
                addr
            ),
        }
    }
/// Handle memory reads from the PPU data registers only, otherwise panic
Handle memory reads from the PPU data registers only, otherwise panic
Handle memory reads from the PPU data registers only otherwise panic
fn read8(&self, addr: u16) -> u8 {
        match addr {
            0x8000..=0x9FFF => self.vram[(addr as usize) & 0x1FFF],
            0xFE00..=0xFE9F => self.oam[(addr as usize) & 0x00FF],
            0xFF40 => self.registers.control.bits(),
            0xFF41 => self.combine_status_mode(),
            0xFF42 => self.registers.scroll_y,
            0xFF43 => self.registers.scroll_x,
            0xFF44 => self.registers.ly,
            0xFF45 => self.registers.lyc,
            0xFF46 => self.registers.dma,
            0xFF47 => self.registers.bg_palette,
            0xFF48 => self.registers.obj0_palette,
            0xFF49 => self.registers.obj1_palette,
            0xFF4A => self.registers.window_y,
            0xFF4B => self.registers.window_x,
            _ => panic!(
                "Attempted to access [RD] PPU memory from an invalid address: {:#X}",
                addr
            ),
        }
    }
fn read8 ( & self , addr : u16 ) -> u8 { match addr { 0x8000 ..= 0x9FFF => self . vram [ ( addr as usize ) & 0x1FFF ] , 0xFE00 ..= 0xFE9F => self . oam [ ( addr as usize ) & 0x00FF ] , 0xFF40 => self . registers . control . bits ( ) , 0xFF41 => self . combine_status_mode ( ) , 0xFF42 => self . registers . scroll_y , 0xFF43 => self . registers . scroll_x , 0xFF44 => self . registers . ly , 0xFF45 => self . registers . lyc , 0xFF46 => self . registers . dma , 0xFF47 => self . registers . bg_palette , 0xFF48 => self . registers . obj0_palette , 0xFF49 => self . registers . obj1_palette , 0xFF4A => self . registers . window_y , 0xFF4B => self . registers . window_x , _ => panic ! ( " " addr ) , } }
Handle memory reads from the PPU data registers only, otherwise panic
Handle memory reads from the PPU data registers only otherwise panic
&self
addr
u16
&self
addr
u16