Saving all SRAM now. CSTORE() RELOAD()
Despite the setback of not being able to retain all the sprite images with 8192-bytes of data (the full-screen), you can certainly save 4096-bytes and still retain a good 128 of 8x8 pixels sprite data.
In this program, press LEFT to clear the screen.
RIGHT to add a random colored circle in the recorded screen area.
UP to confirm the sprite area is not overwritten (top 128 sprites).
(O) to save off that screen area.
(X) to load it back. Try rebooting and loading only to confirm it is recorded.
Since 4096-bytes is allocated from the Sprite area and is not to be overwritten by other sprites, this method works.
And is still 16 times bigger storage than the default 256-byte or 64-numbers via DGET() and DSET().
A warning red triangle is placed on the sprite sheet to show your limits (Sprite #127), as mentioned above, 128-sprites, and this should be enough for most carts.
Additionally, no mapper, sprite pointers or flags, sound effects, or music values are overwritten. Only the bottom half of the sprite sheet.
Saved data does not have to be pixels, it can be anything you want - up to 4096 bytes starting at memory location 28672 or hex 0x7000.
This program will run correctly and load/save 4096-bytes of external data in:
- Immediate editor mode
- Compiled to EXE/Linux/APP
- Compiled to HTM/JS
- Run in Pico-8's own Splore
- Run Online in the Lexaloffle BBS
- Compiled to Offline file
- Run in Itch.IO
Deleted my 'thinking' comments below as they are no longer needed. This cart works perfectly as is and no other description or information is needed.
HOPE THIS HELPS !
[Please log in to post a comment]