fixed sprite bug thanks to /u/dwedit
This commit is contained in:
parent
d3d8b135ca
commit
b35add1999
|
@ -33,5 +33,3 @@ Thanks to Michael Fogleman's https://github.com/fogleman/nes for getting me unst
|
||||||
- Audio
|
- Audio
|
||||||
|
|
||||||
- Player 2 controller?
|
- Player 2 controller?
|
||||||
|
|
||||||
- Sprite bug when Goomba smashed in Mario
|
|
||||||
|
|
|
@ -216,7 +216,7 @@ impl super::Ppu {
|
||||||
if sprite_attributes & (1<<7) == 0 { // if vertical flip bit not set
|
if sprite_attributes & (1<<7) == 0 { // if vertical flip bit not set
|
||||||
fine_y = self.scanline - sprite_y_position; // row-within-sprite offset is difference between current scanline and top of sprite
|
fine_y = self.scanline - sprite_y_position; // row-within-sprite offset is difference between current scanline and top of sprite
|
||||||
} else { // if flipped vertically
|
} else { // if flipped vertically
|
||||||
fine_y = self.sprite_size as usize - (self.scanline - sprite_y_position);
|
fine_y = self.sprite_size as usize - 1 - (self.scanline - sprite_y_position);
|
||||||
}
|
}
|
||||||
address += fine_y;
|
address += fine_y;
|
||||||
let low_pattern_table_byte = self.read(address);
|
let low_pattern_table_byte = self.read(address);
|
||||||
|
|
Loading…
Reference in New Issue