Skip to content

Commit

Permalink
[LCD] fix y-flip line calculation for 8x16 sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlitGhost committed Nov 7, 2019
1 parent dbccccd commit 8dca8f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gameboy/lcd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ impl LCD {

// calculate the line within the sprite that the current LCD line intersects
let sprite_line = if sprite.attributes.y_flip() {
7 - (self.lcd_y + 16 - y_pos)
(y_size - 1) - (self.lcd_y + 16 - y_pos)
} else {
self.lcd_y + 16 - y_pos
};
Expand Down

0 comments on commit 8dca8f1

Please sign in to comment.