feat(ppu): implement sprite x-flip check

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-04-30 00:20:50 -05:00
parent 3c680dec2f
commit 6ffdd92dbb
1 changed files with 5 additions and 2 deletions

View File

@ -259,9 +259,12 @@ impl Ppu {
let start = ((self.x_pos + 8) - attr.x) as usize; let start = ((self.x_pos + 8) - attr.x) as usize;
let end = 8 - self.fifo.object.len(); let end = 8 - self.fifo.object.len();
for x in start..end { let x_flip = attr.flags.x_flip();
let priority = attr.flags.priority();
for i in start..end {
let x = if x_flip { end - i } else { i };
let priority = attr.flags.priority();
let shade = palette.shade(tbpp.shade_id(x)); let shade = palette.shade(tbpp.shade_id(x));
let fifo_info = ObjectFifoPixel { let fifo_info = ObjectFifoPixel {