diff --git a/tetanes-core/src/ppu.rs b/tetanes-core/src/ppu.rs index b835db08..c20874f0 100644 --- a/tetanes-core/src/ppu.rs +++ b/tetanes-core/src/ppu.rs @@ -479,7 +479,6 @@ impl Ppu { bg_priority, flip_horizontal, flip_vertical, - attr: *attr, ..Sprite::default() }; @@ -829,7 +828,6 @@ impl Ppu { sprite.bg_priority = (attr & 0x20) == 0x20; sprite.flip_horizontal = (attr & 0x40) == 0x40; sprite.flip_vertical = flip_vertical; - sprite.attr = attr; for spr in self.spr_present.iter_mut().skip(sprite.x as usize).take(8) { *spr = true; } @@ -1362,7 +1360,7 @@ impl Clock for Ppu { // Post-render line if self.scanline == self.vblank_scanline - 1 { self.frame.increment(); - } else if self.scanline == self.prerender_scanline + 1 { + } else if self.scanline > self.prerender_scanline { // Wrap scanline back to 0 self.scanline = 0; } diff --git a/tetanes-core/src/ppu/sprite.rs b/tetanes-core/src/ppu/sprite.rs index a822c08e..ad96933e 100644 --- a/tetanes-core/src/ppu/sprite.rs +++ b/tetanes-core/src/ppu/sprite.rs @@ -16,7 +16,6 @@ pub struct Sprite { pub tile_addr: u16, pub tile_lo: u8, pub tile_hi: u8, - pub attr: u8, pub palette: u8, pub bg_priority: bool, pub flip_horizontal: bool, @@ -31,7 +30,6 @@ impl Sprite { tile_addr: 0x0000, tile_lo: 0x00, tile_hi: 0x00, - attr: 0xFF, palette: 0x07, bg_priority: true, flip_horizontal: true, @@ -54,7 +52,6 @@ impl fmt::Debug for Sprite { .field("tile_addr", &format_args!("${:04X}", &self.tile_addr)) .field("tile_lo", &format_args!("${:02X}", &self.tile_lo)) .field("tile_hi", &format_args!("${:02X}", &self.tile_hi)) - .field("attr", &format_args!("${:02X}", &self.attr)) .field("palette", &format_args!("${:02X}", &self.palette)) .field("bg_priority", &self.bg_priority) .field("flip_horizontal", &self.flip_horizontal)