fix(ppu): improve accuracy of SCX discard

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-08-14 22:03:01 -05:00
parent e27d6dc25b
commit d68257bb29
1 changed files with 2 additions and 2 deletions

View File

@ -381,12 +381,12 @@ impl Ppu {
}
if self.fifo.is_enabled() {
if self.x_pos == 0 && !self.fifo.back.is_empty() && self.scanline_start {
if self.x_pos == 0 && self.scanline_start {
self.to_discard = self.pos.scroll_x % 8;
self.scanline_start = false;
}
if self.to_discard > 0 {
if self.to_discard > 0 && !self.fifo.back.is_empty() {
let _ = self.fifo.back.pop_front();
self.to_discard -= 1;