Banner
Views: 802,884,043
Time:
15 users online: chickaDEE Magazine, Dippy, FailSandwich, Flat5Games, Green Jerry,  idol, Jose1, Kriogenic, Manofer,  Ninja Boy, placeholdertest, SimFan96, TheLegendaryOrb, TheMorganah, westslasher2 - Guests: 40 - Bots: 76 Users: 41,987 (1,762 active)
Latest: Jose1
Tip: After changing, moving, adding or deleting a level from the overworld, use only EMPTY save files. 0s often contain the old version.Not logged in.
Details for pit fix
SMW Patches - pit fix
This file is obsolete. The latest version is Pit fix. For other versions, check the version history.
File Name: pit fix
Added:
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
16 downloads
Screenshots
Image
HammerBrother
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
JackTheSpades
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.
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


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

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