fix: resolve integer overflow in BG0 Drawing

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-21 05:12:22 -03:00
parent acf1a10f91
commit 50dc31447d
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ pub const Ppu = struct {
// and then we can index the palette // and then we can index the palette
const pal_id = if (!is_8bpp) blk: { const pal_id = if (!is_8bpp) blk: {
tile = if (col & 1 == 1) tile >> 4 else tile & 0xF; 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; break :blk pal_bank | tile;
} else tile; } else tile;