|File Name:||Lock mario in place with L or R|
|Description:||I was asked for this very simple level ASM multiple times so I think it is a good idea to upload it. |
All this does is set mario's position next frame to his position this frame if L is pressed. That means momentum is stored and can be gained even when locked. You can gain p-speed that way and change your direction midair.
Works in vertical levels as well.
The first is that the code is able to run in places where it shouldn't, including the No Yoshi/Castle/Ghost house intros, and during the goal walk sequence. A more fatal place where it can run is during pipe transitions - Mario can lock during the pipe exit, trapping him inside the pipe and killing him. Checks should be included so that the locking only occurs when the player has full control over Mario. Additionally, locking Mario during an autoscroll can push him past the screen boundary and kill him.
The second issue is that the code is unoptimized - You're using long ($xxxxxx) addressing for direct page addresses ($D1-$D4 and $94-$97). RAM in bank $7E from $7E0100-$7E1FFF can use absolute ($0100-$1FFF) addressing, and RAM in bank $7E from $7E0000-$7E00FF can use direct ($00-$FF) addressing. This reduces both the insert size of the code, and the processing load (runs faster). You already did this with $17, it just needs to be done for $D1-$D4 and $94-$97 too.
While not a rejection reason, it would also be nice to have SA-1 compatibility. All that needs to be done is to put "|!addr" without quotation marks on the end of $1401 (provided you also reduce the Mario position RAM to direct addressing as mentioned above).
Finally, please add relevant tags when submitting.
• Lunar Magic 3.21
• UberASM Tool 1.4
• Snes9x v1.60
• bsnes plus v05