fix(ppu): implement slightly better SCX discarding
This commit is contained in:
parent
aa0e3399f6
commit
0b50e4eae9
|
@ -381,12 +381,11 @@ impl Ppu {
|
||||||
if self.fifo.is_enabled() {
|
if self.fifo.is_enabled() {
|
||||||
use RenderPriority::*;
|
use RenderPriority::*;
|
||||||
|
|
||||||
if self.x_pos == 0 {
|
if self.x_pos == 0 && !self.fifo.back.is_empty() {
|
||||||
// Start of a Scanline
|
let to_discard = self.pos.scroll_x % 8;
|
||||||
let discarded_count = self.pos.scroll_x % 8;
|
|
||||||
|
|
||||||
for _ in 0..discarded_count {
|
for _ in 0..to_discard {
|
||||||
let _ = self.fifo.back.pop_back();
|
let _ = self.fifo.back.pop_front();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue