mirror of
https://github.com/FranLMSP/rmg-001.git
synced 2024-11-23 10:12:11 +00:00
Fix OAM search bug
This commit is contained in:
parent
5d488d4fa6
commit
488f36272c
@ -114,7 +114,7 @@ impl Sprite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_pixel(&self, lcd_x: u8, lcd_y: u8, bus: &Bus) -> Option<Pixel> {
|
pub fn get_pixel(&self, lcd_x: u8, lcd_y: u8, bus: &Bus) -> Option<Pixel> {
|
||||||
todo!("Implement sprite flipping");
|
// todo!("Implement sprite flipping");
|
||||||
if lcd_x < self.x.saturating_sub(8) || lcd_x >= self.x {
|
if lcd_x < self.x.saturating_sub(8) || lcd_x >= self.x {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -269,7 +269,7 @@ impl PPU {
|
|||||||
|
|
||||||
let lcd_y = PPU::get_lcd_y(bus).saturating_add(16);
|
let lcd_y = PPU::get_lcd_y(bus).saturating_add(16);
|
||||||
|
|
||||||
if lcd_y < y || lcd_y > (y + sprite_height) {
|
if lcd_y < y || lcd_y > (y + sprite_height - 1) {
|
||||||
addr += 4;
|
addr += 4;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user