Views: 853,896,436
16 users online:  Anorakun, autisticsceptile1993, chickaDEE Magazine,  Deeke, DeppySlide, Fermín Acosta Jr., Infinity, King Mayro,  Major Flare, MasterBugCatcher,  Maxodex, Mediocre Espurr, MrDeePay,  Ninja Boy, pixelninetales, UlticraftMTT - Guests: 104 - Bots: 52 Users: 47,116 (2,486 active)
Latest: brosalez275
Tip: Take advantage of easy to install Patches in your hack. The No More Sprite Tile Limits patch should be considered if you're encountering glitches where Mario and/or sprites are turning invisible.Not logged in.
Details for pit fix
SMW Patches - pit fix Show random
This file is obsolete. The latest version is Pit fix. For other versions, check the version history.
File Name: pit fix
Version History: View
Authors: HammerBrother
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.
Tags: lorom, no cheating, sa-1, under the level
Download: Download - 1.66 KiB
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.
Posted by: HammerBrother - | Link
Great idea to finally fix this.
On that note, let me just point out 3 things about your 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.

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:

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

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.
	LDA #$00
	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.
Posted by: JackTheSpades - | Link

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

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


Follow Us On

  • YouTube
  • Twitch
  • Twitter


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