I'm making a sexy little 16x16 sprite editor with playback and more that should rely on the D-Pad and Buttons. Doing so mainly for use on the Retroflag-GPi case, or any other handheld.
SAVE FUNCTIONS STILL VERY BASIC
- Added Move-tool
- Added Palette-swapper
- Added Tooltips on hover (disable in menu)
- Added Save (cart overwrite? dunno?)
- Added Export Spritesheet
- Added Clear All (Default Empty Project)
- Improved usability/ button press consistency
- Improved Menu Items / File related Functions
- Nerf the Mouse
- Subtle Sound effects
- General Debugging
Give it a go!
Any help/advice/ideas appreciated.
there's a hole in the menu for.. I dunno... a palette switcher...
...or a d-pad on/off for 8-directional controls during playback.
still haven't looked into how to save projects, any suggestions?
@shy managed to implement a palette switcher,
including that new scanline trick :-/ what a slog ;-)
(X+arrows when in the palette tray, give it shot!)
I was meaning to ask you if you had any tips on saving carts?
in this case: sprite sheet, some ints, some bools and 3 tables (see post update).
Any ideas? Thx!
EDIT: Managed to implement a save function + sprite sheet overwrite using your bitwise tutorial (coincidence! haha) Question still applies though, I don't really get what I'm doing.
This tool is actually shaping up really well! Noticed one small glitch when you hold X and move the mouse up and down in the main area - it does undo / redo steps as you move the mouse, which felt very odd. And the only way I was able to get to the palette swapping menu was by moving the mouse to the bottom palette and then holding X while pressing arrow keys, but once I figured that out it was pretty intuitive. Nice work on that feature!
For saving carts, there are three methods (two listed in the manual, and one that's kind of a loophole): cstore, persistent data, and cartridge creation. cstore gives you 6kb of storage at the cost of replacing the cart data in ROM of some cartridge (0x0000-0x5fff in memory), persistent data only gives you 256 bytes (and also exists in the memory/ROM at addresses 0x5f00-0x5f3f), and cartridge creation theoretically gets you massive Lua-based storage at the cost of usability.
For your project, I'd recommend saving like this:
- use cstore(0,0,0x2000) to save the spritesheet, optionally with a string to specify the cartridge file name.
- save the other project data as raw numbers in persistent data. If you have <= 64 ints/bools in total, you can just use dset() and dget(). Otherwise you'll have to bit-shift the bools (and maybe ints too) to compress how much space each one takes. For tables, just save their contents one value at a time, and then load them back in in the exact same way.
If your projects have a huge amount of data to save, you can also look into writing new carts via printh(). I don't recommend this, but it is the most storage you'll get. This link explains the basics, and this link shows a fully implemented demo for saving tables of data to be loaded later.
It takes advantage of the fact that #include happens at runtime, so the next time the cart reboots or runs, the updated project settings data file would be injected into the Lua code right where the #include line is. This method won't work with BBS carts at all, though, so it's definitely a bit of a limited hack.
Good luck, that's all the advice I have on saving files!
@shy yeah it's still a bit of a mouse/d-pad mismatch in terms of the controls atm.
I do want to prioritise the d-pad so that it can be used on a handheld (hence the oversized 7x7 brush) so I think i'll remove mouse_move==d-pad usability when it comes to undo/palette, ect.
L/R Click==O/X Btns seems fine on the other hand.
I think I used roughly what you described for saving, but still kinda confused when it comes to BBS/Local saves/Export. Essentially I want a standalone little cart that you can just duplicate as if it was (is) also the project file. Hence my last qu: any way I can retrieve the cart filename from within the script? I found the file commond and file() function but couldn't isolate a string.
Amazing advice. Much Appreccio <3 Thanks!
[Please log in to post a comment]