This is an improved version of my first entry for the Mad Scientist ASM Contest hosted by MarioFanGamer. This sprite makes Mario sink in water at the press of a button, as soon as the button is released Mario will rise and jump out of the water. The lower you were in water, the higher your jump will be. This sprite uses SP1 and a UBERASM patch as level or game mode 14.
It works for the most part, but there's some issues with this that need to be fixed before it can be accepted.
- The graphics are bugged on SA-1, due to a missing table conversion ($15F6). There's also a missing conversion on $13EF, but as far as I could tell this didn't seem to have any effect.
- If you dive deep enough it's possible to accelerate upwards so fast that the speed underflows, sending Mario back down very quickly (usually under the bottom of the level to his death).
- The sprite self-destructs if you collect a powerup or take damage, due to the $71 check. I assume it's intended to be used with all Mario forms, since it doesn't check directly for his powerup status, and I couldn't find any issues with using it when big/cape/fire, so this check should be modified to not include the powerup/powerdown transitions.
Also, while looking at the code I noticed some optimization issues that I'd like to see addressed.
- The most significant one is that you're using ExecutePtr ($0086DF). Although used in the vanilla SMW, it's unnecessarily slow and shouldn't really be used in custom code. A much faster approach is to use JMP (Ptrs,x). For your code, it would look like this:
You can then restore the sprite index at the start of each routine with LDX $15E9|!addr.
- There are a few instances where you've used JMP when you could use BRA, or you could invert the branching logic and let the code fall through without needing to JMP/BRA at all.
- The JSL calls to ROM are missing the |!BankB define, missing out on some extra speed for fastROM users.
- You could have prevented a PHY/PLY pair by putting the tile properties into scratch RAM before calling GetDrawInfo, instead of after. This is minor and doesn't count towards the rejection, but is something to keep in mind.
A few more small issues:
- The jetpack is offset from Mario quite high when riding Yoshi, especially if he's small, and is effectively detached from Mario when ducking. This is more of a nitpick, but it wouldn't be difficult to account for Yoshi when offsetting the sprite from Mario.
- The graphics are incorrectly labeled as using SP1, when they in fact use SP2.