fix(ppu): add missing check for enabled interrupt

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-04-04 01:50:49 -05:00
parent 777abd1c10
commit 7c9bff61f6
1 changed files with 6 additions and 1 deletions

View File

@ -102,8 +102,13 @@ impl Ppu {
self.pos.line_y += 1; self.pos.line_y += 1;
if self.pos.line_y == 154 { if self.pos.line_y == 154 {
self.stat.set_mode(Mode::OamScan);
self.pos.line_y = 0; self.pos.line_y = 0;
if self.stat.oam_int() {
self.interrupt.set_lcd_stat(true);
}
self.stat.set_mode(Mode::OamScan);
} }
if self.stat.coincidence_int() { if self.stat.coincidence_int() {