Language…
17 users online: anonimzwx, cohimbra, Darolac, DasFueller, Dennsen86,  Doctor No, Fozymandias, Gamet2004, Green, LightAligns, Metal-Yoshi94, MorrieTheMagpie, Raychu2021, RicardoDeMelo, sinseiga, Sokobansolver, twicepipes - Guests: 268 - Bots: 261
Users: 64,795 (2,375 active)
Latest user: mathew

Walljump/Note Block Glitch Fix patch v1.5 released

Here is a patch that fixes the walljump glitch, where you jump at a wall and "catch" one of the blocks for one frame and can jump off it. This fixes that. It now also fixes the note block clipping glitch where you jump on a note block that is against a wall and clip through the wall and die.

Download ;)
There was a minor side effect of this patch, which is now fixed. If you are big Mario inside a one block high space, Mario would shake back and forth, instead of being pushed to the left.

Edit: Ok, I figured out why. The code at $00ED1C is what makes big Mario in a one block high space get pushed to the left:

Originally posted by SMWDisC.txt
CODE_00ED1C: A5 77 LDA RAM_MarioObjStatus
CODE_00ED1E: 29 FC AND.B #$FC
CODE_00ED20: 09 09 ORA.B #$09
CODE_00ED22: 85 77 STA RAM_MarioObjStatus


This code clears the last two bits (blocked from left and right, even if one was set previously), then sets the up and right bits, which means after this code runs, $77 is always set to blocked from the right, not the left, even if there's a block on Mario's left. Normally, the anti-clipping code at $00EA16 runs after this code runs, meaning Mario would get pushed to the right. But with my pacth, that code runs before this code, meaning Mario got pushed in the opposite direction of the nearest block, which would switch back and forth every frame, causing the shaking.
How did you fix it? I was thinking of making an extra flag that simply disables jumping for one frame after you land, which should also disable bunny hopping, but may throw off people's timing.

If you aren't pushed out of small spaces, isn't it possible to get stuck, or can you still duckjump out?
Your layout has been removed.
Originally posted by KilloZapit
How did you fix it? I was thinking of making an extra flag that simply disables jumping for one frame after you land, which should also disable bunny hopping, but may throw off people's timing.


The code that pushes Mario out of a wall runs after the code that detects if Mario is in contact with the ground, making walljumping possible. I just moved that code to freespace and called it from a hijack that runs before the "Mario is on ground" code runs. This prevents that code from detecting Mario on the ground for one frame when against a wall.

Then I realized the hijack I used doesn't run when Mario is against the side of the screen, but only when Mario is touching a block, meaning you could walk through the side of the screen and die. So I added another hijack to the same code that runs only when Mario is against the side of the screen, fixing that.

Quote
If you aren't pushed out of small spaces, isn't it possible to get stuck, or can you still duckjump out?


You can still duckjump out. But there's a patch that disables duckjumping, right? If that is used with this patch, you could get stuck.

Edit: fixed it by simulating the default behavior (and adding yet another hijack). Depending on the value of $77, it either does nothing, or subtracts 1 or 2 from $94 (using 16-bit mode of course *facepalm*).

Edit: Realized you could still walljump when moving at a wall really fast, because the anti-clipping code only moves Mario out of the block by 1 pixel per frame, meaning you could still be in the wall after the code runs if moving really fast, so you could still walljump. Fixed it by moving Mario outside the block instantly instead of one pixel per frame.

Edit: fixed a glitch where Mario would clip in and out of a block really fast before dying when being crushed between layer 1 and layer 2.

Edit: restored a missing line of code that broke the simulated behavior of big Mario moving left in a one block high space.

Edit: added code to properly fix the note block clipping glitch where you jump on a note block that is against a wall and clip through the wall and die. It needs the same hijack used by this patch, so I combined them.