ignore bit 0 of tile index for 8x16 objects

This commit is contained in:
Alex Janka 2023-02-10 09:47:57 +11:00
parent 63f98a5ec4
commit 8394b4d225

View file

@ -285,7 +285,10 @@ impl CPU {
if y_pos <= scanline && (y_pos + obj_size.get_height()) > scanline {
// sprite is on line
let x_pos = self.memory.get(i + 1);
let tile_index = self.memory.get(i + 2);
let mut tile_index = self.memory.get(i + 2);
if *obj_size == ObjSize::S8x16 {
tile_index = clear_bit(tile_index, 0);
}
let flags = self.memory.get(i + 3);
let palette_addr = if get_bit(flags, 4) { 0xFF49 } else { 0xFF48 };
objs.push(Object {