Skip to content

Commit

Permalink
style: slight cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukexor committed Oct 14, 2024
1 parent 825719e commit 63e31a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 1 addition & 3 deletions tetanes-core/src/ppu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@ impl Ppu {
bg_priority,
flip_horizontal,
flip_vertical,
attr: *attr,
..Sprite::default()
};

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 0 additions & 3 deletions tetanes-core/src/ppu/sprite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 63e31a9

Please sign in to comment.