v0.1 ⌊ALPHA⌉
On this page
  1. Jumping
  2. Related
  3. References
  4. Sources

The atlas reads Super Mario Bros. through doppelganger’s annotated disassembly, SMBDIS.ASM, in Xkeeper’s reorganized copy for asm6f. Every label and most comments cited here are doppelganger’s. Jdaster64’s chart, “A Complete Guide to SMB’s Physics Engine”, is the secondary cross-check. It matches the code on every vertical value here but differs on the fast-jump threshold1 and the top speeds2 (see Super Mario Bros. (1985)).

#Jumping

A jump starts only on the frame A goes down while Mario is standing3. His speed then picks one of three distinct jumps1. Variable jump height comes from two gravities: a light one while A is held, and a heavier one for the rest of the jump after release4.

Vertical motion is 8.8 fixed point with a byte of subpixel position5. Falling speed is capped at 4 px/frame6. Nothing in the jump code gives a coyote time window after Mario walks off a ledge7.

References

  1. ^ abInitJS picks one of five jump rows by take-off horizontal speed, stepping up at $09, $10, $19, and $1C. T3Xkeeper0/smb1 · src/prg.asm L4943–4955Jdaster64 n.d. · JUMPING/VERTICAL PHYSICS, Mario table
  2. ^Mario's top ground speed is $18 walking and $28 running (B held). T3Xkeeper0/smb1 · src/prg.asm L4873–4874, L5000–5014Jdaster64 n.d. · SMB PHYSICS 101 / GROUND PHYSICS, Mario table
  3. ^A jump starts only on the frame A goes down while Mario is grounded; InitJS zeroes the vertical subpixel and sets the jumping state. T3Xkeeper0/smb1 · src/prg.asm L4913–4923, L4931–4942, L4139–4141
  4. ^JumpSwimSub swaps in falling gravity, never back, once speed is zero or downward, or once A is not held both this frame and last after a DiffToHaltJump rise. T3Xkeeper0/smb1 · src/prg.asm L4756–4769Jdaster64 n.d. · JUMPING/VERTICAL PHYSICS
  5. ^Vertical motion is 8.8 fixed point; each frame, ImposeGravity adds speed to position, the fraction via the YMF_Dummy subpixel byte, then gravity to speed. T3Xkeeper0/smb1 · src/prg.asm L6666–6687
  6. ^MovePlayerVertically gives ImposeGravity a maximum fall speed of 4 px/frame for Mario. T3Xkeeper0/smb1 · src/prg.asm L6547–6550, L6688–6696Jdaster64 n.d. · JUMPING/VERTICAL PHYSICS
  7. ^Mario gets no grace window after leaving a ledge; ProcJumping refuses airborne jumps unless he is swimming. T3Xkeeper0/smb1 · src/prg.asm L4921–4925
  8. ^Swimming jumps use row 5 of the jump tables, or row 6 in a whirlpool. T3Xkeeper0/smb1 · src/prg.asm L4959–4964

Sources

Code

Secondary