Tip: The lowest row of 16x16 tiles in a level do not appear, unless the "Allow viewing full bottom row of tiles" box is checked in the menu. Be mindful of this when designing levels!
Unlike screen constrain, this patch constrains the player and sprite's interaction with blocks within the level (properly, check out the first gif to see why).
V3 update: Now works properly with LMv3.00 dynamic levels patch.
Tester's Note: Does not work with Morton, Roy, Bowser, and Reznor.
3.1 update: now you can disable the patch's effect via a RAM if you want to have only specific levels not to have this effect.
3.2 update:
Freeram is now individual sides-based flags, meaning you can enable/disable top, bottom, left and right side individually.
Fixed a bug with [ConstrainMarioCollisionPoints] which loaded the freeram in 16-bit instead of 8.
Fixed a SA-1 issue at [Sprite_HorizLvl_blk_interYPos]
Slightly improved the insert size - $00E830 and $00E89C indexed now uses word-addressing because long jumps (JSL/JML) don't affect the data bank register.
Screenshots:
Moderated with
Lunar Magic v3.11
Asar 1.71
BSNES v115
Rejected because you don't check whether a sprite is inside the level boundary when you constrain its interaction but in the direction it's offscreen (e.g. constrain only the bottom but not the top). This can easily freeze or crash the game (especially on BSNES or a real console where RAM is initialised with random values).
Suggestions: You don't have to switch between 8-bit and 16-bit A so often just to check a single bit. Remember: All opcodes which modify A work in 8-bit and 16-bit alike and you're already ANDs to begin with. Why don't you use them in 16-bit mode?
Unlike screen constrain, this patch constrains the player and sprite's interaction with blocks within the level (properly, check out the first gif to see why).
V3 update: Now works properly with LMv3.00 dynamic levels patch.
Tester's Note: Does not work with Morton, Roy, Bowser, and Reznor.
3.1 update: now you can disable the patch's effect via a RAM if you want to have only specific levels not to have this effect.
3.2 update (removed because crashing): freeram is now bit-side-based, to make disabling each individual of the 4 sides possible.
Tested with: Lunar Magic 3.11, asar 1.71, SA-1 1.32, bsnes v115.
The patch mostly works fine, but there's an issue that should be addressed before it can get accepted. When enabling the constrain on the bottom, if you have a solid block at the penultimate row of the level, but no block on the last row, Mario will get blocked if he's big: (here I enabled viewing the bottom row in LM so it's easier to show, but it also happens if the setting is turned off).
This doesn't happen if Mario is small (or he's big and ducking) or even if he's on Yoshi:
While you're at it, I can suggest to add the FastROM !bank define for the JMLs in the code, which surely doesn't hurt and helps for FastROM users.
Follow Us On