|Description:||Limits the number of spawned magikoopa magics (and sprites they turn into). If the limit is reached, the oldest sprite is despawned.
(Screenshot shows limit of 3)
|Tags:||filter lorom sa-1 sprite|
|Comments:||3 (jump to comments)|
Download 1.54 KiB | 72 downloads
One thing to note is that this is somewhat unstable in the sense that you should always use the unpatch should you remove the code as the magic init code will point to garbage and crash the game (it's actually this reason why some — including me — don't like the inclusion of hijacks with UberASM).
- Lunar Magic v3.33
- SA-1 Pack v1.40
- UberASM Tool v1.5
- Asar v1.81 (for the unpatch)
- BSNES v115
Since there is an easy workaround for this (if you intend to not use it, just use the unpatcher), I decided to pass it since I haven't found any other issues.
Sure, you can "JSL read3($01FFFC+1)+7" with the sprite index in x. e.g. you can put it in the magic init routine (and ensure that the sprite is being spawned with state=1 aka init).
Note that running UberASM may change where the code is, so be sure to always run Pixi again after running UberASM.
The magikoopa disassembly spawns magic in state 8. Change 08 to 01 here to spawn it in the init state: