fix(ppu): clear oam on hblank

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-04-20 03:12:39 -05:00
parent 0361d04248
commit db1b40fe2d
1 changed files with 2 additions and 1 deletions

View File

@ -71,6 +71,7 @@ impl Ppu {
// we can reset the ppu x_pos and fetcher state now // we can reset the ppu x_pos and fetcher state now
self.x_pos = 0; self.x_pos = 0;
self.fetcher.hblank_reset(); self.fetcher.hblank_reset();
self.obj_buffer.clear();
self.stat.set_mode(Mode::HBlank); self.stat.set_mode(Mode::HBlank);
} else { } else {
@ -936,7 +937,7 @@ impl ObjectBuffer {
self.len == self.buf.len() self.len == self.buf.len()
} }
pub fn _clear(&mut self) { pub fn clear(&mut self) {
self.buf = [Default::default(); 10]; self.buf = [Default::default(); 10];
self.len = 0; self.len = 0;
} }