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.
IMPORTANT!
SAVE FUNCTIONS STILL VERY BASIC
UPDATE 11.01.21
- 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
TO DO
- Improved Menu Items / File related Functions
- Nerf the Mouse
- Subtle Sound effects
- General Debugging
Give it a go!
Any help/advice/ideas appreciated.
x Phume
thanks to @tjbynum, @paloblancogames, @shy, @mischa_u
For your quick but smooth cursor, you might want to check out the hardware addresses in memory. Poking values to 0x5f5c and 0x5f5d lets you set the framerate for first press and repeated presses for all btnp inputs.
@shy thanks! Will give it a shot.
EDIT: managed to get the mouse nice and snappy, so might not need to use += and -= on the D-Pad
problem was the 7x7 brush/cursor :-)
--mouse to brush position px=mx-(mx-1)%7+3 py=my-(my-1)%7+3 |
Nice UI! To be able to choose colors "in-line", what do you think about adding X+◀️▶️ controls to pick from the color palette, without having to move to the bottom row?
@mischa_u danke schön. to be honest id rather get the mouse-dpad to feel right instead, you can also pipette with X like in the normal editor, so you dont have to go down as often. but ill try i out :-) maybe the scrolling feels good
this is awesome. can't wait to take a closer look at it when I get home this evening. thanks for this!
@shy @mischa_u @tjbynum did a new version (see cart) changed the init post a bit too. try and figure it out! <3
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?
i'm going to load this up this evening. i didn't have my handheld over the weekend. :(
@tjbynum lemme know what you think, its almost done i'd say.
- needs a memory save function for project specific settings (atm its just the spitesheet)
- and an 8th menu button
@Phume love it dude, great job! it's really snappy and quite fun to create with the Retroflag-GPi Case.
Edit: Help Screen is nice too :D
@tjbynum :-D thnx
added a move option to that hole in the menu (seemed like the best thing to do)
now it needs a good save function and some minor control tweaks for consistency.
x!
@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]