fix(ppu): DMA takes priority over OAM Scan

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-06-12 13:40:55 -05:00
parent 0c22509d24
commit daeb02f7c9
1 changed files with 24 additions and 21 deletions

View File

@ -192,7 +192,8 @@ impl Ppu {
}
fn scan_oam(&mut self) {
if self.scan_state.mode() == OamScanMode::Scan {
match self.scan_state.mode() {
OamScanMode::Scan if !self.dma.is_active() => {
if !self.window_stat.coincidence() && self.scan_state.count() == 0 {
// Determine whether we should draw the window next frame
self.window_stat
@ -215,6 +216,8 @@ impl Ppu {
self.scan_state.increase();
}
_ => {}
}
self.scan_state.next();
}