fix(ppu): improve accuracy of SCX discard
This commit is contained in:
parent
e27d6dc25b
commit
d68257bb29
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue