From db1b40fe2d1a641314e4f3939d7656feab502899 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Tue, 20 Apr 2021 03:12:39 -0500 Subject: [PATCH] fix(ppu): clear oam on hblank --- src/ppu.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ppu.rs b/src/ppu.rs index 9b03093..d3b69bc 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -71,6 +71,7 @@ impl Ppu { // we can reset the ppu x_pos and fetcher state now self.x_pos = 0; self.fetcher.hblank_reset(); + self.obj_buffer.clear(); self.stat.set_mode(Mode::HBlank); } else { @@ -936,7 +937,7 @@ impl ObjectBuffer { self.len == self.buf.len() } - pub fn _clear(&mut self) { + pub fn clear(&mut self) { self.buf = [Default::default(); 10]; self.len = 0; }