Language…
20 users online: Anas, AnunnakiGirl, CourtlyHades296, CroNo, DaveStateGaming, Green, Mohamad20ZX, Natsuz2, NewPointless, Papangu, SAMYR DUTRA ARAUJO,  Sayuri, Scags, signature_steve, SomeGuy712x, StarWolf3000,  Telinc1, TheBubbster123, TrashCity, yoshisisland - Guests: 282 - Bots: 588
Users: 64,795 (2,369 active)
Latest user: mathew

Pit fix

SMW Patches → Pit fix

Submission Details

Name: Pit fix
Author: HammerBrother
Added:
Version History: View
Tool: Asar
Requires Free Space: Yes
Bug Fix: Yes
Featured: No
Description: This patch fixes a bug that allows the player to go below the level and under blocks to cheat the level. It does this by simply moving the “kill boundary” upwards (position varies depending on Mario's powerup and/or crouching flag to make Mario always invisible). Unlike the Floor Generator made by Chdata, Ladida, and Ramp202, those only sets the player's x speed to #$00, it does work, but it's awkward when NOT touching the walls.

UPDATE: fix an exploit that if you grab p-balloon while crouching, and try to go under blocks, the player is able to survive going under. This because the ducking and powerup check have “opposite” flags, for example: to have 16x32 hitbox, $73 has to be clear AND $19 has to be set. Mario is always “small” regardless of crouching or not when powerup is standard Mario.
Tags: lorom no cheating sa-1 under the level
Comments: 9 (jump to comments)
Download 2.23 KiB | 568 downloads

Screenshots

Comments (9)

DashGamer Link
Can't be used on screenwrap levels and one screen levels. If this was "uberASM" would be way better.
Doopliss Link
Exactly what I needed! Thank you!
 Major Flare Link
Tested with: Asar 1.71, ZMZ 1.08, SA-1 1.32 and LM 3.04.

This patch is already up to the standards and requires no remoderation.
gamerjohn1991 Link
Reminds me of the trick used to get past the battleships in World 8-Battleship of SMB3...
 RussianMan Link
This is a very usefull patch for underwater levels!
Masterlink Link
This is super neat.
lx5 Link
Pretty nice patch, it sure is better than using Floor generators.
HammerBrother Author From older version: pit fix Link
on #3, When you swap the #!YKillBoundaryBig (which is the position of the boundary) and the ram address $80 (mario's Y position within the boarder of the screen), you know that you have to swap the two jump address under the BMI. Since you invert the branch.
JackTheSpades From older version: pit fix Link
Great idea to finally fix this.
On that note, let me just point out 3 things about your code:

1.
Code
	LDA $19			;\Didn't use ORA because what if small mario is crouching?
	BNE .Hitbox_16x32	;|
	LDA $73			;|
	BNE .Hitbox_16x32	;/

yeah... what if? If Mario is small and crouching the first check would pass and the second would branch.
Same if you used ORA.
If you put it into words. Branch if $19 or $73 is not zero. Perfect case for ORA.

2.
The offset difference is always #$08, so unless you have someone who want to do crazy shit like have really different boundries for small and big Mario, you can just let asar do the math:

Code
!YKillBoundarySmall	= $00D8
!YKillBoundaryBig	= !YKillBoundarySmall+$08


3.
If you concider the fact that the highbyte of those boundries always has to be 0 (because 01 is far below the screen and FF is inside the status bar), you can leave that part out. If, in combination, you just load the values themselfs and not use a table, you can save a couple of bytes from the code. 9 bytes to be precise, which isn't an awful lot, so I accepted it anyway.

9 bytes shorter code:
not fully tested so feel free to correct me.
Code
	LDA #$00
	XBA	
	LDA $19
	ORA $73
	BNE +
	LDA #!YKillBoundarySmall
	BRA ++
+
	LDA #!YKillBoundaryBig
++
	REP #$20
	CMP $80
	SEP #$20
	BMI +
	JML $00F5B6
+	JML $00F5AA


You could kill another 2 bytes if you ditched ORA $73, since, given that Mario could only go below the level by swimming and flying, crouching shouldn't be of concern.
As well as maybe another 3 bytes (LDA #$00 : XBA) if the high byte of A is always #$00 when entering the code. Could be, didn't dig that deep.