E-122-Psi, on 11 October 2014 - 06:06 AM, said:
Also, more a question for the long run, is it possible to put new gameplay objects into the S3+K disassembly (I don't think I've seen any projects that do so, unless Tiddle's extras in Complete apply). If it is, you know what must happen...
I create all sorts of objects for S3C, though they're mostly of the helper object kind. There's no special trick to it compared to any of the other games, as far as I know, but there are a few things to remember:
- Instead of a single byte object ID at the start of the object's memory, there is a four byte pointer directly to the location of the object's code. This is really handy because you can have objects that you just spawn on demand that don't need to waste space in any of the level object lists (e.g. none of the player objects have IDs, because you'd never place them in a level layout), and you can also avoid the boring routine counter and jump table by just pushing a new code address to (a0) when you want the object to run different code next frame. Objects in S3&K use both this technique and the old routine technique, which obviously still works fine.
- If you do need the object to appear in a level, you need to add it to as slot under either Sprite_Listing3 or Sprite_ListingK (or both) depending on which levels you want to be able to use it in. Sprite_ListingK covers the levels that only appear in S&K excluding Flying Battery and the bonus stages, and Sprite_Listing3 covers everything else. The files for these are "Levels/Misc/Object list - Sonic 3.asm" and "Levels/Misc/Object list - Sonic & Knuckles.asm".
- I understand there are various differences in areas such as priority definition, but I don't really work with the other games so I can't tell you a lot about that. As usual, all the necessary helper routines probably have different names from any of the other disassemblies.
So basically, write some object-style code, add a pointer to the start of it into one of the object lists if you want it in a level, ??? and profit.
This post has been edited by Tiddles: 11 October 2014 - 04:37 PM

14