Views: 873,647,362
43 users online: Anas,  bebn legg,  brickblock369, callmeCMDR, Carld923, chickaDEE Magazine, ExONightZ, Gulaschko, Hat Kid, HerrBoesch, jardeson01, Jazzman287, K.T.B.,  Katerpie,  LMNtals, MarkVD100, Matheus2653,  Maxodex, MegaSonic1999, MercuryPenny, MORC, Mpereira,  Nameless, Narcologer, NewPointless,  Ninja Boy,  Noivern, paidoseunenem,  patcdr, polosxcks, RPG Hacker, Rykon-V73,  Sinc-X, Sixcorby,  Stivi,  Tahixham,  Telinc1,  Teows, Tommitalia, Von Fahrenheit, WhiteYoshiEgg, yoshifanatic, zerociaran - Guests: 80 - Bots: 112 Users: 48,646 (2,411 active)
Latest: zerociaran
Not logged in.
Details for Level constrain
SMW Patches - Level constrain Link - Show random
This file is obsolete. The latest version is Level Constrain v3.4. For other versions, check the version history.
File Name: Level constrain
Version History: View
Authors: HammerBrother
Tool: Asar
Requires Free Space: Yes
Bug Fix: No
Featured: No
Description: 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).
Tags: anti-cheat, lorom, needs remoderation, over the level, sa-1, under the level
Download: Download - 3.78 KiB
Thankfully, this patch is lucky that none of its hijacks clashes with LM v3.00's dynamic levels patch.

However, because the patch assumes that horizontal levels always have a bottom border at Y=$01A0, this is not the case if you change the “Horizontal Level Mode” in “Change Properties in Header” to other than the first option saying “Level height=01B tiles, Max H-Screens=20”.

Therefore if the player or sprite is below Y=$0190 (2D Y-positions values increases as they descend), the player/sprite will only interact with blocks at Y=$01A0, causing the bottom of the newly expanded area useless. Currently, I'm trying to find a RAM value that is based on the level dimension setting.

This is what needs to be changed:
	REP #$20
	LDA #$0190
	CMP $96				;\Check if bottom boundary is is above mario
	BMI ..SetYPosCollisPoint	;/(mario is too far below)
	LDA $96

	ADC $00E89C,x
	STA $98

Sprite_HorizLvl_blk_interYPos:		;>$0194D4
	LDA #$0000			;>Top of level
	CMP $0C				;>Collision point Y position
	BPL .Exceed			;>If top of level below collision point (collision is above)
	LDA #$01AF			;>Bottom of level
	CMP $0C				;>Collision point Y position
	BMI .Exceed			;>If bottom of level is above collision point (collision is under)
	SEP #$20
	JML $0194DD			;>Continue on with code

	STA $0C

	SEP #$20
	AND #$F0			;\So it doesn't glitch out with blocks ($0194C5)
	STA $00				;/that need 16x16 alignment
	JML $0194DD			;>Continue on with code
Posted by: HammerBrother - | Link
Seems in the past there were different options for the same effect but they were quite....terrible. Thanks for this good solution.
Posted by: Mogu94 - | Link
This is a good patch, I really liked testing it! Turnblocks are very interesting with this patch, because you can pass through them and that also applies to the top of the screen, I can think of some interesting set ups with this.

Good job.
Posted by: lx5 - | Link
Show me a GIF.
Posted by: HammerBrother - | Link
Gamma V
This caused my hack to softlock in a very specific spot.
Posted by: Gamma V - | Link

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Super Mario Bros. X Community
  • Mario Fan Games Galaxy
  • sm64romhacks