diff --git a/src/ppu.zig b/src/ppu.zig index 7b9152b..d8766da 100644 --- a/src/ppu.zig +++ b/src/ppu.zig @@ -71,6 +71,7 @@ pub const Ppu = struct { self.alloc.free(self.framebuf); self.vram.deinit(); self.palette.deinit(); + self.oam.deinit(); } pub fn setBgOffsets(self: *Self, comptime n: u3, word: u32) void { @@ -517,6 +518,10 @@ const Oam = struct { }; } + fn deinit(self: Self) void { + self.alloc.free(self.buf); + } + pub fn get32(self: *const Self, idx: usize) u32 { return (@as(u32, self.buf[idx + 3]) << 24) | (@as(u32, self.buf[idx + 2]) << 16) | (@as(u32, self.buf[idx + 1]) << 8) | (@as(u32, self.buf[idx])); }