From 50dc31447d402abd7acd64d50d3b4e7d5d688e6c Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:12:22 -0300 Subject: [PATCH] fix: resolve integer overflow in BG0 Drawing --- src/ppu.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppu.zig b/src/ppu.zig index cb14033..f842781 100644 --- a/src/ppu.zig +++ b/src/ppu.zig @@ -114,7 +114,7 @@ pub const Ppu = struct { // and then we can index the palette const pal_id = if (!is_8bpp) blk: { tile = if (col & 1 == 1) tile >> 4 else tile & 0xF; - const pal_bank: u8 = @as(u8, entry.palette_bank.read()) << 4; + const pal_bank: u16 = @as(u8, entry.palette_bank.read()) << 4; break :blk pal_bank | tile; } else tile;