From 746206193796c7d02ecb655aa3622f3c463c24dd Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sat, 20 Mar 2021 22:19:55 -0500 Subject: [PATCH] chore: be more specific with integer types --- src/ppu.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ppu.rs b/src/ppu.rs index 3323856..0d2d520 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -108,8 +108,8 @@ impl Ppu { TileMapAddress::X9C00 => 0x9C00, }; - let y_pos: usize = scroll_y as usize + self.pos.line_y as usize; - let tile_row: usize = (y_pos as usize / 8) * 32; + let y_pos: u16 = scroll_y as u16 + self.pos.line_y as u16; + let tile_row: u16 = (y_pos as u16 / 8) * 32; for (i, chunk) in scanline.chunks_mut(4).enumerate() { let x_pos = i as u8 + scroll_x;