fn emulate_dma(&mut self) {
        if let Some(src) = self.dma.emulate() {
            let val = match src >> 8 {
                0x00..=0x7f => self.cart.read_rom(src),
                0x80..=0x9f => self.ppu.read_vram(src),
                0xa0..=0xbf => self.cart.read_ram(src),
                0xc0..=0xcf | 0xe0..=0xef => self.wram.read_ram(src),
                0xd0..=0xdf | 0xf0..=0xff => self.wram.read_bank_ram(src),
                _ => panic!("Illegal source addr for OAM DMA transfer"),
            };

            self.ppu.dma_write((src & 0xff) as u8, val);
        }
    }
// FIXME: sprites are not displayed during OAM DMA
sprites are not displayed during OAM DMA
sprites are not displayed during OAM DMA
fn emulate_dma(&mut self) {
        if let Some(src) = self.dma.emulate() {
            let val = match src >> 8 {
                0x00..=0x7f => self.cart.read_rom(src),
                0x80..=0x9f => self.ppu.read_vram(src),
                0xa0..=0xbf => self.cart.read_ram(src),
                0xc0..=0xcf | 0xe0..=0xef => self.wram.read_ram(src),
                0xd0..=0xdf | 0xf0..=0xff => self.wram.read_bank_ram(src),
                _ => panic!("Illegal source addr for OAM DMA transfer"),
            };
            self.ppu.dma_write((src & 0xff) as u8, val);
        }
    }
fn emulate_dma ( & mut self ) { if let Some ( src ) = self . dma . emulate ( ) { let val = match src >> 8 { 0x00 ..= 0x7f => self . cart . read_rom ( src ) , 0x80 ..= 0x9f => self . ppu . read_vram ( src ) , 0xa0 ..= 0xbf => self . cart . read_ram ( src ) , 0xc0 ..= 0xcf | 0xe0 ..= 0xef => self . wram . read_ram ( src ) , 0xd0 ..= 0xdf | 0xf0 ..= 0xff => self . wram . read_bank_ram ( src ) , _ => panic ! ( " " ) , } ; self . ppu . dma_write ( ( src & 0xff ) as u8 , val ) ; } }
FIXME: sprites are not displayed during OAM DMA
FIXME : sprites are not displayed during OAM DMA
&mut self