Language…
7 users online: ezdeez85, GRIMMKIN,  Nanako,  Ringo,  Segment1Zone2,  Telinc1, toady - Guests: 244 - Bots: 287
Users: 64,795 (2,375 active)
Latest user: mathew

Level constrain

SMW Patches → Level constrain

This file is obsolete. The latest version is Level Constrain v3.4. For other versions, check the version history.

Submission Details

Screenshots

View all

Comments (5)

HammerBrother Author Link
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:
Code
	..HorizontalLvl
	REP #$20
	LDA #$0190
	CMP $96				;\Check if bottom boundary is is above mario
	BMI ..SetYPosCollisPoint	;/(mario is too far below)
	
	..NormalYPosition
	LDA $96

	..SetYPosCollisPoint
	CLC
	ADC $00E89C,x
	STA $98


Code
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

	.Exceed
	STA $0C

	.Align16x16
	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
Mogu94 Link
Seems in the past there were different options for the same effect but they were quite....terrible. Thanks for this good solution.
lx5 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.
HammerBrother Author Link
Show me a GIF.
Gamma V Link
This caused my hack to softlock in a very specific spot.