This simple code make it so that Mario can't swim in water more than one time without touching the ground.
Note that it's still possible to have him swim more or less high using the directional buttons, though.
It works by modifying controller-related RAM addresses, so look up the code before combining it with another controller-related gimmick.
EDITS & UPDATES:
- fixed issue about not being able to dismount Yoshi while in water.
- fixed issues with "level paused", "message box active" and "sprites locked" flags.
One more note, this still allows the user to swim upwards while carrying an item. So probably don't use it in a level with carryable items, if that's an issue for you.
Thanks a lot for pointing that out. It's been fixed, along with the "level paused" flag and "sprites locked" flag.
Sorry for the inconvenience, I'm missing a lot of obvious things these days.
Follow Us On