From 02d2ff3e0c055b507842fce1f27b03a8bbf9b616 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:12:24 -0300 Subject: [PATCH] fix: palette id is a u16 not a u8 --- src/ppu.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppu.zig b/src/ppu.zig index be7ddd9..d472520 100644 --- a/src/ppu.zig +++ b/src/ppu.zig @@ -157,7 +157,7 @@ pub const Ppu = struct { // Render Current Scanline for (self.vram.buf[start..end]) |byte, i| { - const id = byte * 2; + const id = @as(u16, byte) * 2; const j = i * @sizeOf(u16); std.mem.copy(u8, self.framebuf[(buf_start + j)..][0..2], self.palette.buf[id..][0..2]);