GitHub
Gotta have to change that GitHub repo name eventually...
Anyway, here it is, my new sprite tool. I did release a bit of a "preview" during C3 but this is a slightly more refined version.
I also spent the past week+ on converting some of the original sprite tool sprites for asar + sa-1 support. No need to thank me.
(That said, the sideway thwomps are a bit weird with their graphics appearing cut off. No idea why that happens, so if anybody figures that out, tell me :3)
- Softcoded
The old sprite tool inserted its code as a preassembled byte array and then sets up the calls (hijacks) for it. Put simply, it was a nightmare to read and figure out what hijacks it applied. Here, the applied asm file is available for editing. The tool only generates the binary tables that are included by the asm. So you can basically look at the code and edit it (to some extent) as you like. - Dynamic SA-1 support
Kinda goes hand-in-hand with the softcoded part. The tool doesn't really care if the ROM is SA-1 or not. HOWEVER, there is an asm file with all sa-1 defines that will be default included in every sprite, so you don't have to stick that annoying read1() check for sa-1 at the beginning of every sprite. For all sprite relevant addresses, there exists a define. More info on that is in the readme. - GPS Interface
I basically copied over the interface from p4plus2's GPS for 2 reasons.
1. It's simple, easy and comfortable to use.
2. It's a lot more comfortable to work with multiple tools if they all use the same interface. - Shared Routines
Again, kinda goes hand-in-hand with the GPS interface, so why not copy that over as well? I mean that quite literally, that is 99% the code from GPS copied over. As a friend of mine likes to say: "Why bother to reinvent the wheel".
As such, I included a bunch of common routines you may need in sprites. Check out the included sprites to see how some are used. - Asar Only So yeah, this is one thing that's probably gonna be a problem for many people. The tool only allows asar coded sprites... no more TRASM. That is again for 2 simple reasons. 1. TRASM sucks and 2. I'd have had to literally overthrow the way my entire code works to include this shitty assembler, so no thank you.
- Sprite Tool support The tool basically works the same as sprite tool and can be applied on top of a ROM that used sprite tool before. It will of course remove all the sprites though.
- Per Level Sprites
So here it is, the real reason why I even got into this in the first place. My stupid crazy idea. I noticed we have a lot of things that run on a per level basis. With Vitor's uberASM tool now even NMI. So I thought to myself, "Why not sprites?" and with that, the idea was born.
This tool "sacrifices" 16 global sprite slots and turns them into per level slots. Meaning, you can assign the same sprite number to different sprites depending on the level. Sprite B0 could be a thwomp in level 105 and a hammer bro in level 106 or a reverse boo in level 107.
The 16 slots from B0-BF can be freely assigned across all $200 levels.
Likewise, you can also have a shooter, that shoots sprite B0, which will spawn a sprite depending on the level.
I figured this could be especially neat for collabs and such. - Poison Mushroom
Sprite Tool had a needlessly complicated way to insert the poison mushroom with another preassembled code and then setting up hijacks, all wrapped in a cfg file that doesn't follow the same format as any other cfg file. So I just included a patch you can apply to enable the poison mushroom. It doesn't really have anything to do with the tool. Just grab asar, run the patch, done.
- New CFG Editor
Because I fucking can!!!
v1.1
- Cluster and Extended Sprites
Now supports the insertion of cluster and extended sprites, done so, via the same list file. Just use the header "CLUSTER:" or "EXTENDED:" to switch modes. (or "SPRITE:" but that's default).
Cluster and extended sprites are capped at 0x80 slots. They also get inserted in addition to their original lists, not like custom sprites with their own lists. Which basically just means that, when inserting a cluster sprite in slot 0, you actually have to spawn number 0x09 (and 0x13 for extended).
I realize this might be slightly stupid, but in the end, it's up to the coder to just add the offsets. Better than leaving it up the the enduser to start with slot 9/13. Also, sa1def.asm provides defines:
Code!ClusterOffset = $09 !ExtendedOffset = $13
Also, the way they are inserted now, as oppose to previous tools, they have to end in an RTL, not RTS! The entry point is also no longer controlled by labels, instead it is tagged just like other sprites with:
Codeprint "MAIN ",pc
- Up to 4 Extra Bytes
Controlled via the cfg file and supported by Lunar Magic, you can set up to 4 bytes of custom properties when placing the sprite in the level. Which means you now have 1024 times as many options per sprite as with just the extra bit.
I'd however advice against abusing this too much. For A) sprites still work in 8bit mode and can thus only support 255 bytes of sprite data. Randomly enabling more custom bytes just handicaps yourself. Use it for variable number settings (like how many projectiles a piranha plant shoots).
On the other hand, sprites B0-BF (the per level sprites) always have all 4 custom bytes enabled.
Also, be EXTREMELY CAUTIONS with this feature. Changing the number of extra bytes for an already inserted sprite will corrupt the level data, as Lunar Magic will expect the sprite to be a different size than it is. So make sure to delete all instances of a sprite before changing it's number.
Again, sa1def.asm provides defines to access these bytes within your code:
Code!extra_byte_1 !extra_byte_2 !extra_byte_3 !extra_byte_4
- New Command-Line Options
In addition to the new options for the cluster and extended directory, I changed some of the option names for using custom directories as command line option, so do lookout for that if you had some scripts setup or something. - Updated the CFG Editor
Other than fixing bugs and implementing the new extra bytes, it can now also function as Tweaker for ROMs. So basically, you can open your ROM with it and use it like the Tweaker tool, except this one has all the bits named :3
Pointless Screencap:
