some fixes

This commit is contained in:
Alex Janka 2023-04-22 17:09:38 +10:00
parent 27e0374181
commit 9ada49a6d8
2 changed files with 3 additions and 2 deletions

View file

@ -319,9 +319,10 @@ where
Address::Io(address) => { Address::Io(address) => {
if address.inner() == 0xFF50 { if address.inner() == 0xFF50 {
self.bootrom = None self.bootrom = None
} } else {
self.set_io(address, data) self.set_io(address, data)
} }
}
Address::Hram(address) => self.cpu_ram[address.get_local() as usize] = data, Address::Hram(address) => self.cpu_ram[address.get_local() as usize] = data,
Address::InterruptEnable(_) => self.interrupts.set_enable_register(data), Address::InterruptEnable(_) => self.interrupts.set_enable_register(data),
} }

View file

@ -420,7 +420,7 @@ where
} }
fn render_object(&mut self, scanline: u8, object: Object) { fn render_object(&mut self, scanline: u8, object: Object) {
let mut object_row = scanline - (object.y.wrapping_sub(16)); let mut object_row = scanline.wrapping_sub(object.y.wrapping_sub(16));
if object.flags.y_flip { if object.flags.y_flip {
object_row = self.lcdc.obj_size.get_height() - (object_row + 1); object_row = self.lcdc.obj_size.get_height() - (object_row + 1);
} }