Reworked framebuffer and palette storage