Figure out a way to export a whole page to a png (or otherwise). Perhaps create LAYERS+1 large arrays in memory, and redo all the drawing commands on the cpu in main memory on those buffers, then merge them all together into the last buffer and save that one. Note that the 3ds byte order matters if you're doing u32; it may be faster to simply work with the 4 byte aligned data and reconfigure it before passing it off to a png function.
Figure out a way to export a whole page to a png (or otherwise). Perhaps create LAYERS+1 large arrays in memory, and redo all the drawing commands on the cpu in main memory on those buffers, then merge them all together into the last buffer and save that one. Note that the 3ds byte order matters if you're doing u32; it may be faster to simply work with the 4 byte aligned data and reconfigure it before passing it off to a png function.