chore: properly deallocate OAM buffer
This commit is contained in:
parent
22a8f67d81
commit
242627199b
|
@ -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]));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue