From 8dca8f123ca944cb3b18c7bacb0ff85a36d12a45 Mon Sep 17 00:00:00 2001 From: StarlitGhost <679547+StarlitGhost@users.noreply.github.com> Date: Thu, 7 Nov 2019 16:10:17 +0000 Subject: [PATCH] [LCD] fix y-flip line calculation for 8x16 sprites --- src/gameboy/lcd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gameboy/lcd.rs b/src/gameboy/lcd.rs index 4165587..a9474a2 100644 --- a/src/gameboy/lcd.rs +++ b/src/gameboy/lcd.rs @@ -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 };