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.
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.
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:
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.
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.