fix(ppu): explicity choose to use sign extension

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-09-21 09:52:12 -03:00
parent 71ce3f43e0
commit 1001b0b124
1 changed files with 2 additions and 2 deletions

View File

@ -325,7 +325,7 @@ impl Ppu {
if self.ctrl.window_enabled() if self.ctrl.window_enabled()
&& !self.window_stat.should_draw() && !self.window_stat.should_draw()
&& self.window_stat.coincidence() && self.window_stat.coincidence()
&& self.x_pos as i16 >= self.pos.window_x as i16 - 7 && self.x_pos as i8 as i16 >= self.pos.window_x as i8 as i16 - 7
{ {
self.window_stat.set_should_draw(true); self.window_stat.set_should_draw(true);
self.fetch.back.reset(); self.fetch.back.reset();
@ -700,7 +700,7 @@ impl PixelFetcher {
let id = self.back.tile.id.expect("Tile Number is present"); let id = self.back.tile.id.expect("Tile Number is present");
let tile_data_addr = match control.tile_data_addr() { let tile_data_addr = match control.tile_data_addr() {
TileDataAddress::X8800 => 0x9000u16.wrapping_add(((id as i8) as i16 * 16) as u16), TileDataAddress::X8800 => 0x9000u16.wrapping_add(((id as i8 as i16) * 16) as u16),
TileDataAddress::X8000 => 0x8000 + (id as u16 * 16), TileDataAddress::X8000 => 0x8000 + (id as u16 * 16),
}; };