Skip to content

Commit

Permalink
only request coincidence interrupt after hblank
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Jan 12, 2021
1 parent a4fb8a0 commit d7600f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/graphics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ impl Ppu {
self.modeclock = 0;
self.line += 1;

if self.lcd_status_interrupts.ly_lyc_coincidence && self.line == self.line_compare {
interrupts.lcd_status.requested = true;
}

if self.line > 143 {
// Push the pixels to a frame.
self.frame = self.pixels.clone();
Expand Down Expand Up @@ -337,10 +341,6 @@ impl Ppu {
}
_ => (),
}

if self.lcd_status_interrupts.ly_lyc_coincidence && self.line == self.line_compare {
interrupts.lcd_status.requested = true;
}
}
}

Expand Down

0 comments on commit d7600f7

Please sign in to comment.