Compare commits

..

2 Commits

2 changed files with 5 additions and 2 deletions

View File

@ -57,7 +57,10 @@ pub fn read32(self: *const Self, addr: u32) u32 {
0x0A00_0000...0x0BFF_FFFF => self.pak.get32(addr - 0x0A00_0000),
0x0C00_0000...0x0DFF_FFFF => self.pak.get32(addr - 0x0C00_0000),
else => std.debug.panic("32-bit read from 0x{X:0>8}", .{addr}),
else => blk: {
log.warn("32-bit read from 0x{X:0>8}", .{addr});
break :blk 0x0000_0000;
},
};
}

View File

@ -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;