Claim set · data/claims/smb1.yaml

Super Mario Bros. (doppelganger's SMBDIS via Xkeeper0/smb1)

Game: Super Mario Bros..

A jump starts only on the frame A goes down while Mario is grounded; the jump setup zeroes the vertical subpixel and sets the jumping state. smb1/jump-start

About: Super Mario Bros. Jump

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4913-L4923LDA A_B_Buttons ; check for A button press … AND PreviousA_B_Buttons ; if button not pressed in previous frame, branch … LDA Player_State ; check player state BEQ InitJS ; if on the ground, branchsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4931-L4942STY Player_YMF_Dummy … LDA #$01 ; set player state to jumping/swimmingsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4139-L4141STA PreviousA_B_Buttons ; into temp variable to be used on next frameChecked by claude, 2026-10-20 — read CheckForJumping/ProcJumping/InitJS and SaveAB at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.

In other builds: Europe (same bytes); Japan Disk System (same code, other addresses).

Cited by: Jump, Super Mario Bros., Variable jump height

The jump setup picks one of five jump rows by take-off horizontal speed, stepping up at $09, $10, $19, and $1C. smb1/jump-row-thresholds

About: Super Mario Bros. Jump

Value: 9, 16, 25, 28 (1/16 px/frame)

Codedisputedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4943-L4955LDA Player_XSpeedAbsolute ; check value related to walking/running speed CMP #$09 … CMP #$10 … CMP #$19 … CMP #$1c BCC ChkWtr ; note that for jumping, range is 0-4 for YA Complete Guide to SMB's Physics Engine · JUMPING/VERTICAL PHYSICS, Mario table — the chart's speed bandsLess than 01000 | 01000 – 024FF | 02500 or greaterChecked by claude, 2026-10-20 — read InitJS at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.

In other builds: Japan Disk System (moved); Europe (changed, 16 of 23 bytes the same).

Disputed: Jdaster64's chart groups the speeds as below 1 px/frame, 1 to 2.3125 px/frame ("02500" in its notation) and above. The code moves to the fast rows at $19 (1.5625 px/frame), just above the walking top speed $18, so the code's boundary is used here.

Rows 0 and 1 hold identical values in every table, as do rows 3 and 4, so there are three distinct jumps. Horizontal speed is 4.4 fixed point (see x-speed-format).

Cited by: Jump, Super Mario Bros., Super Mario Bros. 2, Variable jump height

Horizontal speeds are 4.4 fixed point, whole pixels and sixteenths per frame; the horizontal-move routine shifts the sixteenths into the subpixel byte. smb1/x-speed-format

About: Super Mario Bros. Running

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6492-L6503ASL ; and move low nybble to high … LSR ; move high nybble to lowChecked by claude, 2026-10-20 — read MoveObjectHorizontally at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.

In other builds: Europe, Japan Disk System (moved).

Cited by: Fixed-point arithmetic, Subpixel, Super Mario Bros.: The Lost Levels

Mario's top ground speed is $18 walking and $28 running (B held). smb1/walk-run-max-speed

About: Super Mario Bros. Running

Value: run 40 · walk 24 (1/16 px/frame)

Codedisputedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4873-L4874MaxRightXSpdData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5000-L5014AND #B_Button BNE SetRTmr ; if pressed, skip ahead to set timer … INY ; if running timer not set or level type is water,A Complete Guide to SMB's Physics Engine · SMB PHYSICS 101 / GROUND PHYSICS, Mario tableMaximum walk speed (normal, castle cutscene) 01900 | Maximum running speed 02900Super Mario Bros. (World) · 0x3453-0x3455 — MaxRightXSpdDataChecked by claude, 2026-10-20 — read X_Physics and the max-speed table at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-11-18.

In other builds: Japan Disk System (moved); Europe (changed, 25 of 28 bytes the same).

Disputed: Jdaster64's chart gives 01900 and 02900 (1.5625 and 2.5625 px/frame), one sixteenth above the code's caps. The ledger follows the code.

So a walking jump uses row 2 and a full-speed running jump row 4.

Cited by: Super Mario Bros., Super Mario Bros. 2, Super Mario Bros. 3, Super Mario Bros.: The Lost Levels, Variable jump height

The jump-speed table starts a jump at −4 px/frame (rows 0–2) or −5 px/frame (rows 3–4). smb1/jump-y-speed

About: Super Mario Bros. Jump

Value: -4, -4, -4, -5, -5 (px/frame)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4864-L4865PlayerYSpdData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4972-L4973LDA PlayerYSpdData,y STA Player_Y_SpeedA Complete Guide to SMB's Physics Engine · JUMPING/VERTICAL PHYSICS, Mario table, Initial Velocity (−Y)04000 | 04000 | 05000Super Mario Bros. (World) · 0x3442-0x3448 — PlayerYSpdDataChecked by claude, 2026-10-20 — read the table and GetYPhy at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Japan Disk System (changed, 7 of 12 bytes the same); Europe (not found).

Native units are px/frame already. Negative is up. Rows 5–6 are swimming.

Cited by: Jump, Super Mario Bros. 2, Super Mario Bros. 3, Super Mario Bros.: The Lost Levels, Super Mario World, Variable jump height

The jump's starting-fraction table gives jump rows 0–4 a zero speed fraction, so take-off is exactly −4.00 or −5.00 px/frame. smb1/jump-init-moveforce

About: Super Mario Bros. Jump

Value: 0, 0, 0, 0, 0 (1/256 px/frame)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4867-L4868InitMForceData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4970-L4971LDA InitMForceData,y STA Player_Y_MoveForceSuper Mario Bros. (World) · 0x3449-0x344f — InitMForceDataChecked by claude, 2026-10-20 — read the table and GetYPhy at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 10 of 13 bytes the same).

Cited by: Variable jump height

While a jump rises with A held, gravity is the rising-gravity table's $20, $20, $1E, $28, $28 subpixels/frame² for rows 0–4. smb1/jump-gravity-held

About: Super Mario Bros. Variable jump height

Value: 32, 32, 30, 40, 40 (1/256 px/frame²)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4858-L4859JumpMForceData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4966-L4967LDA JumpMForceData,y ; store appropriate jump/swim STA VerticalForce ; data hereA Complete Guide to SMB's Physics Engine · JUMPING/VERTICAL PHYSICS, Mario table, Holding “A” Gravity (+Y)00200 | 001E0 | 00280Super Mario Bros. (World) · 0x3434-0x343a — JumpMForceDataChecked by claude, 2026-10-20 — read the table and GetYPhy at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Japan Disk System (same code, other addresses); Europe (not found).

In px/frame² (exact) 0.125, 0.125, 0.1171875, 0.15625, 0.15625.

Cited by: Gravity, Super Mario World, Variable jump height

After the switch, gravity is the falling-gravity table's $70, $70, $60, $90, $90 subpixels/frame² for rows 0–4. smb1/jump-gravity-fall

About: Super Mario Bros. Variable jump height

Value: 112, 112, 96, 144, 144 (1/256 px/frame²)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4861-L4862FallMForceData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4968-L4969LDA FallMForceData,y STA VerticalForceDownA Complete Guide to SMB's Physics Engine · JUMPING/VERTICAL PHYSICS, Mario table, Falling Gravity (+Y)00700 | 00600 | 00900Super Mario Bros. (World) · 0x343b-0x3441 — FallMForceDataChecked by claude, 2026-10-20 — read the table and GetYPhy at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Japan Disk System (same code, other addresses); Europe (not found).

In px/frame² (exact) 0.4375, 0.4375, 0.375, 0.5625, 0.5625, about 3.5 times the held value.

Cited by: Gravity, Super Mario World, Variable jump height

In rows 0–1, the standing and slow jumps, held gravity is $20/256 = 0.125 px/frame². smb1/standing-gravity-held

About: Super Mario Bros. Variable jump height

Value: 0.125 px/frame²

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4858-L4859JumpMForceData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6681-L6687LDA SprObject_Y_MoveForce,x CLC ADC $00 ; add downward movement amount to contents of $0433 STA SprObject_Y_MoveForce,x LDA SprObject_Y_Speed,x ; add carry to vertical speed and store ADC #$00Super Mario Bros. (World) · 0x3434-0x343a — JumpMForceDataChecked by claude, 2026-10-20 — read JumpMForceData (L4858-L4859) and ImposeGravity (L6681-L6687) at the pinned commit; the force adds to the speed's fraction byte and carries into the pixel byte, so $20 is 32/256 px/frame² per frameChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-11-18.

In other builds: Europe (changed, 15 of 22 bytes the same); Japan Disk System (changed, 20 of 22 bytes the same).

Row 0 is a take-off below $09 (standing or barely moving); row 1 holds the same values.

Cited by: Super Mario Bros. 3, Variable jump height

In rows 0–1, falling gravity is $70/256 = 0.4375 px/frame². smb1/standing-gravity-fall

About: Super Mario Bros. Variable jump height

Value: 0.4375 px/frame²

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4861-L4862FallMForceData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6681-L6687ADC $00 ; add downward movement amount to contents of $0433 STA SprObject_Y_MoveForce,xSuper Mario Bros. (World) · 0x343b-0x3441 — FallMForceDataChecked by claude, 2026-10-20 — read FallMForceData (L4861-L4862) and ImposeGravity (L6681-L6687) at the pinned commit; $70 is 112/256 px/frame²Checked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-11-18.

In other builds: Europe (changed, 15 of 22 bytes the same); Japan Disk System (changed, 20 of 22 bytes the same).

Cited by: Super Mario Bros. 2, Super Mario Bros. 3, Variable jump height

In rows 0–1, falling gravity ($70) is 3.5 times held gravity ($20). smb1/standing-gravity-ratio

About: Super Mario Bros. Variable jump height

Value: 3.5 ×

CodeSuper Mario Bros. (World) · 0x3434-0x3441 — JumpMForceData, FallMForceDataChecked by claude, 2026-10-20 — read both tables at the pinned commit; row 0 of FallMForceData over row 0 of JumpMForceData is 112 / 32 = 3.5 (rechecked 2026-10-25)Checked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-11-18.Probe: probes/jump-physics/jump-heights.mjs

In other builds: Japan Disk System (moved); Europe (not found).

The other rows give 3.2 (walking, row 2) and 3.6 (running, rows 3–4).

Cited by: Variable jump height

The jump-and-swim routine swaps in falling gravity, never back, once speed is zero or downward, or once the jump has risen at least a set minimum (smb1/diff-to-halt-jump) on a frame when A is not held, or was not held the frame before. smb1/gravity-switch

About: Super Mario Bros. Variable jump height

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4756-L4769BPL DumpFall ; or moving downwards, branch to falling … AND PreviousA_B_Buttons ; and was pressed in previous frame BNE ProcSwim ; if so, branch elsewhere … CMP DiffToHaltJump ; compare to value set here to see if player is in mid-jump LDA VerticalForceDown ; otherwise dump falling into main fractional STA VerticalForceA Complete Guide to SMB's Physics Engine · JUMPING/VERTICAL PHYSICSso long as they are moving upward in a jump, holding “A” will make them rise more slowlyChecked by claude, 2026-10-27 — read JumpSwimSub at the pinned commit; re-read in the audit: held gravity stays only while A is held this frame and last (AND PreviousA_B_Buttons)Revised after a check by a second AI model, 2026-10-27: "Not held both this frame and last" read two ways; held gravity stays only while A is held on both frames.Revised after a check by a second AI model, 2026-10-28.

In other builds: Europe (same bytes); Japan Disk System (moved).

Cited by: Gravity, MDA framework, Super Mario Bros., Super Mario Bros. 2, Super Mario Bros. 3, Super Mario World, Variable jump height

The jump setup sets the minimum rise for a release to 1, so a release switches gravity only once Mario has risen at least 1 pixel. smb1/diff-to-halt-jump

About: Super Mario Bros. Variable jump height

Value: 1 px

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4957-L4958LDA #$01 ; set value here (apparently always set to 1) STA DiffToHaltJumpChecked by claude, 2026-10-20 — read ChkWtr at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.

In other builds: Europe (same bytes); Japan Disk System (moved).

The press frame always moves Mario up 4 or 5 pixels, so in practice a release on the second frame already switches.

Cited by: Variable jump height

The press frame already moves Mario, since the player physics routine starts the jump before the state dispatch runs the jump-and-swim routine and the vertical move. smb1/jump-frame-moves

About: Super Mario Bros. Jump

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4713-L4725JSR PlayerPhysicsSub ; run sub related to jumping and swimming … JSR JumpEngine .dw OnGroundStateSub .dw JumpSwimSubsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4796JMP MovePlayerVertically ; jump to move player vertically, then leaveChecked by claude, 2026-10-20 — read PlayerMovementSubs and JumpSwimSub at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.

In other builds: Europe (changed, 26 of 29 bytes the same); Japan Disk System (changed, 17 of 29 bytes the same).

Cited by: Jump, Variable jump height

Vertical motion is 8.8 fixed point; each frame, the gravity routine adds speed to position, the fraction via a subpixel byte, then gravity to speed. smb1/subpixel-motion

About: Super Mario Bros. Gravity

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6666-L6687ADC SprObject_Y_MoveForce,x STA SprObject_YMF_Dummy,x … ADC SprObject_Y_Position,x ; add vertical position to vertical speed plus carry … ADC $00 ; add downward movement amount to contents of $0433 … LDA SprObject_Y_Speed,x ; add carry to vertical speed and storeChecked by claude, 2026-10-20 — read ImposeGravity at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.

In other builds: Europe (moved); Japan Disk System (changed, 44 of 44 bytes the same).

Position moves by the old speed before gravity is added, so one frame's displacement is the speed at the start of that frame. Resolution is 1/256 px.

Cited by: Fixed-point arithmetic, Gravity, Subpixel, Super Mario Bros., Super Mario World, Variable jump height

The vertical-move routine gives the gravity routine 4 px/frame as Mario's maximum fall speed; the clamp sets the speed back to 4 only when its whole part is at least 4 and its fraction byte at least $80. smb1/max-fall-speed

About: Super Mario Bros. Gravity

Value: speed 4 · fraction 128 (px/frame)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6547-L6550LDA #$04 ; set maximum vertical speed here JMP ImposeGravitySprObj ; then jump to move player verticallysmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6688-L6696CMP $02 ; compare to maximum speed … CMP #$80 ; if less positively than preset maximum, skip this part … STA SprObject_Y_Speed,x ; keep vertical speed within maximum value … STA SprObject_Y_MoveForce,x ; clear fractionalA Complete Guide to SMB's Physics Engine · JUMPING/VERTICAL PHYSICStheir vertical downward velocity caps at 04800 in most cases, wrapping back to 04000 when exceededChecked by claude, 2026-10-20 — read MovePlayerVertically (L6540-L6550: LDA #$04 into the maximum, then ImposeGravitySprObj) and ImposeGravity's clamp (L6688-L6696) at the pinned commit; re-read when the statement dropped the "4 + $80/256" wording, which missed speeds of 5.00-5.49; re-read in the audit (2026-10-27), when the statement took in both of the clamp's conditionsRevised after a check by a second AI model, 2026-10-27: The clamp sets the speed back to 4 only when its whole part is at least 4 and its fraction at least $80, so 4 px/frame alone overstated it.Checked by a second AI model, 2026-10-28.

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 26 of 30 bytes the same).

The clamp's test on its own is smb1/fall-clamp-test.

Cited by: Gravity, Super Mario Bros., Super Mario Bros. 2, Super Mario World, Variable jump height

Mario gets no grace window after leaving a ledge; the jump check refuses airborne jumps unless he is swimming. smb1/no-coyote-time

About: Super Mario Bros. Coyote time

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4921-L4925LDA Player_State ; check player state BEQ InitJS ; if on the ground, branch LDA SwimmingFlag ; if swimming flag not set, jump to do something else BEQ NoJump ; to prevent midair jumping, otherwise continueChecked by claude, 2026-10-20 — read ProcJumping at the pinned commitChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.

In other builds: Europe (same bytes); Japan Disk System (moved).

Cited by: Coyote time, Jump, Super Mario Bros., Variable jump height

Measured in the game on flat ground, the apexes, tapped/held, are 24/66 px standing, 27/71 px walking, and 29/83 px running. smb1/apex-by-hold

About: Super Mario Bros. Variable jump height

Value
{
 "row0": {
  "tap": {
   "apex": 24,
   "airtime": 21
  },
  "full": {
   "apex": 66,
   "airtime": 53
  }
 },
 "row2": {
  "tap": {
   "apex": 27,
   "airtime": 24
  },
  "full": {
   "apex": 71,
   "airtime": 58
  }
 },
 "row4": {
  "tap": {
   "apex": 29,
   "airtime": 21
  },
  "full": {
   "apex": 83,
   "airtime": 57
  }
 }
}
Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4756-L4769 — gravity switchLDA A_B_Buttons AND #A_Button AND PreviousA_B_Buttons BNE ProcSwim LDA JumpOrigin_Y_Position SEC SBC Player_Y_Position CMP DiffToHaltJump BCC ProcSwim DumpFall: LDA VerticalForceDown STA VerticalForcesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6664-L6696 — motion and capLDA SprObject_Y_MoveForce,x CLC ADC $00 STA SprObject_Y_MoveForce,x LDA SprObject_Y_Speed,x ADC #$00 STA SprObject_Y_Speed,xsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4957-L4958 — the jump's DiffToHaltJump is 1LDA #$01 STA DiffToHaltJumpMeasured in the game with A held, Mario's jumps peak at 66 px standing, 71 px walking, and 83 px running. Verified — the same run, whose held peaks name the second row walking and the fourth runningChecked by claude, 2026-11-04 — Read the gravity switch (prg.asm L4756-4769: while rising, the weaker gravity stays if A is held since the last frame or if Mario has risen less than DiffToHaltJump, set to 1 at L4957-4958, above JumpOrigin_Y_Position; otherwise VerticalForceDown takes over) and ImposeGravity (L6664-6696: the force is added to the fraction, carrying into Player_Y_Speed) at the pinned commit; the apexes are the probe's run in the game. Re-read 2026-11-04: the rows are named walking and running as in apex-held.Revised after a check by a second AI model, 2026-10-25.Revised after a check by a second AI model, 2026-11-04: Table rows are now walking and running.Probe: probes/jump-physics/emu-jumps.mjs

In other builds: Europe (moved); Japan Disk System (changed, 99 of 99 bytes the same).

Heights are whole drawn pixels above the take-off row; airtime is frames from the press until back at take-off height. Tapped means A held for the press frame only.

Cited by: Super Mario Bros., Variable jump height

Measured in the game with A held, Mario's jumps peak at 66 px standing, 71 px walking, and 83 px running. smb1/apex-held

About: Super Mario Bros. Variable jump height

Value: row 0 66 · row 2 71 · row 4 83 (px)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4756-L4769 — gravity switchLDA A_B_Buttons AND #A_Button AND PreviousA_B_Buttons BNE ProcSwim LDA JumpOrigin_Y_Position SEC SBC Player_Y_Position CMP DiffToHaltJump BCC ProcSwim DumpFall: LDA VerticalForceDown STA VerticalForcesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6664-L6696 — motion and capLDA SprObject_Y_MoveForce,x CLC ADC $00 STA SprObject_Y_MoveForce,x LDA SprObject_Y_Speed,x ADC #$00 STA SprObject_Y_Speed,xsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4957-L4958 — the jump's DiffToHaltJump is 1LDA #$01 STA DiffToHaltJumpChecked by claude-agent, 2026-10-25 — Read the gravity switch (prg.asm L4756-4769, with DiffToHaltJump set to 1 at L4957-4958) and ImposeGravity (L6664-6696) at the pinned commit: with A held the rise keeps the weaker gravity until the speed turns downward; the three peaks are the probe's run in the game.Revised after a check by a second AI model, 2026-10-25.Checked by a second AI model, 2026-11-04.Probe: probes/jump-physics/emu-jumps.mjs

In other builds: Europe (moved); Japan Disk System (changed, 99 of 99 bytes the same).

The same run as apex-by-hold. Walking is row 2 and a full-speed run row 4 (walk-run-max-speed).

Cited by: Super Mario Bros., Super Mario Bros. 3, Super Mario World, Variable jump height

The gravity routine clamps a fall of 4 px/frame or more only when the fraction byte is at least $80. smb1/fall-clamp-test

About: Super Mario Bros. Gravity

Value: 128 1/256 px/frame

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6688-L6696CMP $02 ; compare to maximum speed BMI ChkUpM ; if less than preset value, skip this part LDA SprObject_Y_MoveForce,x CMP #$80 ; if less positively than preset maximum, skip this part BCC ChkUpMA Complete Guide to SMB's Physics Engine · JUMPING/VERTICAL PHYSICStheir vertical downward velocity caps at 04800 in most cases, wrapping back to 04000 when exceededChecked by claude, 2026-10-20 — read ImposeGravity L6681-L6696 at the pinned commit; the speed byte is compared with the maximum (4), then only the fraction byte with $80Checked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-10-28.

In other builds: Europe, Japan Disk System (moved).

So 4.00-4.49 and 5.00-5.49 px/frame both pass unclamped, and the next step clamps them. Jdaster64's chart gives the 4.5 threshold "in most cases".

Cited by: Gravity, Super Mario Bros., Variable jump height

Swimming jumps use row 5 of the jump tables, or row 6 in a whirlpool. smb1/swim-rows

About: Super Mario Bros. Jump

Value: 5, 6

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4959-L4964LDA SwimmingFlag ; if swimming flag disabled, branch BEQ GetYPhy LDY #$05 ; otherwise set Y to 5, range is 5-6 LDA Whirlpool_Flag ; if whirlpool flag not set, branch BEQ GetYPhy INY ; otherwise increment to 6Checked by claude, 2026-10-20 — read ChkWtr (L4956-L4964) at the pinned commit; GetYPhy then loads every table at that rowChecked by a second AI model, 2026-10-27.

In other builds: Europe (same bytes); Japan Disk System (moved).

Cited by: Variable jump height

Each frame the player control routine splits the d-pad bits, runs the jump check, the horizontal physics, and the state's routine (which changes the speed, then moves Mario), sets his moving direction from the speed's sign, and only then runs the background collision routine, which lands him. smb1/frame-order

About: Super Mario Bros. Running

Value: input, crouch, jump, x-physics, state-routine, moving-dir, collision

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4372-L4378SaveJoyp: LDA SavedJoypadBits ; otherwise store A and B buttons in $0a … STA Left_Right_ButtonsOur readingA_B_Buttons ← the pad's top two bits (not quoted)4373–4375Left_Right_Buttons ← its low two bits (not quoted)4376–4378smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4391-L4415JSR PlayerMovementSubs ; run movement subroutines … LDY Player_X_Speed ; check player's horizontal speed BEQ PlayerSubs ; if not moving at all horizontally, skip this part BPL SetMoveDir ; if moving to the right, use default moving direction … STA Player_MovingDir ; set moving direction … JSR PlayerBGCollision ; do collision detection and processOur readingthe movement routines4392bounding box size by size and crouch (not quoted)4393–4401direction ← 1, right (not quoted)4402speed 0: skip the direction4403–4404positive: keep it4405negative: left, 2 (not quoted)4406Player_MovingDir ← it4408scroll, offscreen bits, position, box (not quoted)4410–4414PlayerBGCollision4415smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4712-L4727ProcMove: JSR PlayerPhysicsSub ; run sub related to jumping and swimming LDA PlayerChangeSizeFlag ; if growing/shrinking flag set, BNE NoMoveSub ; branch to leave LDA Player_State CMP #$03 ; get player state BEQ MoveSubs ; if climbing, branch ahead, leave timer unset LDY #$18 STY ClimbSideTimer ; otherwise reset timer now MoveSubs: JSR JumpEngine .dw OnGroundStateSub …Our readingPlayerPhysicsSub, jumping and swimming (by the comment)4713changing size: leave (not quoted)4714–4715not climbing: climb side timer ← $18 (not quoted)4716–4720by the state in A, through JumpEngine (by its label)4722 OnGroundStateSub, JumpSwimSub, FallingSub, ClimbingSub4724–4727smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4735-L4744OnGroundStateSub: JSR GetPlayerAnimSpeed ; do a sub to set animation frame timing … JSR ImposeFriction ; do a sub to impose friction on player's walk/run JSR MovePlayerHorizontally ; do another sub to move player horizontallyOur readingGetPlayerAnimSpeed4736left or right held: facing ← it (not quoted)4737–4739ImposeFriction, then MovePlayerHorizontally4741–4742scroll speed ← the result (not quoted)4743Checked by claude, 2026-10-21 — read PlayerCtrlRoutine (L4357-L4415), PlayerMovementSubs (L4702-L4725), and OnGroundStateSub (L4735-L4744) at the pinned commit; PlayerPhysicsSub falls through to X_Physics (L4991) after the jump checkChecked by a second AI model, 2026-10-21.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Europe (same code, other addresses); Japan Disk System (changed, 82 of 113 bytes the same).

Order within a frame: input bits (Down on the ground clears Left/Right, down-on-ground); PlayerMovementSubs sets the crouch flag, runs PlayerPhysicsSub (jump check, then X_Physics), then the state's routine (on the ground GetPlayerAnimSpeed, facing, ImposeFriction, MovePlayerHorizontally); then the moving direction; then background collision, where Mario lands. A speed of exactly 0 leaves Player_MovingDir as it was. The probe's frame-by-frame traces follow this order (the walk, skid, and landing cases).

Cited by: Coyote time

Mario's horizontal fraction byte sits below his speed byte, so acceleration works in 1/256 of a sixteenth (1/4096 px/frame) and carries into the speed byte, but the horizontal-move routine moves Mario by the speed byte alone. smb1/x-speed-fraction

About: Super Mario Bros. Running

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5102-L5108LeftFrict: LDA Player_X_MoveForce ; load value set here CLC ADC FrictionAdderLow ; add to it another value set here STA Player_X_MoveForce ; store here LDA Player_X_Speed ADC FrictionAdderHigh ; add value plus carry to horizontal speedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6492-L6494MoveObjectHorizontally: LDA SprObject_X_Speed,x ; get currently saved value (horizontal ASL ; speed, secondary counter, whatever)Checked by claude, 2026-10-21 — read ImposeFriction (L5091-L5131) and MoveObjectHorizontally (L6492-L6527) at the pinned commitChecked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.

In other builds: Europe, Japan Disk System (moved).

Read the two bytes as one signed 16-bit speed in 1/4096 px/frame: Player_X_Speed × 256 + Player_X_MoveForce. Position moves by Player_X_Speed (4.4 fixed point, x-speed-format) into the 1/256 px subpixel byte SprObject_X_MoveForce ($0400). A different byte from Player_X_MoveForce ($0705), despite the name.

The friction table gives Mario's acceleration and braking per frame: $E4 running, $98 walking, and $D0 walking while still fast from a run, in 1/4096 px/frame. smb1/ground-accel

About: Super Mario Bros. Running

Value: run 228 · walk 152 · fast 208 (1/4096 px/frame²)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4877-L4878FrictionData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5037-L5041LDY $00 ; get other value in memory LDA FrictionData,y ; get value using value in memory as offset STA FrictionAdderLow LDA #$00 STA FrictionAdderHigh ; init something hereSuper Mario Bros. (World) · 0x3457-0x3459 — FrictionDataChecked by claude, 2026-10-21 — read the table and GetXPhy at the pinned commit; the probe's traces step the 16-bit speed by exactly 152 a frame walking, 228 running, and 208 braking from a runChecked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 9 of 16 bytes the same).

The same value accelerates toward a held direction and brakes when none is held (release-friction). Index 0 is the running row, 1 walking, 2 walking fast (physics-select).

Cited by: Super Mario Bros.: The Lost Levels

On the ground the horizontal physics routine uses the running row (cap $28, acceleration $E4) while B and the direction Mario moves in are held and for the 9 frames after B goes up; otherwise the walking row (cap $18, $98, or $D0 while a running flag is set or his speed is $21 or more). smb1/physics-select

About: Super Mario Bros. Running

Value
{
 "run": {
  "cap": 40,
  "accel": 228,
  "timer": 10
 },
 "walk": {
  "cap": 24,
  "accel": 152,
  "fastAccel": 208,
  "fastAt": 33
 },
 "water": {
  "cap": 16
 }
}
Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4991-L5026X_Physics: … LDA Player_State ; if mario is on the ground, branch BEQ ProcPRun … ProcPRun: INY ; if mario on the ground, increment Y LDA AreaType ; check area type BEQ ChkRFast ; if water type, branch DEY ; decrement Y by default for non-water type area LDA Left_Right_Buttons ; get left/right controller bits CMP Player_MovingDir ; check against moving direction …Our readingrow ← 0, $00 ← 0 (not quoted)4992–4993on the ground: ProcPRun4994–4995in the air, speed $19 or more: GetXPhy (not quoted)4996–4998 else: ChkRFast (not quoted)4999ProcPRun: row + 15001 water area: ChkRFast5002–5003 row − 15004 left/right not the moving direction: ChkRFast5005–5007 B held: SetRTmr5008–5010 running timer set: GetXPhy5011–5012ChkRFast: row + 1, $00 + 15014–5015 RunningSpeed set: FastXSp5016–5017 speed below $21: GetXPhy5018–5020FastXSp: $00 + 1, GetXPhy5022–5023SetRTmr: running timer ← $0A5025–5026smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4870-L4874MaxLeftXSpdData: … MaxRightXSpdData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5055-L5074GetPlayerAnimSpeed: … CMP #$1c ; against preset amount BCS SetRunSpd ; if greater than a certain amount, branch ahead … AND #$03 ; mask out all others except left and right CMP Player_MovingDir ; check against moving direction BNE ProcSkid ; if left/right controller bits <> moving direction, branch LDA #$00 ; otherwise set zero value here SetRunSpd: STA RunningSpeed ; store zero or running speed hereOur readingindex ← 0 (not quoted)5056speed $1C or more: SetRunSpd (not quoted)5057–5059index + 1 (not quoted)5060$0E or more: ChkSkid (not quoted)5061–5062index + 1 (not quoted)5063ChkSkid: no button but A: SetAnimSpd (not quoted)5065–5067left/right not the moving direction: ProcSkid5068–5070else: 05071SetRunSpd: RunningSpeed ← 0, or the speed if $1C or more5073then SetAnimSpd (not quoted)5074smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L126-L136DecTimers: LDX #$14 ; load end offset for end of frame timers … DEC Timers,x ; otherwise decrement the current timerOur readinglast frame timer ← $14127interval control − 1 (not quoted)128–129 run out: back to $14, interval timers too (not quoted)130–132each timer, looping at 138-139: 0: skip it (not quoted)134–135 else: − 1136Super Mario Bros. (World) · 0x3450-0x3455 — MaxLeftXSpdData, MaxRightXSpdDataChecked by claude, 2026-10-21 — read X_Physics (L4991-L5047), the speed tables, GetPlayerAnimSpeed (L5055-L5089), and the NMI's frame timers (L121-L139; RunningTimer is $0783, within the 20 frame timers) at the pinned commit; the probe's run case keeps the running row for 9 frames after B is let go and drops to the walking cap on the 10thRevised after a check by a second AI model, 2026-10-21.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 119 of 130 bytes the same).

RunningTimer counts down once a frame in the NMI, before the game logic, so the running row lasts through the 9 frames after B goes up. GetPlayerAnimSpeed sets RunningSpeed to the speed whenever it is $1C or more on the ground and clears it when a held direction matches the moving direction below $1C; X_Physics reads it before that update in the same frame. Holding the other direction (or none) never selects the running row, even with B held. In water levels (AreaType 0) the ground row is index 2: cap $10, never running.

Cited by: Running

The horizontal physics routine doubles the acceleration whenever Mario faces away from the direction he moves, so a turn brakes at $130, $1A0, or $1C8 a frame. smb1/turn-doubling

About: Super Mario Bros. Running

Value: 2 ×

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5042-L5047LDA PlayerFacingDir CMP Player_MovingDir ; check facing direction against moving direction BEQ ExitPhy ; if the same, branch to leave ASL FrictionAdderLow ; otherwise shift d7 of friction adder low into carry ROL FrictionAdderHigh ; then rotate carry onto d0 of friction adder high ExitPhy:Checked by claude, 2026-10-21 — read GetXPhy's end (L5042-L5048) at the pinned commit; in the probe's skids the speed falls by 152 on the press frame (facing still old), then by 304 a frame, or 208 then 416 from a runChecked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Europe (same bytes); Japan Disk System (moved).

X_Physics compares before OnGroundStateSub turns Mario to face the new direction, so the press frame of a skid brakes at the plain rate and the doubling starts on the next frame. The comparison also doubles the first step of a level, where Player_MovingDir starts at 0.

Cited by: Running

When a held direction carries the speed to its cap or past it, the friction routine sets the speed byte to the cap, so a speed above the cap drops to it in one frame. smb1/cap-clamp

About: Super Mario Bros. Running

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5109-L5114CMP MaximumRightSpeed ; compare against maximum value for right movement BMI XSpdSign ; if horizontal speed greater negatively, branch LDA MaximumRightSpeed ; otherwise set preset value as horizontal speed STA Player_X_Speed ; thus slowing the player's left movement down JMP SetAbsSpd ; skip to the endsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5122-L5126CMP MaximumLeftSpeed ; compare against maximum value for left movement BPL XSpdSign ; if horizontal speed greater positively, branch LDA MaximumLeftSpeed ; otherwise set preset value as horizontal speed STA Player_X_Speed ; thus slowing the player's right movement downChecked by claude, 2026-10-21 — read LeftFrict and RghtFrict (L5102-L5126) at the pinned commit; in the probe's run case, Right held after B goes up, the speed stays `$28` for 9 frames and is `$18` on the 10thChecked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Europe (same bytes); Japan Disk System (same code, other addresses).

Only the speed byte is clamped; the fraction byte keeps adding and wrapping, so at the cap the 16-bit speed jitters by one acceleration step. Right is the clamp for a speed toward the right; the left clamp is the mirror. With the d-pad released the branch that brakes a rightward speed tests only the left cap, so braking never clamps.

With neither Left nor Right held on the ground, the friction routine brakes Mario by the frame's acceleration toward zero and stops once the speed byte reaches 0, leaving the fraction byte as it is. smb1/release-friction

About: Super Mario Bros. Running

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5091-L5101ImposeFriction: AND Player_CollisionBits ; perform AND between left/right controller bits and collision flag CMP #$00 ; then compare to zero (this instruction is redundant) BNE JoypFrict ; if any bits set, branch to next part LDA Player_X_Speed BEQ SetAbsSpd ; if player has no horizontal speed, branch ahead to last part BPL RghtFrict ; if player moving to the right, branch to slow BMI LeftFrict ; otherwise logic dictates player moving left, branch to slow JoypFrict: LSR ; put right controller bit into carry BCC RghtFrict ; if left button pressed, carry = 0, thus branchChecked by claude, 2026-10-21 — read ImposeFriction at the pinned commit; the probe's walk case brakes by 152 a frame and stops with the fraction byte at 136, the run case by 208 and stops at 236Checked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Europe (same bytes); Japan Disk System (moved).

The braking rate is the acceleration X_Physics picked, so $98 from a walk and $D0 after a run (physics-select), doubled if Mario faces away from his motion.

On the ground, the animation-speed routine zeroes Mario's speed and turns his moving direction to his facing one when a button other than A is held, the d-pad's Left/Right bits differ from his moving direction, and his speed is below $0B. smb1/skid-stop

About: Super Mario Bros. Running

Value: 11 1/16 px/frame

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5064-L5083ChkSkid: LDA SavedJoypadBits ; get controller bits AND #%01111111 ; mask out A button BEQ SetAnimSpd ; if no other buttons pressed, branch ahead of all this AND #$03 ; mask out all others except left and right CMP Player_MovingDir ; check against moving direction BNE ProcSkid ; if left/right controller bits <> moving direction, branch … ProcSkid: LDA Player_XSpeedAbsolute ; check player's walking/running speed CMP #$0b ; against one last amount BCS SetAnimSpd ; if greater than this amount, branch …Checked by claude, 2026-10-21 — read GetPlayerAnimSpeed at the pinned commit; in the probe, a skid's speed jumps from `$0A` to the new direction's first step, B alone stops a `$06` slide dead, and so does big Mario's crouch below `$0B`Checked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 38 of 39 bytes the same).

The test reads Player_XSpeedAbsolute from the previous frame, before this frame's friction. So a skid ends on the first frame that starts below $0B, and that frame's turn-doubled step then starts Mario the other way. Down, Up, B, or Select held with no direction also count, so crouching stops a slow slide dead (down-on-ground). Holding the direction Mario already moves never triggers it.

Cited by: Running

On the ground the on-ground routine turns Mario toward a held Left or Right before friction runs; the jumping and falling routines change his facing only while he swims. smb1/facing

About: Super Mario Bros. Running

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4735-L4740OnGroundStateSub: JSR GetPlayerAnimSpeed ; do a sub to set animation frame timing LDA Left_Right_Buttons BEQ GndMove ; if left/right controller bits not set, skip instruction STA PlayerFacingDir ; otherwise set new facing direction GndMove:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4771-L4784LDA SwimmingFlag ; if swimming flag not set, BEQ LRAir ; branch ahead to last part … LRWater: LDA Left_Right_Buttons ; check left/right controller bits (check for swimming) BEQ LRAir ; if not pressing any, skip STA PlayerFacingDir ; otherwise set facing direction accordingly LRAir: LDA Left_Right_Buttons ; check left/right controller bits (check for jumping/falling)Checked by claude, 2026-10-21 — read OnGroundStateSub and JumpSwimSub (L4735-L4796) at the pinned commit; in the probe's air reversal, `PlayerFacingDir` stays 1 (right) with Left held until the frame after landingChecked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Europe (same bytes); Japan Disk System (same code, other addresses).

PlayerFacingDir and Player_MovingDir are 1 for right and 2 for left. Mario therefore keeps his take-off facing for the whole jump.

Cited by: Air control, Super Mario Bros.

On the ground, Down with Left or Right clears both, so Mario neither walks nor crouches, and friction slows him as it does with the d-pad released. The skid check still reads the buttons held, though, so unless he holds the way he is moving it stops him dead below $0B. Big Mario holding Down alone crouches. smb1/down-on-ground

About: Super Mario Bros. Running

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4379-L4390LDA SavedJoypadBits ; store up and down buttons in $0b AND #%00001100 STA Up_Down_Buttons AND #%00000100 ; check for pressing down BEQ SizeChk ; if not, branch LDA Player_State ; check player's state BNE SizeChk ; if not on the ground, branch LDY Left_Right_Buttons ; check left and right BEQ SizeChk ; if neither pressed, branch LDA #$00 STA Left_Right_Buttons ; if pressing down while on the ground, STA Up_Down_Buttons ; nullify directional bitssmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4702-L4711PlayerMovementSubs: LDA #$00 ; set A to init crouch flag by default LDY PlayerSize ; is player small? BNE SetCrouch ; if so, branch LDA Player_State ; check state of player BNE ProcMove ; if not on the ground, branch LDA Up_Down_Buttons ; load controller bits for up and down AND #%00000100 ; single out bit for down button SetCrouch: STA CrouchingFlag ; store value in crouch flagsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4735-L4741 — on the ground the cleared bits leave his facing alone and reach the friction routine as 0OnGroundStateSub: JSR GetPlayerAnimSpeed ; do a sub to set animation frame timing LDA Left_Right_Buttons BEQ GndMove ; if left/right controller bits not set, skip instruction STA PlayerFacingDir ; otherwise set new facing direction GndMove: JSR ImposeFriction ; do a sub to impose friction on player's walk/runsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5091-L5098 — no direction bit: friction toward a stop, as with the d-pad releasedImposeFriction: AND Player_CollisionBits ; perform AND between left/right controller bits and collision flag CMP #$00 ; then compare to zero (this instruction is redundant) BNE JoypFrict ; if any bits set, branch to next part LDA Player_X_Speed BEQ SetAbsSpd ; if player has no horizontal speed, branch ahead to last part BPL RghtFrict ; if player moving to the right, branch to slow BMI LeftFrict ; otherwise logic dictates player moving left, branch to slowsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5005-L5007 — the friction pick reads the cleared bits tooLDA Left_Right_Buttons ; get left/right controller bits CMP Player_MovingDir ; check against moving direction BNE ChkRFast ; if controller bits <> moving direction, skip this partsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5064-L5083 — the skid check reads the raw controller bits: any button but A, then Left/Right against the moving direction; below `$0B` a mismatch stops himChkSkid: LDA SavedJoypadBits ; get controller bits AND #%01111111 ; mask out A button BEQ SetAnimSpd ; if no other buttons pressed, branch ahead of all this AND #$03 ; mask out all others except left and right CMP Player_MovingDir ; check against moving direction BNE ProcSkid ; if left/right controller bits <> moving direction, branch LDA #$00 ; otherwise set zero value here SetRunSpd: STA RunningSpeed ; store zero or running speed here JMP SetAnimSpd ProcSkid: …Checked by claude, 2026-11-04 — read PlayerCtrlRoutine (L4372-L4390), PlayerMovementSubs (L4702-L4711), OnGroundStateSub (L4735-L4741), ImposeFriction's no-direction branch (L5091-L5098), X_Physics's direction test (L5005-L5007), and ChkSkid through ProcSkid (L5064-L5083) at the pinned commit; the braking numbers are the 2026-10-21 probe runChecked by a second AI model, 2026-10-21.Revised after a check by a second AI model, 2026-11-04: Narrowed; friction is as if released, but the skid check stops him dead below $0B unless he holds the way he's moving.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 114 of 115 bytes the same).

Crouching itself changes no speed rule; it only removes the d-pad. The crouch flag is written only on the ground, so a crouch jump stays crouched until the frame after landing, and in the air Down leaves Left and Right alone, so a crouch jump steers. Down held alone also counts as a held button for skid-stop, which stops a crouching slide below $0B. The probe's big Mario is a RAM write of PlayerSize (see the probe).

Measured from a standstill in World 1-1, Mario reaches $18 on frame 40 walking and $28 on frame 45 running, and let go at those speeds he stops in 40 and 49 frames. smb1/ground-measured

About: Super Mario Bros. Running

Value: walk reach 40 · run reach 45 · walk stop 40 · run stop 49 · run timer snap 10 · skid walk 13 · skid run 20 (frames)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4877-L4878 — the accelerationsFrictionData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5042-L5047 — turn doubling, which also doubles the very first step of the levelLDA PlayerFacingDir CMP Player_MovingDir BEQ ExitPhy ASL FrictionAdderLow ROL FrictionAdderHighsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4870-L4874 — the caps by row: $28 running, $18 walkingMaxLeftXSpdData: … MaxRightXSpdData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5028-L5036 — X_Physics sets the caps from the rowLDA MaxLeftXSpdData,y STA MaximumLeftSpeed … LDA MaxRightXSpdData,y STA MaximumRightSpeedSuper Mario Bros. (World) · 0x3457-0x3459 — FrictionDataSuper Mario Bros. (World) · 0x3450-0x3455 — MaxLeftXSpdData, MaxRightXSpdDataChecked by claude-agent, 2026-10-25 — Read FrictionData (prg.asm L4877-4878), the cap tables (L4870-4874: $28 for the running row, $18 for walking) and their setup in X_Physics (L5028-5036), and the turn doubling (L5042-5047: the step doubles when facing and moving direction differ) at the pinned commit; the frame counts are the probe's measurement in the game.Checked by a second AI model, 2026-10-21.Revised after a check by a second AI model, 2026-10-25.Checked by a second AI model, 2026-11-04.Checked by a second AI model, 2026-11-18.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 32 of 41 bytes the same).

Also measured: with Right still held, letting go of B at $28 keeps the running cap for 9 frames and drops to $18 on the 10th (runTimerSnap); pressing the other way reverses a walk on the 13th frame and a run (B held or not) on the 20th (skidWalk, skidRun). The level's first step is doubled because Player_MovingDir starts at 0 (turn-doubling).

Cited by: Super Mario Bros., Super Mario Bros. 2, Super Mario Bros. 3

In the air the horizontal physics routine takes the running cap $28 and acceleration $E4 while Mario's speed is $19 or more, and the walking cap $18 with $98 (or $D0 while a running flag is set) below it, whatever B does. smb1/air-physics

About: Super Mario Bros. Air control

Value
{
 "fastFrom": 25,
 "fast": {
  "cap": 40,
  "accel": 228
 },
 "slow": {
  "cap": 24,
  "accel": 152,
  "fastAccel": 208
 }
}
Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4991-L4999X_Physics: LDY #$00 STY $00 ; init value here LDA Player_State ; if mario is on the ground, branch BEQ ProcPRun LDA Player_XSpeedAbsolute ; check something that seems to be related CMP #$19 ; to mario's speed BCS GetXPhy ; if =>$19 branch here BCC ChkRFast ; if not branch elsewheresmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5013-L5023ChkRFast: INY ; if running timer not set or level type is water, INC $00 ; increment Y again and temp variable in memory LDA RunningSpeed BNE FastXSp ; if running speed set here, branchChecked by claude, 2026-10-21 — read X_Physics at the pinned commit; in the probe, a walking jump with B held stays at `$18`, a running jump without B keeps `$28`, and steering back from `$28` brakes by 228 a frame down to `$19`, then by 208Checked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 35 of 37 bytes the same).

The test reads the speed every frame, so a jump's cap can fall from $28 to $18 while Mario brakes in the air. RunningSpeed changes only on the ground, so a jump from a run keeps it.

Cited by: Super Mario Bros. 3

The air steering routine runs the friction routine only while Left or Right is held, so in the air a held direction accelerates Mario toward it up to the cap and a released d-pad keeps his speed. smb1/air-steer

About: Super Mario Bros. Air control

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4783-L4788LRAir: LDA Left_Right_Buttons ; check left/right controller bits (check for jumping/falling) BEQ JSMove ; if not pressing any, skip JSR ImposeFriction ; otherwise process horizontal movement JSMove: JSR MovePlayerHorizontally ; do a sub to move player horizontallysmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4748-L4751FallingSub: LDA VerticalForceDown STA VerticalForce ; dump vertical movement force for falling into main one JMP LRAir ; movement force, then skip ahead to process left/right movementChecked by claude, 2026-10-21 — read JumpSwimSub and FallingSub (L4748-L4796) at the pinned commit; the probe's walking jump with the d-pad released keeps `$18` to the landing, and a standing jump steered right gains 304, then 152 a frame up to `$18`Checked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Europe (same code, other addresses); Japan Disk System (changed, 12 of 19 bytes the same).

Jumping (state 1) and falling off a ledge (state 2) share LRAir.

Cited by: Air control, Super Mario Bros.

Because a jump keeps Mario's take-off facing, steering back slows him at the plain rate until he moves the other way, then at double the rate ($1A0 from a run). smb1/air-reverse

About: Super Mario Bros. Air control

Value: fast brake 228 · slow brake 208 · reverse 416 · cross frames 50 (1/4096 px/frame²)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5042-L5047 — turn doubling when facing and moving differLDA PlayerFacingDir CMP Player_MovingDir BEQ ExitPhy ASL FrictionAdderLow ROL FrictionAdderHighsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4771-L4784 — no facing change in the airLDA SwimmingFlag BEQ LRAir … LRWater: LDA Left_Right_Buttons BEQ LRAir STA PlayerFacingDir LRAir:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4877-L4878FrictionData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4991-L4999 — in the air: at `$19` or more entry 0 (`$E4`), else on to ChkRFastX_Physics: LDY #$00 STY $00 ; init value here LDA Player_State ; if mario is on the ground, branch BEQ ProcPRun LDA Player_XSpeedAbsolute ; check something that seems to be related CMP #$19 ; to mario's speed BCS GetXPhy ; if =>$19 branch here BCC ChkRFast ; if not branch elsewheresmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5013-L5023 — below `$19`: entry 1 (`$98`), or entry 2 (`$D0`) with the running speed setChkRFast: INY ; if running timer not set or level type is water, INC $00 ; increment Y again and temp variable in memory LDA RunningSpeed BNE FastXSp ; if running speed set here, branch LDA Player_XSpeedAbsolute CMP #$21 ; otherwise check player's walking/running speed BCC GetXPhy ; if less than a certain amount, branch ahead FastXSp: INC $00 ; if running speed set or speed => $21 increment $00 JMP GetXPhy ; and jump aheadsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5037-L5041LDY $00 ; get other value in memory LDA FrictionData,y ; get value using value in memory as offset STA FrictionAdderLow LDA #$00 STA FrictionAdderHigh ; init something heresmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4402-L4408 — the moving direction follows the speed's sign, so it turns only when he moves the other wayLDA #$01 ; set moving direction to right by default LDY Player_X_Speed ; check player's horizontal speed BEQ PlayerSubs ; if not moving at all horizontally, skip this part BPL SetMoveDir ; if moving to the right, use default moving direction ASL ; otherwise change to move to the left SetMoveDir: STA Player_MovingDir ; set moving directionsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4784-L4786 — in the air the friction routine runs only with Left or Right heldLDA Left_Right_Buttons ; check left/right controller bits (check for jumping/falling) BEQ JSMove ; if not pressing any, skip JSR ImposeFriction ; otherwise process horizontal movementSuper Mario Bros. (World) · 0x3457-0x3459 — FrictionDataChecked by claude, 2026-11-04 — read the air branch (L4771-L4786), X_Physics's friction pick (L4991-L4999, L5013-L5023, L5037-L5047) with FrictionData (L4877-L4878), and ChkMoveDir (L4402-L4408) at the pinned commit; the braking and acceleration steps are the 2026-10-25 probe run in the gameChecked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-25.Revised after a check by a second AI model, 2026-11-04: The friction table, the air branch and the direction update are quoted.Checked by a second AI model, 2026-11-18.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 102 of 108 bytes the same).

From a walk, the same reversal brakes by 152 and then accelerates by 304. Turning around in the air is slow: from $28 it takes 50 frames to stop, most of a full jump.

Cited by: Air control

The jump setup leaves Mario's horizontal speed alone and sets the jumping state before the horizontal physics routine runs, so the press frame already uses the air rules, and the take-off speed only picks the jump row. smb1/takeoff-x

About: Super Mario Bros. Jump

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4941-L4943LDA #$01 ; set player state to jumping/swimming STA Player_State LDA Player_XSpeedAbsolute ; check value related to walking/running speedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4984-L4991PJumpSnd: … STA Square1SoundQueue ; store appropriate jump sound in square 1 sfx queue X_Physics:Checked by claude, 2026-10-21 — read InitJS through X_Physics (L4931-L4999) at the pinned commit; in the probe, a running jump pressed with the d-pad released keeps its speed exactly on the press frame, where the ground rules would have braked it by 208Checked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Europe (same bytes); Japan Disk System (moved).

InitJS writes no horizontal byte. The press frame skips OnGroundStateSub, so it neither updates the facing nor runs GetPlayerAnimSpeed. The jump row comes from Player_XSpeedAbsolute as of the previous frame (jump-row-thresholds).

On landing, the background collision routine snaps Mario's Y to a 16 px row and zeroes his vertical speed and its fraction, then sets the ground state; his horizontal speed is untouched, and the ground rules apply from the next frame. smb1/landing

About: Super Mario Bros. Jump

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11221-L11233LandPlyr: JSR ChkForLandJumpSpring ; do sub to check for jumpspring metatiles and deal with it LDA #$f0 AND Player_Y_Position ; mask out lower nybble of player's vertical position STA Player_Y_Position ; and store as new vertical position to land player properly JSR HandlePipeEntry ; do sub to process potential pipe entry LDA #$00 STA Player_Y_Speed ; initialize vertical speed and fractional STA Player_Y_MoveForce ; movement force to stop player's vertical movement STA StompChainCounter ; initialize enemy stomp counter InitSteP: LDA #$00 …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11214-L11220LDY $04 ; check lower nybble of vertical coordinate returned CPY #$05 ; from collision detection routine BCC LandPlyr ; if lower nybble < 5, branchChecked by claude, 2026-10-21 — read DoFootCheck through InitSteP (L11180-L11233) at the pinned commit; in the probe's walking jump, the landing frame moves Y from 429 to 432 with the vertical bytes zeroed, the Y subpixel byte kept, and the X speed unchangedChecked by a second AI model, 2026-10-21.Revised after a check by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 35 of 41 bytes the same).

Collision runs after the frame's movement (frame-order), so the landing frame moved Mario under the air rules. A foot that finds the floor 5 px or more into the tile pushes him back sideways instead of landing him (smb1/foot-check). Player_YMF_Dummy, the Y subpixel, is not cleared. Each frame on the ground the routine first sets the falling state, then lands him again. The same check lands him on a block one row up (probed): probes/lab/smb1-stages.mjs lays one into World 1-1's start, and a walking jump lands on it with the model matching every frame.

The bounding-box table gives Mario a box for touching objects from 2 to 14 px across his sprite, and 8 to 32 px down when big or 20 to 32 px crouching; small Mario's runs from 3 to 13 across and 20 to 32 down. smb1/bound-box

About: Super Mario Bros. Hitbox

Value
{
 "big": {
  "left": 2,
  "top": 8,
  "right": 14,
  "bottom": 32,
  "width": 12,
  "height": 24
 },
 "small": {
  "left": 3,
  "top": 20,
  "right": 13,
  "bottom": 32,
  "width": 10,
  "height": 12
 },
 "crouch": {
  "left": 2,
  "top": 20,
  "right": 14,
  "bottom": 32,
  "width": 12,
  "height": 12
 }
}
Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12024-L12029; this data added to relative coordinates of sprite objects ; stored in order: left edge, top edge, right edge, bottom edge BoundBoxCtrlData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4393-L4401LDY #$01 ; is player small? LDA PlayerSize BNE ChkMoveDir LDY #$00 ; check for if crouching LDA CrouchingFlag BEQ ChkMoveDir ; if not, branch ahead LDY #$02 ; if big and crouching, load y with 2 ChkMoveDir: STY Player_BoundBoxCtrl ; set contents of Y as player's bounding box size controlSuper Mario Bros. (World) · 0x620d-0x6218 — BoundBoxCtrlDataChecked by claude, 2026-10-21 — read BoundBoxCtrlData and BoundingBoxCore (L12026-L12150) and the box choice in PlayerCtrlRoutine (L4393-L4401) at the pinned commitChecked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Europe, Japan Disk System (moved).

Offsets are from the top-left of Mario's 16×32 px sprite area on screen, whose top is Player_Y_Position, for big and small alike. Widths and heights are right minus left and bottom minus top.

Cited by: Hitbox

Against the level, the background collision routine tests a head point at x+8, feet at x+3 and x+12 (y+32), and sides at x+2 and x+13, at y+8 and y+24 when big and both at y+24 when small or crouching. smb1/bg-points

About: Super Mario Bros. Hitbox

Value
{
 "big": {
  "head": [
   8,
   4
  ],
  "feet": [
   [
    3,
    32
   ],
   [
    12,
    32
   ]
  ],
  "sides": [
   [
    2,
    8
   ],
   [
    2,
    24
   ],
   [
    13,
    8
   ],
   [
    13,
    24
   ]
  ]
 },
 "bigSwim": {
  "head": [
   8,
   2
  ],
  "feet": [
   [
    3,
    32
   ],
   [
    12,
    32
   ]
  ],
  "sides": [
   [
    2,
    8
   ],
   [
    2,
    24
   ],
   [
    13,
    8
   ],
   [
    13,
    24
   ]
  ]
 },
 "small": {
  "head": [
   8,
   18
  ],
  "feet": [
   [
    3,
    32
   ],
   [
    12,
    32
   ]
  ],
  "sides": [
   [
    2,
    24
   ],
   [
    2,
    24
   ],
   [
    13,
    24
   ],
   [
    13,
    24
   ]
  ]
 }
}
Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12295-L12309BlockBufferAdderData: … BlockBuffer_X_Adder: … BlockBuffer_Y_Adder:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11131-L11142ChkCollSize: LDY #$02 ; load default offset LDA CrouchingFlag BNE GBBAdr ; if player crouching, skip ahead LDA PlayerSize BNE GBBAdr ; if player small, skip ahead DEY ; otherwise decrement offset for big player not crouching LDA SwimmingFlag BNE GBBAdr ; if swimming flag set, skip ahead DEY ; otherwise decrement offset GBBAdr: LDA BlockBufferAdderData,y ; get value using offsetSuper Mario Bros. (World) · 0x63bd-0x63d7 — BlockBufferAdderData, BlockBuffer_X_AdderSuper Mario Bros. (World) · 0x63dc-0x63f3 — BlockBuffer_Y_AdderChecked by claude, 2026-10-21 — read the adder tables and ChkCollSize at the pinned commit; each set is head, two feet, then two left and two right side pointsRevised after a check by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Europe, Japan Disk System (same code, other addresses).

Points are [x, y] offsets from Player_X_Position and Player_Y_Position (the sprite's top-left). The probe's landings settle with Y on a multiple of 16, so the feet rest 32 px below it.

Cited by: Hitbox

A frame-by-frame model of the horizontal physics, animation-speed, and friction routines reproduces Mario's speed bytes, facing, moving direction, and run timer on every frame of 17 probed traces, walking, running, skidding, crouching, and jumping. smb1/horizontal-rule

About: Super Mario Bros. Running

Value
{
 "run": {
  "cap": 40,
  "accel": 228,
  "timer": 10
 },
 "walk": {
  "cap": 24,
  "accel": 152,
  "fastAccel": 208,
  "fastAt": 33
 },
 "air": {
  "fastFrom": 25
 },
 "runSpeedFrom": 28,
 "skidBelow": 11
}
Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4991-L5047 — X_PhysicsLDA Player_State BEQ ProcPRun LDA Player_XSpeedAbsolute CMP #$19 BCS GetXPhysmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5055-L5089 — GetPlayerAnimSpeedLDA Player_XSpeedAbsolute CMP #$1c BCS SetRunSpdsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5091-L5131 — ImposeFrictionLeftFrict: LDA Player_X_MoveForce CLC ADC FrictionAdderLow STA Player_X_MoveForce LDA Player_X_Speed ADC FrictionAdderHigh STA Player_X_Speed CMP MaximumRightSpeedChecked by claude-agent, 2026-10-25 — Read X_Physics (prg.asm L4991-5047: row choice by state, $19 in the air, B and the run timer on the ground, and the turn doubling), GetPlayerAnimSpeed (L5055-5089: RunningSpeed and the skid stop), and ImposeFriction (L5091-5131: the push and the caps) at the pinned commit; the frame-by-frame match is the probe's against traces from the game.Checked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-25.Checked by a second AI model, 2026-10-28.Probe: probes/jump-physics/movement.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 248 of 254 bytes the same).

One frame on flat land ground, v = Player_X_Speed × 256 + Player_X_MoveForce, abs = Player_XSpeedAbsolute as left by the previous frame, lr = the d-pad's Right (1) and Left (2) bits. The run timer counts down first. Down on the ground with lr set clears lr. A fresh A on the ground makes the frame airborne. Rows: in the air, abs ≥ $19 gives cap $28 and $E4; on the ground, lr = moving direction with B (which sets the timer to 10) or with the timer running gives the same; otherwise cap $18 and $98, or $D0 if RunningSpeed ≠ 0 or abs ≥ $21. The step doubles if facing ≠ moving. On the ground only: RunningSpeed = abs if abs ≥ $1C, else a held non-A button clears RunningSpeed when its Left/Right bits equal the moving direction, or zeroes v and sets moving to facing when they differ and abs < $0B; then facing = lr if set; then friction. In the air, friction runs only if lr is set. Friction: with no lr, stop if the speed byte is 0, else push toward 0; with lr, push toward it (Right wins); a push to the right clamps the speed byte at the cap when it reaches it, a push to the left at −cap only when past it. abs becomes the speed byte's magnitude. Afterward, a nonzero speed byte sets the moving direction. Water levels, swimming, climbing, walls, and slopes are outside the model.

A hit on big Mario sets the injury timer to 8, and enemy contact is skipped until it is back at 0. It is one of the interval timers, which the timer routine counts down once every 21 frames, so the window lasts 8 such ticks, 148 to 168 frames while the game's timers run. smb1/injury-timer

About: Super Mario Bros. Invincibility frames

Value: ticks 8 · frames per tick 21 · min frames 148 · max frames 168 (frames)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10583-L10592InjurePlayer: LDA InjuryTimer ; check again to see if injured invincibility timer is BNE ExInjColRoutines ; at zero, and branch to leave if so … LDA #$08 STA InjuryTimer ; set injured invincibility timersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L126-L139LDX #$14 ; load end offset for end of frame timers DEC IntervalTimerControl ; decrement interval timer control, BPL DecTimersLoop ; if not expired, only frame timers will decrement LDA #$14 STA IntervalTimerControl ; if control for interval timers expired, LDX #$23 ; interval timers will decrement along with frame timerssmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/ram.asm#L60-L78Timers = $0780 … InjuryTimer = $079eChecked by claude, 2026-10-21 — read InjurePlayer/ForceInjury and DecTimers; InjuryTimer is Timers+$1E, past the $14 frame timers, so it counts only on the 21st frameChecked by a second AI model, 2026-10-21.Checked by a second AI model, 2026-10-28.

In other builds: Japan Disk System (moved); Europe (changed, 39 of 43 bytes the same).

Cited by: Super Mario Bros., Super Mario Bros. 2

The block-buffer lookup turns a point into a block lookup: it adds the point's offsets to Mario's position, takes the block column from X ÷ 16 and the block row from (Y & $F0) − 32, and returns the metatile stored there, with the low nybble of Mario's Y (head and feet) or X (sides) as the point's place inside its block. smb1/block-lookup

About: Super Mario Bros. Hitbox

Value: row top 32

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12321-L12362BlockBufferCollision: … LDA BlockBuffer_X_Adder,y ; add horizontal coordinate CLC ; of object to value obtained using Y as offset ADC SprObject_X_Position,x … LDA SprObject_Y_Position,x ; get vertical coordinate of object CLC ADC BlockBuffer_Y_Adder,y ; add it to value obtained using Y as offset AND #%11110000 ; mask out low nybble SEC SBC #$20 ; subtract 32 pixels for the status bar …Checked by claude, 2026-10-22 — read BlockBufferColli_Feet through RetYC (L12310-L12362) at the pinned commitChecked by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.

In other builds: Europe, Japan Disk System (same code, other addresses).

The X sum carries into the page bit, which picks one of the two 16-column block buffers, and the high nybble picks the column, so a point looks up the block whose 16 px square holds it. The returned low nybble is of Mario's own position, not the point's: for the feet (Y + 32) and the sides it is the same thing, since their offsets are whole blocks or don't matter. A point counts as hitting when the metatile is nonzero. The lab's stages put every column top on a 16 px row, so testing the point's pixel against the columns is the same lookup, with column edges allowed anywhere.

Mario's background-collision routine runs after the frame's movement (smb1/frame-order). It first sets a swimming Mario's state to 1, and any other Mario in the normal or climbing state to falling (2), then tests the head, then the two foot points, then the side points, the left pair before the right. The first side point that finds a tile ends the check, though the first point of each pair passes over a pipe's top or a climbable. The side check then stops Mario unless the tile is a hidden block, a coin, a climbable, or a jumpspring in motion, or Mario, in the normal state and facing right, meets the bottom of a sideways or water pipe. smb1/bg-collision-order

About: Super Mario Bros. Hitbox

Value: falling-state, head, feet, left-side, right-side

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11108-L11118LDA #$01 ; load default player state for swimming LDY SwimmingFlag ; if swimming flag set, BNE SetPSte ; branch ahead to set default state LDA Player_State ; if player in normal state, BEQ SetFallS ; branch to set default state for falling CMP #$03 BNE ChkOnScr ; if in any other state besides climbing, skip to next part SetFallS: LDA #$02 ; load default player state for falling SetPSte: STA Player_State ; set whatever player state is appropriateOur readingA ← 1, swimming's state (by the comment)11108swimming: to SetPSte11109–11110state 0, normal: to SetFallS11111–11112not 3, climbing: to ChkOnScr, state kept (not quoted)11113–11114SetFallS, normal or climbing: A ← 2, falling11115–11116SetPSte: state ← A11117–11118smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11235-L11269DoPlayerSideCheck: LDY $eb ; get block buffer adder offset INY INY ; increment offset 2 bytes to use adders for side collisions LDA #$02 ; set value here to be used as counter STA $00 SideCheckLoop: INY ; move onto the next one STY $eb ; store it LDA Player_Y_Position CMP #$20 ; check player's vertical position BCC BHalf ; if player is in status bar area, branch ahead to skip this part …Our readingoffset + 2, to the side adders11236–11238counter ← 211239–11240SideCheckLoop: next adder11242–11244in the status bar: to BHalf11245–11247too low: leave11248–11249side collision for one half11250nothing, or a pipe top: to BHalf11251–11255not climbable: to CheckSideMTiles11256–11257BHalf: the next adder11258–11260Y under $08, or $D0 and over: leave11261–11265side collision for the other half11266something found: to CheckSideMTiles11267counter − 1, until both sides11268–11269smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11287-L11297ChkPBtm: LDY Player_State ; get player's state CPY #$00 ; check for player's state set to normal BNE StopPlayerMove ; if not, branch to impede player's movement LDY PlayerFacingDir ; get player's facing direction DEY BNE StopPlayerMove ; if facing left, branch to impede movement CMP #$6c ; otherwise check for pipe metatiles BEQ PipeDwnS ; if collided with sideways pipe (bottom), branch CMP #$1f ; if collided with water pipe (bottom), continue BNE StopPlayerMove ; otherwise branch to impede player's movementOur readingChkPBtm: state not normal: StopPlayerMove (by its label)11287–11290facing left: StopPlayerMove (by the comment)11291–11293sideways pipe bottom: to PipeDwnS (by the comment)11294–11295not the water pipe bottom: StopPlayerMove (by the comment)11296–11297smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11149-L11154 — HeadChkHeadChk: LDA Player_Y_Position ; get player's vertical coordinate CMP PlayerBGUpperExtent,x ; compare with upper extent value based on offset BCC DoFootCheck ; if player is too high, skip this part JSR BlockBufferColli_Head ; do player-to-bg collision detection on top of BEQ DoFootCheck ; player, and branch if nothing above player's headOur readingHeadChk: too high: to DoFootCheck11149–11152head collision (by its label)11153nothing: to DoFootCheck11154smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11180-L11195 — DoFootCheckDoFootCheck: LDY $eb ; get block buffer adder offset LDA Player_Y_Position CMP #$cf ; check to see how low player is BCS DoPlayerSideCheck ; if player is too far down on screen, skip all of this JSR BlockBufferColli_Feet ; do player-to-bg collision detection on bottom left of player JSR CheckForCoinMTiles ; check to see if player touched coin with their left foot BCS AwardTouchedCoin ; if so, branch to some other part of code PHA ; save bottom left metatile to stack JSR BlockBufferColli_Feet ; do player-to-bg collision detection on bottom right of player STA $00 ; save bottom right metatile here PLA …Our readingDoFootCheck: too low: to DoPlayerSideCheck11180–11184left foot (by the comment)11185a coin: to AwardTouchedCoin (not quoted)11186–11187right foot (by the comment)11188–11190left foot not empty: to ChkFootMTile (not quoted)11191–11193right foot empty too: to DoPlayerSideCheck11194–11195smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11202-L11204 — ChkFootMTile's hand-off to the side checkChkFootMTile: JSR CheckForClimbMTiles ; check to see if player landed on climbable metatiles BCS DoPlayerSideCheck ; if so, branchOur readingChkFootMTile: climbable: to DoPlayerSideCheck (by its label)11202–11204smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11273-L11286 — CheckSideMTilesCheckSideMTiles: JSR ChkInvisibleMTiles ; check for hidden or coin 1-up blocks BEQ ExCSM ; branch to leave if either found JSR CheckForClimbMTiles ; check for climbable metatiles BCC ContSChk ; if not found, skip and continue with code JMP HandleClimbing ; otherwise jump to handle climbing ContSChk: JSR CheckForCoinMTiles ; check to see if player touched coin BCS HandleCoinMetatile ; if so, execute code to erase coin and award to player 1 coin JSR ChkJumpspringMetatiles ; check for jumpspring metatiles BCC ChkPBtm ; if not found, branch ahead to continue cude LDA JumpspringAnimCtrl ; otherwise check jumpspring animation control …Our readinghidden or coin 1-up block: leave (by the comment)11273–11275climbable: HandleClimbing (by its label)11276–11278a coin: HandleCoinMetatile (by its label)11279–11281a jumpspring (by its label)11282–11283 animating: leave11284–11285 else: StopPlayerMove11286smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12295-L12302 — BlockBufferAdderData and BlockBuffer_X_Adder: in each set of adders, side points 3-4 sit 2 px in, 5-6 at 13 pxBlockBufferAdderData: … BlockBuffer_X_Adder:Our readingadder sets at 0, 7 and $0E12295–12296each set: points 3-4 at x + 2, 5-6 at x + $0D12298–12302smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12317-L12319 — BlockBufferColli_SideBlockBufferColli_Side: LDA #$01 ; set flag to return horizontal coordinate LDX #$00 ; set offset for player objectOur readingBlockBufferColli_Side: horizontal, for the player (by the comment)12317–12319Each frame the player control routine splits the d-pad bits, runs the jump check, the horizontal physics, and the state's routine (which changes the speed, then moves Mario), sets his moving direction from the speed's sign, and only then runs the background collision routine, which lands him. CodeSuper Mario Bros. (World) · 0x63bd-0x63db — BlockBufferAdderData, BlockBuffer_X_AdderChecked by claude, 2026-10-22 — read PlayerBGCollision through StopPlayerMove (L11100-L11333) at the pinned commit; with the big-Mario adders (bg-points) the side loop tests indices 3 and 4 (x+2) with $00 = 2, then 5 and 6 (x+13) with $00 = 1Checked by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Europe (changed, 183 of 213 bytes the same); Japan Disk System (changed, 180 of 213 bytes the same).

Each frame on the ground Mario is set falling and then landed again by the foot check, so he ends a frame on the ground only if a foot found a block. The checks are skipped near the top and bottom of the screen (Y ≥ $CF skips the feet; the side points have their own limits), and a foot that is 5 px or more into its block ends the routine before the sides (smb1/foot-check). CheckSideMTiles lets coins, hidden blocks, vines, and sideways pipe openings through; anything else calls ImpedePlayerMove (smb1/side-push) and returns.

Cited by: Super Mario Bros.

Mario leaves a ledge on the frame his horizontal move leaves neither foot point over a block; the falling state that the background collision routine sets first then stays, so he ends that frame in the air, with a vertical speed of 0, and starts falling on the next. Walking right, the left foot point decides, so he walks 5 px past the edge (measured); walking left, the right foot point decides, 4 px past it (from the code's points). smb1/walk-off

About: Super Mario Bros. Coyote time

Value: right 5 · left 4 (px)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11185-L11195JSR BlockBufferColli_Feet ; do player-to-bg collision detection on bottom left of player … JSR BlockBufferColli_Feet ; do player-to-bg collision detection on bottom right of player STA $00 ; save bottom right metatile here PLA STA $01 ; pull bottom left metatile and save here BNE ChkFootMTile ; if anything here, skip this part LDA $00 ; otherwise check for anything in bottom right metatile BEQ DoPlayerSideCheck ; and skip ahead if notChecked by claude, 2026-10-22 — read DoFootCheck (L11180-L11200) and the state set before it (L11109-L11118) at the pinned commit; ran the probe, which digs a pit into World 1-1's collision map 48 px right of Mario's start: walking, `Player_State` first reads 2 on frame 55, the frame his box center goes from 51 to 53 px, with the vertical speed and fraction at 0; running, on frame 44 (52 to 54 px)Revised after a check by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Probe: probes/lab/smb1-stages.mjs

In other builds: Europe, Japan Disk System (same code, other addresses).

The ground state doesn't move Mario vertically (OnGroundStateSub only moves him horizontally), and every frame he stood, LandPlyr zeroed his vertical speed and its fraction (smb1/landing), so the fall starts from rest. The feet are at x+3 and x+12 (smb1/bg-points), so walking right he stays up until the left foot, 5 px left of his box's center, passes the edge: he walks 5 px past it. Walking left, the right foot (x+12), 4 px right of the center, decides instead; the probe measured only walking right. In the lab, the frame he first counts as airborne is this frame, and the model reproduces the probe's walk-offs frame by frame. A press on that frame itself still jumps, since the jump check runs before the move (smb1/frame-order): the probe's press on frame 55 does. From the next frame on, a press finds him falling and does nothing (smb1/no-coyote-time).

Cited by: Super Mario Bros.

A falling Mario's gravity is a stored falling gravity, which the falling routine copies in every frame. Each area's entrance sets it to $28 (40/256 px/frame²), and only a jump changes it, to its row's falling gravity, so a walk-off before any jump falls at $28 and one after a jump at that jump's falling gravity. smb1/walk-off-gravity

About: Super Mario Bros. Gravity

Value: start 40 · heights 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 7, 8 (1/256 px/frame² (start); px below the ledge on the first 12 frames in the air (heights))

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2324-L2328Entrance_GameTimerSetup: … LDA #$28 ; store value here STA VerticalForceDown ; for fractional movement downwards if necessarysmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4748-L4751FallingSub: LDA VerticalForceDown STA VerticalForce ; dump vertical movement force for falling into main one JMP LRAir ; movement force, then skip ahead to process left/right movementsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4965-L4969GetYPhy: LDA JumpMForceData,y ; store appropriate jump/swim STA VerticalForce ; data here LDA FallMForceData,y STA VerticalForceDownChecked by claude, 2026-10-22 — read Entrance_GameTimerSetup, FallingSub, and InitJS/GetYPhy at the pinned commit; the only other writes to VerticalForce are springs, swimming, and the end-of-level routine, and nothing else writes VerticalForceDown. The probe reads `VerticalForceDown` ($070A) as $28 at World 1-1's start and through a walk-off before any jump, whose heights below the ledge on its first 12 frames are 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 7, 8 px; after a standing jump it reads $70, row 0's falling gravityChecked by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Probe: probes/lab/smb1-stages.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 27 of 31 bytes the same).

$28 is lighter than any jump's falling gravity ($60 to $90, smb1/jump-gravity-fall) and equals the held gravity of the two fastest jump rows (smb1/jump-gravity-held). MovePlayerVertically applies it through ImposeGravity with the usual 4 px/frame cap (smb1/max-fall-speed).

Cited by: Super Mario Bros.

When a foot point finds an ordinary solid block and Mario isn't moving up, the background collision routine lands him if his Y is less than 5 px into the block's 16 px row; 5 px or more, it calls the push-back routine in his moving direction instead, which pushes him 1 px back unless he is already moving away, and leaves without checking his sides. smb1/foot-check

About: Super Mario Bros. Hitbox

Value: land below 5 (px)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11202-L11220ChkFootMTile: … LDY Player_Y_Speed ; check player's vertical speed BMI DoPlayerSideCheck ; if player moving upwards, branch … LDY $04 ; check lower nybble of vertical coordinate returned CPY #$05 ; from collision detection routine BCC LandPlyr ; if lower nybble < 5, branch LDA Player_MovingDir STA $00 ; use player's moving direction as temp variable JMP ImpedePlayerMove ; jump to impede player's movement in that directionChecked by claude, 2026-10-22 — read ChkFootMTile through LandPlyr (L11202-L11221) and ImpedePlayerMove (L11547-L11584) at the pinned commitRevised after a check by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 30 of 39 bytes the same).

Before the Y test, climbable metatiles, the axe, and hidden coin or 1-up blocks send it on to the side check, and during a jumpspring's animation it lands him without the Y test (BNE InitSteP). The check doesn't ask where the block is relative to Mario: a foot in the side of a wall counts the same as a foot on a floor, which is the wall jump (smb1/wall-jump). Landing snaps Y to the block's top (smb1/landing).

Cited by: Super Mario Bros., Wall jump

A side point in a block calls the push-back routine, which moves Mario 1 px away from the block and zeroes his speed byte, unless he is already moving away; either way it clears that side's d-pad bit in a collision byte, which the next frame's friction routine ANDs with the d-pad, so the next frame's friction ignores the direction into the wall. smb1/side-push

About: Super Mario Bros. Hitbox

Value: px 1 (px/frame)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11547-L11584ImpedePlayerMove: LDA #$00 ; initialize value here LDY Player_X_Speed ; get player's horizontal speed LDX $00 ; check value set earlier for DEX ; left side collision BNE RImpd ; if right side collision, skip this part INX ; return value to X CPY #$00 ; if player moving to the left, BMI ExIPM ; branch to invert bit and leave LDA #$ff ; otherwise load A with value to be used later … LDY #$00 …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5091-L5093ImposeFriction: AND Player_CollisionBits ; perform AND between left/right controller bits and collision flag CMP #$00 ; then compare to zero (this instruction is redundant)Checked by claude, 2026-10-22 — read ImpedePlayerMove and the callers' $00 (the side loop's counter, 2 for the left points and 1 for the right) at the pinned commit; PlayerBGCollision resets Player_CollisionBits to $FF before its checks (L11123-L11124). In the probe, walking and running into a wall laid into World 1-1's start, `Player_X_Speed` is 0 after the first push and after the next frame, `Player_CollisionBits` reads $FE, the side point never ends a frame more than 1 px into the wall, and the model matches every frame's position and speedChecked by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Probe: probes/lab/smb1-stages.mjs

In other builds: Europe, Japan Disk System (same code, other addresses).

$00 = 1 (a right-side point, or the foot check while moving right) pushes him left unless his speed is negative and clears the Right bit; $00 = 2 pushes him right unless his speed is 1 or more and clears the Left bit. The push moves the pixel, not the subpixel, and the speed's fraction byte (Player_X_MoveForce) and Player_XSpeedAbsolute are left as they were. With the speed byte at 0 and the d-pad masked, the next frame's friction leaves it at 0 (or brakes a leftover fraction), so Mario held against a wall stops; the frame after, he accelerates into it again and is pushed back once more. A move of more than 1 px into a wall in one frame is undone at 1 px a frame.

Cited by: Super Mario Bros.

Mario can jump off a wall because the foot check counts a block in the wall's side as ground. If his move into a wall puts a foot point in a wall block while he is falling and less than 5 px below a block boundary, the background collision routine lands him there; he starts the next frame on the ground, so a fresh press of A then jumps. smb1/wall-jump

About: Super Mario Bros. Jump

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11214-L11233LDY $04 ; check lower nybble of vertical coordinate returned CPY #$05 ; from collision detection routine BCC LandPlyr ; if lower nybble < 5, branch … LandPlyr: … LDA #$f0 AND Player_Y_Position ; mask out lower nybble of player's vertical position STA Player_Y_Position ; and store as new vertical position to land player properly … InitSteP: LDA #$00 …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4921-L4923LDA Player_State ; check player state BEQ InitJS ; if on the ground, branchChecked by claude, 2026-10-22 — read DoFootCheck through DoPlayerSideCheck, ImpedePlayerMove, and ProcJumping at the pinned commit, and traced a fall into the side of a two-block wall through themChecked by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 39 of 45 bytes the same).

Moving right, the foot point at x+12 is 1 px left of the side point at x+13, and a side point in the wall is pushed back 1 px a frame (smb1/side-push). So the foot only reaches the wall on the frame he arrives, and only if that frame's move takes him at least 2 px in: from a stop, the next frames' speed is too low. The landing snaps his Y up to the block boundary, where the wall continues above his feet, and the side check on the same frame pushes him 1 px back out. If the foot is still in the wall on the next frame's check, he is landed there again, so the press window lasts as long as the foot stays in. Landing on the wall's top instead is an ordinary landing, since nothing is above the feet there.

Cited by: Super Mario Bros., Wall jump

A wall jump's press has to come on a frame that starts with Mario caught on the wall's side. Measured in the cartridge with big Mario, the window was one frame for a walking jump into a wall laid into World 1-1's start, two for a running hop into the level's first pipe, unedited, and one for a running hop from the bricks into World 2-1's last wall; a press on the catch frame itself, or one frame after the window, did nothing. smb1/wall-jump-window

About: Super Mario Bros. Jump

Value: walking 1 · running 1, 2 (frames)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11214-L11217 — the foot check's landing test, which catches himLDY $04 CPY #$05 BCC LandPlyrsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11550-L11575 — ImpedePlayerMove: 1 px out of the wall (`$FF` or `$01` added to X) unless he is already moving away, and his speed byte zeroedLDX $00 ; check value set earlier for DEX ; left side collision BNE RImpd ; if right side collision, skip this part INX ; return value to X CPY #$00 ; if player moving to the left, BMI ExIPM ; branch to invert bit and leave LDA #$ff ; otherwise load A with value to be used later JMP NXSpd ; and jump to affect movement RImpd: LDX #$02 ; return $02 to X CPY #$01 ; if player moving to the right, BPL ExIPM ; branch to invert bit and leave …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11221-L11233 — the catch leaves Player_State 0, as on the groundLandPlyr: … InitSteP: LDA #$00 STA Player_Statesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4921-L4923 — a fresh A press starts a jump when the frame starts in state 0ProcJumping: LDA Player_State BEQ InitJSA side point in a block calls the push-back routine, which moves Mario 1 px away from the block and zeroes his speed byte, unless he is already moving away; either way it clears that side's d-pad bit in a collision byte, which the next frame's friction routine ANDs with the d-pad, so the next frame's friction ignores the direction into the wall. Verified — the push out of the wall, 1 px a frameNo jump from the floor or the bricks in front of it clears World 2-1's last wall, and a wall jump from the bricks does. Measured in the cartridge with big Mario, starting from the wall's screen: after a running hop onto the bricks, a running jump from them with A held peaked 147 px above the floor, short of the wall's top at 160 (computed from the level data), and he next stood on the floor. From the floor, by arithmetic rather than a run, his highest jump's 83 px rise can't reach 160. A 4-frame hop from the bricks brought his foot to the wall's side 80 px up on the way down, at the end of frame 91; a press on frame 92 jumped him to 163 px and onto the top, and presses on frames 91 and 93 didn't jump. The level has another way up without a wall jump: the hidden coin block over the second brick, once hit, is a ledge 128 px up (computed), and a jump from it reaches the top. Verified — the one-frame window from the bricks into World 2-1's last wallChecked by claude, 2026-11-04 — read the foot check's landing test (L11214-L11217), LandPlyr through InitSteP (L11221-L11233), ProcJumping (L4921-L4923), and ImpedePlayerMove's push (L11550-L11575) at the pinned commit; the windows are the 2026-10-25 probe's measurements in the cartridgeRevised after a check by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-10-25.Revised after a check by a second AI model, 2026-11-04: The 1 px push is quoted; the per-pixel window clause is cut (it rested on notes).Probe: probes/lab/smb1-stages.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 76 of 82 bytes the same).

The foot reaches the wall only on the frame Mario arrives (smb1/wall-jump), and the side push then moves him out 1 px a frame (smb1/side-push), so the window is one frame per pixel the foot point got past the wall's edge, counting the edge pixel. Arriving at 2.5 px/frame or less, the foot gets at most 1 px past it, so the window is one or two frames. The catch also needs his Y to be 0 to 4 px below a block boundary on the arrival frame (smb1/foot-check) and a move of at least 2 px that frame, so a speed above 1 px/frame toward the wall. Speed alone doesn't set the window: both running arrivals measured were at running speed, and one gave two frames, the other one.

Cited by: Super Mario Bros., Wall jump

Mario can jump off the side of a wall when his feet meet it at a block boundary, a glitch that Super Mario Wiki counts among maneuvers resembling the later, designed Wall Jump, with "frame-perfect timing". TASVideos' resource page explains it by the floor check running during the push out of a wall, and asks for an X speed above 16 toward the wall. smb1/wall-jump-glitch

About: Super Mario Bros. Jump

WikiWall Jump · History, Super Mario seriesmaneuvers similar to the Wall Jump exist as glitches. For example, in Super Mario Bros., if Mario lands on a wall on a 16×16 boundary (so that his foot is on the top corner of a block), the player is able to jump from that point with frame-perfect timing.Game Resources: NES Super Mario Bros. · WalljumpWalljump happens because the game does a floor check (a simple "is there a solid block below him?" test) even during a wall-ejection.Game Resources: NES Super Mario Bros. · WalljumpSome horizontal speed towards the wall (facing right: X speed > 16, facing left: X speed < 240)Game Resources: NES Super Mario Bros. · WalljumpMario's feet must hit the wall at a block boundary (every 16 pixels)Checked by claude, 2026-10-22 — read both pinned copies (Super Mario Wiki's Wall Jump article and TASVideos' NES Super Mario Bros. game resources)Checked by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-11-06: Quoted the block-boundary line; dropped the unquoted 1 px/frame conversion.Checked by a second AI model, 2026-11-18.

The code (smb1/wall-jump) runs the foot check before the side check, not during the push, but the effect is the one TASVideos describes. "Frame-perfect" fits a walking catch; the probe's running catches gave two frames at World 1-1's first pipe and one at World 2-1's last wall (smb1/wall-jump-window). Neither source says what Nintendo intended.

Cited by: Super Mario Bros., Wall jump

World 1-1's first four pipes stand at block columns 28, 38, 46, and 57, each two blocks wide, with their tops on rows 9, 8, 7, and 7, so 2, 3, 4, and 4 blocks above the floor; the fourth is the one Mario can enter. smb1/world-1-1-pipes

About: Super Mario Bros. Jump

Value: columns 28, 38, 46, 57 · heights 2, 3, 4, 4 · width 2 (16 px blocks)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/levels/objects.asm#L184-L188; level 1-1 L_GroundArea6:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2838-L2844LDA (AreaData),y ; get second byte of area object ASL ; check for page select bit (d7), branch if not set BCC Chk1Row13 LDA AreaObjectPageSel ; check page select BNE Chk1Row13 INC AreaObjectPageSel ; if not already set, set it now INC AreaObjectPageLoc ; and increment page locationsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2956-L2964LrgObj: STA $00 ; store value here (branch for large objects) CMP #$70 ; check for vertical pipe object BNE NotWPipe LDA (AreaData),y ; if not, reload second byte AND #%00001000 ; mask out all but d3 (usage control bit) BEQ NotWPipe ; if d3 clear, branch to get original value LDA #$00 ; otherwise, nullify value for warp pipe STA $00smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L3462-L3468GetPipeHeight: LDY #$01 ; check for length loaded, if not, load JSR ChkLrgObjFixedLength ; pipe length of 2 (horizontal) JSR GetLrgObjAttrib TYA ; get saved lower nybble as height AND #$07 ; save only the three lower bits as STA $06 ; vertical length, then load Y withWorld 1-1's main area as a 224 × 13 grid of what Mario collides with: each cell the metatile the game's area parser puts in the block buffer there, column by column from the area's left edge. Code — the grid's cells: each pipe's top pair on the row its height gives, empty above it; the fourth's top is the warp pipe's $10 and $11, the others the decoration pipe's $12 and $13Super Mario Bros. (World) · 0x269e-0x26b3 — L_GroundArea6Checked by claude, 2026-10-22 — decoded L_GroundArea6 by the parser's rules at the pinned linesChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-11-15.Checked by a second AI model, 2026-11-16.Checked by a second AI model, 2026-11-18.

In other builds: Europe, Japan Disk System (same code, other addresses).

Each object is two bytes: the first's high nybble is the column within the page and its low nybble the row; the second's d7 moves to the next page (ProcessAreaData), d6-d4 = 7 picks a vertical pipe (LrgObj), and its low three bits are the length below the top (GetPipeHeight), so a pipe spans rows top to top + length, and the floor starts on row 11. $c9 $71 is page 1, column 12, row 9, length 1 (column 28); $68 $f2 is page 2, column 6, row 8 (38); $e7 $73 is column 14, row 7 (46); $97 $fb is page 3, column 9, row 7, with d3 set, the usage bit that makes it a warp pipe (57). The stage probe confirms the first in the cartridge: run unedited, World 1-1's first pipe is two blocks tall, 400 px right of Mario's start (probes/lab/smb1-stages.mjs).

World 2-1 ends with a column of solid blocks two wide and ten high, at block columns 190 and 191 from the level's start, rows 1 to 10, so its top is 160 px above the floor. Two columns before it is a jumpspring (column 188); over the ground in front of that are two bricks on row 7 (columns 185 and 186, tops 64 px up) and, over the second, a hidden coin block on row 3 (top 128 px up). smb1/world-2-1-wall

About: Super Mario Bros. Jump

Value
{
 "wall": {
  "columns": [
   190,
   191
  ],
  "rows": [
   1,
   10
  ],
  "metatile": 97,
  "top": 160
 },
 "jumpspring": {
  "column": 188,
  "rows": [
   9,
   10
  ],
  "metatiles": [
   103,
   104
  ]
 },
 "bricks": {
  "columns": [
   185,
   186
  ],
  "row": 7,
  "metatile": 81,
  "top": 64
 },
 "hidden": {
  "column": 186,
  "row": 3,
  "metatile": 95,
  "top": 128
 }
}
Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/levels/objects.asm#L231-L244; level 2-1 L_GroundArea9:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L3022-L3062; large objects (rows $00-$0b or 00-11, d6-d4 set) … .dw RowOfBricks … .dw ColumnOfSolidBlocks … ; small objects (rows $00-$0b or 00-11, d6-d4 all clear) … .dw QuestionBlock ; hidden, coin … .dw Jumpspringsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L3734-L3755LDA #$67 ; draw metatiles in two rows where jumpspring is STA MetatileBuffer,x LDA #$68 STA MetatileBuffer+1,xSuper Mario Bros. (World) · 0x282f-0x2840 — L_GroundArea9Checked by claude, 2026-10-25 — decoded the last objects of L_GroundArea9 by the parser's rules (smb1/world-1-1-pipes) at the pinned lines, with the object tables at L3022-L3062, ColumnOfSolidBlocks (L3667-L3673), Jumpspring (L3734-L3755), and BrickQBlockMetatiles (L6304-L6305); ran the probe, which reads the collision map at the start of the wall's screen and finds metatile $61 in both columns' rows 1-10 and nothing on row 0, $67 and $68 in column 188's rows 9 and 10, $51 in the bricks' cells, and $5f in the hidden block'sChecked by a second AI model, 2026-10-27.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-stages.mjs

In other builds: Europe (changed, 190 of 215 bytes the same); Japan Disk System (changed, 139 of 215 bytes the same).

Counting the page bits (d7 of each second byte) puts the last objects on page 11, columns 176 to 191. $97 $21 is column 9 (185), row 7, a row of bricks (d6-d4 = 2) of length 1, so two bricks; $a3 $02 is column 10 (186), row 3, small object 2, a question block hidden with a coin (metatile $5f, BrickQBlockMetatiles); $c9 $0b is column 12 (188), row 9, small object 11, the jumpspring, which puts $67 and $68 on rows 9 and 10 and an enemy for the spring; $e1 $69 and $f1 $69 are columns 14 and 15 (190, 191), row 1, a column of solid blocks (d6-d4 = 6) of length 9, so rows 1 to 10. Row r's top is (11 − r) × 16 px above the floor, whose top is row 11. The jumpspring's two cells are solid to Mario's feet, but landing on the spring's enemy bounces him (JumpspringHandler).

No jump from the floor or the bricks in front of it clears World 2-1's last wall, and a wall jump from the bricks does. Measured in the cartridge with big Mario, starting from the wall's screen: after a running hop onto the bricks, a running jump from them with A held peaked 147 px above the floor, short of the wall's top at 160 (computed from the level data), and he next stood on the floor. From the floor, by arithmetic rather than a run, his highest jump's 83 px rise can't reach 160. A 4-frame hop from the bricks brought his foot to the wall's side 80 px up on the way down, at the end of frame 91; a press on frame 92 jumped him to 163 px and onto the top, and presses on frames 91 and 93 didn't jump. The level has another way up without a wall jump: the hidden coin block over the second brick, once hit, is a ledge 128 px up (computed), and a jump from it reaches the top. smb1/world-2-1-wall-jump

About: Super Mario Bros. Jump

Value: held peak 147 · catch 80 · catch frame 91 · window 1 · peak 163 (px)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11214-L11217 — the foot check's landing test, which catches him on the wall's sideLDY $04 CPY #$05 BCC LandPlyrsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/levels/objects.asm#L231-L244 — World 2-1's area data (smb1/world-2-1-wall)L_GroundArea9:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L3022-L3029 — the large objects by type: 2 a row of bricks, 6 a column of solid blocks; large objects (rows $00-$0b or 00-11, d6-d4 set) .dw VerticalPipe ; used by warp pipes .dw AreaStyleObject .dw RowOfBricks .dw RowOfSolidBlocks .dw RowOfCoins .dw ColumnOfBricks .dw ColumnOfSolidBlocksWorld 2-1 ends with a column of solid blocks two wide and ten high, at block columns 190 and 191 from the level's start, rows 1 to 10, so its top is 160 px above the floor. Two columns before it is a jumpspring (column 188); over the ground in front of that are two bricks on row 7 (columns 185 and 186, tops 64 px up) and, over the second, a hidden coin block on row 3 (top 128 px up). Verified — the wall's top at 160 px, the bricks' at 64 and the hidden block's at 128, computed there from the area data: row r's top is (11 − r) × 16 px above the floorSuper Mario Bros. (World) · 0x2839-0x2840 — L_GroundArea9Checked by claude, 2026-11-04 — read the foot check's landing test (L11214-L11217), World 2-1's area data (objects.asm L231-L244), and the large-object list (prg.asm L3022-L3029) at the pinned commit, with the heights as world-2-1-wall decodes them; the jumps and the frame-92 press are the 2026-10-25 probe's measurements in the cartridge, and the floor case is arithmetic on apex-heldRevised after a check by a second AI model, 2026-10-25.Revised after a check by a second AI model, 2026-11-04: The object list is quoted and the heights computed.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-stages.mjs

In other builds: Europe (changed, 120 of 123 bytes the same); Japan Disk System (changed, 109 of 123 bytes the same).

Mario's highest jump rises 83 px (smb1/apex-held), and his foot lands on a top only within 4 px of it (smb1/foot-check), so from the bricks' top at 64 px he can't reach 160; the floor and the pipe behind him are lower still. The hidden-block route is measured (case w21-hidden-block, cartridge only: he stands on the bricks, the hit block at 128 px, then the wall's top). The jumpspring in front of the wall is the level's intended way over, but it is unmeasured here: no case bounces on it, and the stage models it as two solid blocks. The probe's case w21-hidden-block climbs onto it and jumps from there onto the wall's top, in the cartridge only (the stage leaves the hidden block out). The wall jump's second jump keeps the running row, since the push out of the wall zeroes his speed byte but not Player_XSpeedAbsolute (smb1/side-push), and so rises 83 px from the catch. The boot starts the level at the wall's page by writing the halfway page, the variable the game reads to restart a level at its midpoint.

While Mario moves up, the background collision routine tests a single head point, the first of its point set (smb1/bg-points), after the frame's movement and before the feet. It acts only if his vertical speed byte is negative, the low nybble of his own Y is 4 or more, and his Y is at least $20 (big) or $10 (small, or big and crouching), and only if the point's metatile is nonzero and not a coin. So one block at most is hit per frame: when his head spans two blocks, the one under the point is hit and the other is ignored. Measured: big Mario under a brick that covered only his box's left part rose past it untouched. smb1/head-check

About: Super Mario Bros. Hitbox

Value
{
 "minLowNybble": 4,
 "minY": {
  "big": 32,
  "small": 16
 }
}
Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11149-L11161HeadChk: LDA Player_Y_Position ; get player's vertical coordinate CMP PlayerBGUpperExtent,x ; compare with upper extent value based on offset BCC DoFootCheck ; if player is too high, skip this part JSR BlockBufferColli_Head ; do player-to-bg collision detection on top of BEQ DoFootCheck ; player, and branch if nothing above player's head JSR CheckForCoinMTiles ; check to see if player touched coin with their head BCS AwardTouchedCoin ; if so, branch to some other part of code LDY Player_Y_Speed ; check player's vertical speed BPL DoFootCheck ; if player not moving upwards, branch elsewhere LDY $04 ; check lower nybble of vertical coordinate returned CPY #$04 ; from collision detection routine …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11097-L11098PlayerBGUpperExtent:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11145-L11148LDX PlayerSize ; get player's size as offset LDA CrouchingFlag BEQ HeadChk ; if player not crouching, branch ahead INX ; otherwise increment size as offsetSuper Mario Bros. (World) · 0x5c72-0x5c73 — PlayerBGUpperExtentChecked by claude, 2026-10-22 — read HeadChk through NYSpd (L11149-L11178), PlayerBGUpperExtent, and RetYC (the returned nybble is of `Player_Y_Position`, smb1/block-lookup) at the pinned commit; `PlayerSize` is 0 big and 1 small, so the two bytes serve big (index 0) and small or big crouching (index 1). In the probe Mario stands at X = 40, so the head point (x+8) is pixel 48, the left edge of block column 3: a brick in column 2 alone was never hit, and with a brick in column 2 and a ? block in column 3 only the ? block was bumped. Every probed hit came with the low nybble of Y at 9 (big) or 13 (small)Revised after a check by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-blocks.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 19 of 38 bytes the same).

The point's offsets are in smb1/bg-points: x+8 and y+4 big, y+18 small or crouching, y+2 big and swimming. The low-nybble test never stops a hit from below in a jump (computed): the head point enters a block through its bottom, at most 5 px a frame (smb1/jump-y-speed), so on its first frame inside it is 11 to 15 px into the block's 16 px row, which puts Mario's Y nybble at 7 or more (big, point at y+4) or 9 or more (small, y+18). The Y limits keep the check off the top rows of the screen. A coin at the point is collected instead (AwardTouchedCoin). Small Mario doesn't crouch.

Cited by: Destructible terrain

When the head point finds a block in the solid ranges (smb1/head-kinds), the background collision routine sets Mario's vertical speed byte to 1 and plays the bump sound; his position and the speed's fraction are left as they are, so the frame ends with his head inside the block and he starts down on the next. In water levels, and while the block bounce timer runs (smb1/bounce-timer), a brick or ? block gets the same speed of 1 without the sound and without being hit. smb1/head-solid

About: Super Mario Bros. Hitbox

Value: y speed 1 (px/frame)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11162-L11178JSR CheckForSolidMTiles ; check to see what player's head bumped on BCS SolidOrClimb ; if player collided with solid metatile, branch LDY AreaType ; otherwise check area type BEQ NYSpd ; if water level, branch ahead LDY BlockBounceTimer ; if block bounce timer not expired, BNE NYSpd ; branch ahead, do not process collision JSR PlayerHeadCollision ; otherwise do a sub to process collision JMP DoFootCheck ; jump ahead to skip these other parts here … SolidOrClimb: CMP #$26 ; if climbing metatile, BEQ NYSpd ; branch ahead and do not play sound …Checked by claude, 2026-10-22 — read L11162-L11178 at the pinned commit. In the probe big Mario jumped into a solid block ($61) 4 rows above the floor: on the hit frame his speed byte went from −4 to 1 with the fraction ($C0) unchanged, his head point ended 3 px inside the block, and he moved 2 px down on the next frame; the block's cell was unchangedChecked by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Probe: probes/lab/smb1-blocks.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 23 of 33 bytes the same).

Metatile $26 (the vine's blank) gets the speed without the sound.

Cited by: Destructible terrain

The solid-metatile check splits what a head can meet by the metatile's top two bits: at or above $10, $61, $88, or $C4 in its group is solid (smb1/head-solid); below is hit (the head-hit routine). The collision map stores nothing below $10, $51, $88, and $C0 in the same groups, so the hit kinds are $51–$60 (bricks, the cracked-rock ground, bricks with items, hidden blocks) and $C0–$C1 (? blocks); a used block ($C4), the solid blocks from $61, and pipes are solid. smb1/head-kinds

About: Super Mario Bros. Destructible terrain

Metatile group (top two bits)Solid from metatile (decimal)Stored from metatile (decimal)
01616
19781
2136136
3196192
Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11588-L11594SolidMTileUpperExt: … CheckForSolidMTiles: JSR GetMTileAttrib ; find appropriate offset based on metatile's 2 MSB CMP SolidMTileUpperExt,x ; compare current metatile with solid metatilessmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2799-L2819CMP BlockBuffLowBounds,y ; check for certain values depending on bits set BCS StrBlock ; if equal or greater, branch LDA #$00 ; if less, init value before storing … BlockBuffLowBounds:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L1634-L1651; breakable brick w/ line ; breakable brick ; breakable brick (not used) ; cracked rock terrain ; brick with line (power-up) … ; hidden block (1-up) ; solid block (3-d block)smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L1676-L1681Palette3_MTiles: ; question block (coin) ; question block (power-up) ; coin ; underwater coin ; empty blockSuper Mario Bros. (World) · 0x5f9b-0x5f9e — SolidMTileUpperExtSuper Mario Bros. (World) · 0x1514-0x1517 — BlockBuffLowBoundsSuper Mario Bros. (World) · 0xc00-0xc13 — Palette1_MTilesSuper Mario Bros. (World) · 0xc3c-0xc43 — Palette1_MTilesSuper Mario Bros. (World) · 0xc9c-0xcaf — Palette3_MTilesChecked by claude, 2026-10-22 — read CheckForSolidMTiles and GetMTileAttrib (L11588-L11624), the block-buffer store in RenderAreaGraphics's column loop (L2790-L2819), and the metatile lists at the pinned commit; group 1's list starts at `$40` (L1616), so line 1634 is `$51` and line 1650 is `$61`, and group 3's starts at `$C0`Checked by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Europe (changed, 127 of 133 bytes the same); Japan Disk System (changed, 125 of 133 bytes the same).

$C2 and $C3 are coins, which the head check collects before this test (smb1/head-check). Group 0 and group 2 have no hit kinds, since nothing below their solid bounds reaches the collision map. The ground-level terrain metatile is $54 (TerrainMetatiles, L2639-L2640), which is why the ground can break (smb1/ground-breaks).

Cited by: Destructible terrain

The head-hit routine bumps the block unless Mario is big and the metatile is missing from a list of ? blocks ($C0, $C1), hidden blocks ($5F, $60), and bricks with items ($55–$5E); then it breaks it (smb1/brick-break). So big Mario breaks plain bricks ($51–$53) and bumps the rest, and small Mario bumps everything. Size is the player-size byte, so by the code a crouching big Mario breaks bricks too (not probed). Measured: big Mario, standing, broke a brick and bumped a ? block and a hidden block; small Mario bumped a brick and a ? block. smb1/bump-or-break

About: Super Mario Bros. Destructible terrain

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6151-L6159PlayerHeadCollision: PHA ; store metatile number to stack LDA #$11 ; load unbreakable block object state by default LDX SprDataOffset_Ctrl ; load offset control bit here LDY PlayerSize ; check player's size BNE DBlockSte ; if small, branch LDA #$12 ; otherwise load breakable block object state DBlockSte: STA Block_State,x ; store into block object buffersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6168-L6176JSR BlockBumpedChk ; do a sub to check which block player bumped head on … ChkBrick: BCC PutMTileB ; if no match was found in previous sub, skip ahead LDY #$11 ; otherwise load unbreakable state into block object buffer STY Block_State,x ; note this applies to both player sizessmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6218-L6224LDY Block_State,x ; get block object state CPY #$11 BEQ Unbreak ; if set to value loaded for unbreakable, branch JSR BrickShatter ; execute code for breakable brick JMP InvOBit ; skip subroutine to do last part of code here Unbreak: JSR BumpBlock ; execute code for unbreakable brick or question blocksmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6304-L6320BrickQBlockMetatiles: ; used by question blocks … ; used by ground level types ; used by other level types … CLC ; if none match, return with carry clearSuper Mario Bros. (World) · 0x3df8-0x3e05 — BrickQBlockMetatilesChecked by claude, 2026-10-22 — read PlayerHeadCollision (L6151-L6232) and BlockBumpedChk at the pinned commit; between BlockBumpedChk and `BCC PutMTileB` only STA, LDY, BNE, and TYA run, which keep the carry. The probe wrote each block 4 rows above World 1-1's floor and jumped: `Block_State` read 2 (brick chunks) after the big brick and 1 (bouncing block) after every bumpRevised after a check by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-blocks.mjs

In other builds: Europe (changed, 63 of 73 bytes the same); Japan Disk System (changed, 61 of 73 bytes the same).

The states $11 and $12 keep only their low nybble once BlockObjectsCore has run, so RAM shows 1 or 2.

Cited by: Destructible terrain, Super Mario Bros.

A bump sets Mario's vertical speed byte to 0, keeping the fraction, and starts a block object at the block's row moving up at 2 px/frame under a gravity of $50/256 px/frame². The object moves on the hit frame itself, after the player; measured against its row, it reads −2, −4, −6, −7, −7, −8, −8, −8, −7, −6, −5, −4, −2, 0 px on the hit frame and the 13 after, and it ends when its Y's low nybble is under 5. The block's cell holds $23 from the hit frame, and the next frame's block metatile updater writes the block back: a used block ($C4) for ? blocks, hidden blocks, and item bricks, the metatile itself for a plain brick or ground block that small Mario hit. Measured: the cell held $23 for 14 frames. smb1/block-bump

About: Super Mario Bros. Destructible terrain

Value: mario Y speed 0 · block Y speed -2 · gravity 80 · rise -2, -4, -6, -7, -7, -8, -8, -8, -7, -6, -5, -4, -2, 0 · cell frames 14 (px, frames)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6249-L6258BumpBlock: JSR CheckTopOfBlock ; check to see if there's a coin directly above this block … STA Player_Y_Speed ; init player's vertical speed LDA #$fe STA Block_Y_Speed,x ; set vertical speed for block objectOur readingcheck for a coin above (by the comment)6250player vertical speed ← 0 (not quoted)6253–6256block vertical speed ← $FE6257–6258smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6170-L6203LDY PlayerSize ; check player's size BNE ChkBrick ; if small, use metatile itself as contents of A TYA ; otherwise init A (note: big = 0) … LDA #$c4 ; load empty block metatile into A for now … PutMTileB: STA Block_Metatile,x ; store whatever metatile be appropriate here JSR InitBlock_XY_Pos ; get block object horizontal coordinates saved LDY $02 ; get vertical high nybble offset LDA #$23 STA ($06),y ; write blank metatile $23 to block buffer …Our readingbig: A ← 0; small: A keeps the metatile (by the comment)6170–6172no match found: store A as it is6174else: state ← unbreakable, A ← used block $C46175–6177 $58 or $5D, a coin brick (by the comment)6178–6182 coin timer not started: timer ← $0B, started6184–6188 timer still running: keep the brick6190–6194 else: the used block6192store A as the block's metatile6195–6196the block's position (by its label)6197cell ← $236198–6200bounce timer ← $106201–6202smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6430-L6444LDA Block_Y_Position,x ; get vertical coordinate AND #$0f ; mask out high nybble CMP #$05 ; check to see if low nybble wrapped around PLA ; pull state from stack BCS UpdSte ; if still above amount, not time to kill block yet, thus branch LDA #$01 STA Block_RepFlag,x ; otherwise set flag to replace metatileOur readingblock Y's low nybble 5 or more: keep going6434–6438else: flag the cell for replacing6439–6440 and state ← 0: the block ends6441–6444smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6619-L6623ImposeGravityBlock: LDY #$01 ; set offset for maximum speed LDA #$50 ; set movement amount hereOur readingtop speed index 16620movement force ← $506621smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4101-L4109JSR BlockObjMT_Updater ; replace block objects with metatiles if necessary … JSR BlockObjectsCore ; process first block objectOur readingreplace flagged blocks (by its label)4103then each block object (by its label)4104–4109smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6451-L6470BlockObjMT_Updater: … LDA VRAM_Buffer1 ; if vram buffer already being used here, BNE NextBUpd ; branch to move onto next block object LDA Block_RepFlag,x ; if flag for block object already clear, … LDA Block_Metatile,x ; get metatile to be written STA ($06),y ; write it to the block bufferOur readingVRAM buffer in use: skip6455–6456flag clear: skip6457–6458write the metatile to the cell6466–6467replace it on screen (by its label)6468clear the flag6469–6470Checked by claude, 2026-10-22 — read PlayerHeadCollision, BumpBlock, BouncingBlockHandler, ImposeGravityBlock and ImposeGravity, BlockObjMT_Updater, and the GameEngine order at the pinned commit; the player runs in `GameRoutines` before `GameEngine` (L4082-L4084). The probe's five bumps (big: ? block, hidden block; small: brick, ground block, ? block) gave the same rise, the cell `$23` from the hit frame through the bounce's last frame and rewritten 14 frames after the hit, `$C4` after the ? and hidden blocks and the original metatile after small Mario's brick and ground blockChecked by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.Probe: probes/lab/smb1-blocks.mjs

In other builds: Europe (changed, 159 of 185 bytes the same); Japan Disk System (changed, 158 of 185 bytes the same).

The bouncing block is drawn as a sprite; collision uses only the cell (smb1/bounce-solid). The updater skips a frame on which the VRAM buffer is already in use, which can delay the rewrite. A coin directly above the block is collected (CheckTopOfBlock). The item comes from the block's place in BrickQBlockMetatiles (BlockCode); a brick with coins ($58, $5D) keeps its own metatile until BrickCoinTimer runs out (smb1/coin-brick). Speeds here are px/frame with a fraction byte, as for Mario.

Cited by: Destructible terrain

Every head hit that reaches the head-hit routine, bump or break, sets the block bounce timer to 16, a frame timer. Until it is back at 0, the head check treats bricks and ? blocks as solid without the sound (smb1/head-solid), so no second block can be bumped or broken for 16 frames. Measured after five bumps: 16 on the hit frame, 0 sixteen frames later. smb1/bounce-timer

About: Super Mario Bros. Destructible terrain

Value: 16 frames

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6201-L6202LDA #$10 STA BlockBounceTimer ; set block bounce timersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11166-L11167LDY BlockBounceTimer ; if block bounce timer not expired, BNE NYSpd ; branch ahead, do not process collisionsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/ram.asm#L60-L65Timers = $0780 … BlockBounceTimer = $0784smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L126-L136DecTimers: LDX #$14 ; load end offset for end of frame timers … DEC Timers,x ; otherwise decrement the current timerChecked by claude, 2026-10-22 — read the store and the test at the pinned commit; the store is in `PlayerHeadCollision` before the bump-or-break branch, so breaks set it too. `$0784` is Timers+4, inside the `$14` frame timers that `DecTimers` counts down every frame. The probe asserts 16 on the hit frame and 0 sixteen frames after for its five bumps (big: ? block, hidden block; small: brick, ground block, ? block); breaks are read from the code onlyRevised after a check by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Probe: probes/lab/smb1-blocks.mjs

In other builds: Japan Disk System (moved); Europe (changed, 26 of 32 bytes the same).

Two block objects exist (SprDataOffset_Ctrl alternates between them), so a new bounce can start while the last brick's debris still flies.

Cited by: Destructible terrain

During a bounce, and on the frame after a brick breaks, the block's cell holds $23, and every test of the background collision routine takes its solid path for it: the head check's solid range starts at $10 in group 0; the foot check's exceptions (climbable from $24, the axe $C5, hidden blocks $5F and $60) miss it, so it lands Mario or pushes him back; and the side check's exceptions (hidden blocks, climbable, coins $C2 and $C3, jumpspring $67 and $68, the pipe openings) miss it, so it ends in the routine that stops his move. smb1/bounce-solid

About: Super Mario Bros. Destructible terrain

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L1611; blank, used on bricks or blocks that are hitsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11202-L11221ChkFootMTile: JSR CheckForClimbMTiles ; check to see if player landed on climbable metatiles BCS DoPlayerSideCheck ; if so, branch LDY Player_Y_Speed ; check player's vertical speed BMI DoPlayerSideCheck ; if player moving upwards, branch CMP #$c5 BNE ContChk ; if player did not touch axe, skip ahead JMP HandleAxeMetatile ; otherwise jump to set modes of operation ContChk: JSR ChkInvisibleMTiles ; do sub to check for hidden coin or 1-up blocks BEQ DoPlayerSideCheck ; if either found, branch LDY JumpspringAnimCtrl ; if jumpspring animating right now, …Our readingclimbable: to the side check (by its label)11203–11204moving up: to the side check11205–11206the axe $C5: its handler11207–11209hidden coin or 1-up block: to the side check11211–11212jumpspring animating: on to InitSteP (not quoted)11213–11214low nybble of the height below 5: land (by its label)11215–11217else: impede him in his moving direction11218–11220smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11273-L11298CheckSideMTiles: JSR ChkInvisibleMTiles ; check for hidden or coin 1-up blocks BEQ ExCSM ; branch to leave if either found JSR CheckForClimbMTiles ; check for climbable metatiles BCC ContSChk ; if not found, skip and continue with code JMP HandleClimbing ; otherwise jump to handle climbing ContSChk: JSR CheckForCoinMTiles ; check to see if player touched coin BCS HandleCoinMetatile ; if so, execute code to erase coin and award to player 1 coin JSR ChkJumpspringMetatiles ; check for jumpspring metatiles BCC ChkPBtm ; if not found, branch ahead to continue cude … …Our readinghidden coin or 1-up block: leave (by the comment)11274–11275climbable: climb (by its label)11276–11278a coin: take it (by the comment)11280–11281a jumpspring:11282–11283 animating: leave (not quoted)11284–11285 else: stop his move (not quoted)11286state not normal: stop his move (by its label)11288–11290facing left: stop his move (by its label)11291–11293sideways pipe bottom $6C: the pipe (by the comment)11294–11295not the water pipe bottom $1F: stop his move (by its label)11296–11297$1F: on to the pipe (not quoted)11298smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11331-L11332StopPlayerMove: JSR ImpedePlayerMove ; stop player's movementOur readingimpede his movement11331–11332smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11461-L11464ChkInvisibleMTiles: CMP #$5f ; check for hidden coin block BEQ ExCInvT ; branch to leave if found CMP #$60 ; check for hidden 1-up blockOur readinghidden coin block $5F: found11462–11463or the hidden 1-up block $60 (not quoted)11464smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11486-L11489ChkJumpspringMetatiles: CMP #$67 ; check for top jumpspring metatile BEQ JSFnd ; branch to set carry if found CMP #$68 ; check for bottom jumpspring metatileOur readingtop jumpspring $67: found11487–11488or the bottom one $68 (not quoted)11489smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11596-L11597ClimbMTileUpperExt:Super Mario Bros. (World) · 0xbac-0xbaf — Palette0_MTilesSuper Mario Bros. (World) · 0x5fa6-0x5fa9 — ClimbMTileUpperExtChecked by claude, 2026-10-22 — read the metatile list (group 0 from L1575, so L1611 is `$23`), ChkFootMTile through LandPlyr, CheckSideMTiles through StopPlayerMove (L11273-L11332), ChkInvisibleMTiles, ChkJumpspringMetatiles, CheckForClimbMTiles, and CheckForCoinMTiles (`$C2`, `$C3`) at the pinned commit, with `$23` in A at each test; the side loop's own pipe-top exceptions are `$1C` and `$6B` (L11252-L11255). The probe saw a head hit on `$23` (smb1/brick-break)Revised after a check by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Europe (changed, 93 of 112 bytes the same); Japan Disk System (changed, 89 of 112 bytes the same).

The cell is a 16 px square at the block's row the whole time; the sprite drawn rising 8 px above it doesn't collide. With his state not normal (in the air), the side check stops Mario before it reaches the pipe tests.

Cited by: Destructible terrain

Breaking a brick sets Mario's vertical speed byte to −2, adds 50 points, spawns debris (smb1/brick-debris), and flags the cell, which holds $23 meanwhile, to be cleared to 0. The clearing comes on the next frame's block metatile updater, after that frame's background collision routine, so the next frame's head check still meets $23 and sets the speed to 1: a break stops the jump one frame later, 1 or 2 px higher (computed), not passing through. Measured: 1 px higher, speed 1, and the cell 0 by the end of that frame, with a second brick stacked above never reached. smb1/brick-break

About: Super Mario Bros. Destructible terrain

Value: y speed -2 · points 50 · cleared after 1 (px/frame, points, frames)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6324-L6334BrickShatter: JSR CheckTopOfBlock ; check to see if there's a coin directly above this block LDA #Sfx_BrickShatter STA Block_RepFlag,x ; set flag for block object to immediately replace metatile STA NoiseSoundQueue ; load brick shatter sound JSR SpawnBrickChunks ; create brick chunk objects LDA #$fe STA Player_Y_Speed ; set vertical speed for player LDA #$05 STA DigitModifier+5 ; set digit modifier to give player 50 pointssmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6170-L6172LDY PlayerSize ; check player's size BNE ChkBrick ; if small, use metatile itself as contents of A TYA ; otherwise init A (note: big = 0)smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6160JSR DestroyBlockMetatile ; store blank metatile in vram buffer to write to name tablesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6451-L6470LDA VRAM_Buffer1 ; if vram buffer already being used here, BNE NextBUpd ; branch to move onto next block objectChecked by claude, 2026-10-22 — read PlayerHeadCollision, BrickShatter, DestroyBlockMetatile, BlockObjMT_Updater, and the NMI (UpdateScreen empties the VRAM buffer before the game logic, L101-L111) at the pinned commit: the hit frame's DestroyBlockMetatile fills the VRAM buffer, so that frame's updater skips and the next one writes `Block_Metatile` (0 for big Mario). In the probe the score rose by 50, and on the frame after each break (brick, ground block, brick under a brick) Mario was 1 px higher with speed byte 1 and the cell read 0Checked by a second AI model, 2026-10-22.Checked by a second AI model, 2026-10-28.Probe: probes/lab/smb1-blocks.mjs

In other builds: Europe (same code, other addresses); Japan Disk System (changed, 65 of 76 bytes the same).

1 or 2 px (computed): the move adds the speed byte −2 plus a carry from the fraction. The head hit came with Y's low nybble at 7 or more (smb1/head-check), so after a rise of 2 px or less it is still 4 or more and the test runs. A coin directly above the brick is collected too. The status bar shows the score with a fixed trailing 0, so the digit set is the tens.

Cited by: Destructible terrain

The debris routine makes the debris from two block objects at the block's place, the upper starting up at 6 px/frame and the lower, 8 px down, at 4 px/frame, both with horizontal speed $F0. The block-object routine moves each under the block gravity ($50/256 px/frame², fall cap 8) and draws them with the chunk-drawing routine, which puts each object's two sprites at its own X and at the original X mirrored across it, plus 6, so four chunks fly apart. smb1/brick-debris

About: Super Mario Bros. Destructible terrain

Value: y speed -6, -4 · x speed -1 · gravity 80 · max fall 8 (px/frame)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6362-L6386SpawnBrickChunks: … LDA #$f0 STA Block_X_Speed,x ; set horizontal speed for brick chunk objects STA Block_X_Speed+2,x LDA #$fa STA Block_Y_Speed,x ; set vertical speed for one LDA #$fc STA Block_Y_Speed+2,x ; set lower vertical speed for the other … ADC #$08 ; and save as vertical coordinate for one of themOur readingboth horizontal speeds ← $F06365–6367upper vertical speed ← $FA6368–6369lower vertical speed ← $FC6370–6371lower one 8 px down6379–6382upper speed ← $FA again6383–6384smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6400-L6412BEQ BouncingBlockHandler ; branch if found, otherwise continue for brick chunks JSR ImposeGravityBlock ; do sub to impose gravity on one block object object JSR MoveObjectHorizontally ; do another sub to move horizontally … JSR ImposeGravityBlock ; do sub to impose gravity on other block object JSR MoveObjectHorizontally ; do another sub to move horizontally … JSR DrawBrickChunks ; draw the brick chunksOur readingfirst: gravity, then horizontal move6401–6402second object, index + 2:6403–6406 gravity, then horizontal move6407–6408draw the chunks (by its label)6412smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6612-L6623MaxSpdBlockData: … ImposeGravityBlock: LDY #$01 ; set offset for maximum speed LDA #$50 ; set movement amount hereOur readingtop speed index 16620movement force ← $506621top speed ← table[1], 86623smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L13501-L13522LDA Block_Rel_XPos ; get first block object's relative horizontal coordinate STA Sprite_X_Position,y ; save into X coordinate of first sprite LDA Block_Orig_XPos,x ; get original horizontal coordinate … SBC Block_Rel_XPos ; get difference of relative positions of original - current ADC $00 ; add original relative position to result ADC #$06 ; plus 6 pixels to position second brick chunk correctly STA Sprite_X_Position+4,y ; save into X coordinate of second sprite … STA Sprite_X_Position+8,y ; save into X coordinate of third sprite … ADC #$06 ; plus 6 pixels to position fourth brick chunk correctly …Our readingfirst sprite X ← the first object's13501–13502second sprite X ← mirrored, + 613503–13511third sprite X ← the second object's13515–13516fourth sprite X ← mirrored, + 613517–13522Super Mario Bros. (World) · 0x3faf-0x3fb0 — MaxSpdBlockDataChecked by claude, 2026-10-22 — read SpawnBrickChunks, the chunk branch of BlockObjectsCore (L6389-L6427), ImposeGravityBlock, and DrawBrickChunks (L13474-L13540) at the pinned commit; the second sprite of each pair sits at 2 × the original X's screen position − the object's, + 6, so it moves right as the first moves leftRevised after a check by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Europe (changed, 120 of 145 bytes the same); Japan Disk System (changed, 119 of 145 bytes the same).

$F0 is −1 px/frame in the 4.4 format horizontal speeds use (smb1/x-speed-format), since MoveObjectHorizontally is the routine that format claim reads. The chunks are killed when they leave the bottom or top of the screen (L6413-L6426).

Cited by: Destructible terrain

Big Mario breaks a ground block he hits from below: the overworld's terrain metatile, $54 (cracked rock), is in the hit range and not in the list of blocks that even big Mario only bumps (? blocks, hidden blocks, bricks with items; smb1/bump-or-break), so the game treats it as a plain brick (smb1/bump-or-break). Measured with a $54 block written 4 rows above World 1-1's floor: big Mario broke it, for 50 points, and small Mario bumped it, the block bouncing and coming back as $54. smb1/ground-breaks

About: Super Mario Bros. Destructible terrain

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2639-L2640TerrainMetatiles:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L1637; cracked rock terrainSuper Mario Bros. (World) · 0x13e8-0x13eb — TerrainMetatilesSuper Mario Bros. (World) · 0xc0c-0xc0f — Palette1_MTilesChecked by claude, 2026-10-22 — read TerrainMetatiles and the metatile list ($54 is group 1's 21st entry, L1616 + 21) at the pinned commit; the table's order is the area types, water, ground, underground, castle. The probe broke and bumped the block as statedChecked by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-blocks.mjs

In other builds: Europe (same bytes); Japan Disk System (moved).

Mario's head reaches the ground from below only off the usual path, as the ground is the floor. Underground levels use $52, the plain brick, as terrain; water levels' $69 and castles' $62 are solid.

Cited by: Destructible terrain

A brick with coins ($58, $5D) starts a coin timer at 11 on its first hit. Every bump gives a coin; while the timer runs the brick comes back as itself, and the first bump after it reaches 0 leaves a used block. It is an interval timer, counted down once every 21 frames, so the brick pays out for 11 such ticks, 211 to 231 frames (computed). smb1/coin-brick

About: Super Mario Bros. Destructible terrain

Value: ticks 11 · frames per tick 21 · min frames 211 · max frames 231 (frames)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6177-L6194LDA #$c4 ; load empty block metatile into A for now LDY $00 ; get metatile from before CPY #$58 ; is it brick with coins (with line)? BEQ StartBTmr ; if so, branch CPY #$5d ; is it brick with coins (without line)? BNE PutMTileB ; if not, branch ahead to store empty block metatile StartBTmr: LDA BrickCoinTimerFlag ; check brick coin timer flag BNE ContBTmr ; if set, timer expired or counting down, thus branch LDA #$0b STA BrickCoinTimer ; if not set, set brick coin timer INC BrickCoinTimerFlag ; and set flag linked to it …Our readingthe empty block to start6177not a coin brick ($58, $5D): store it (not quoted)6179–6182timer flag clear:6184–6185 timer ← 11, flag set6186–6188timer still running: the brick itself (not quoted)6190–6191else: the empty block6192smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6259-L6276LDA $05 ; get original metatile from stack JSR BlockBumpedChk ; do a sub to check which block player bumped head on BCC ExitBlockChk ; if no match was found, branch to leave TYA ; move block number to A CMP #$09 ; if block number was within 0-8 range, BCC BlockCode ; branch to use current number SBC #$05 ; otherwise subtract 5 for second set to get proper number BlockCode: JSR JumpEngine ; run appropriate subroutine depending on block number … .dw CoinBlock .dw ExtraLifeMushBlock …Our readingthe bumped block's number6260 no match: leave (not quoted)6261number 9 or more: − 56263–6265run the block's routine by number6267 1, 2, 7: the coin block (not quoted)6270–6276smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6304-L6309BrickQBlockMetatiles: ; used by question blocks … ; used by ground level types ; used by other level typessmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L126-L136DecTimers: LDX #$14 ; load end offset for end of frame timers DEC IntervalTimerControl ; decrement interval timer control, BPL DecTimersLoop ; if not expired, only frame timers will decrement LDA #$14 STA IntervalTimerControl ; if control for interval timers expired, LDX #$23 ; interval timers will decrement along with frame timers … DEC Timers,x ; otherwise decrement the current timerOur readingframe timers end at $14127interval control − 1; not past 0: frame timers only128–129else: control ← $14, interval timers too130–132each timer at 0 stays (not quoted)134–135else − 1136smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/ram.asm#L60-L77Timers = $0780 … BrickCoinTimer = $079dSuper Mario Bros. (World) · 0x3df8-0x3e05 — BrickQBlockMetatilesChecked by claude, 2026-10-22 — read L6177-L6197, BumpBlock's dispatch (L6249-L6277), and DecTimers at the pinned commit. `$079D` is Timers+`$1D`, past the `$14` frame timers, so it counts only when IntervalTimerControl runs out, which it is reset to `$14` to do every 21st frame. In `BrickQBlockMetatiles`, `$58` is entry 7 and `$5D` entry 12, which `BlockCode` reduces to 7; entry 7 of the jump table (L6276) is `CoinBlock`. BumpBlock reads the original metatile ($05), so the last bump gives a coin as wellRevised after a check by a second AI model, 2026-10-22.Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Europe (changed, 81 of 102 bytes the same); Japan Disk System (changed, 79 of 102 bytes the same).

BrickCoinTimerFlag is a single flag, cleared whenever the level decoder draws a brick with coins (BrickWithCoins, L3770-L3772), so a coin brick hit before the next one comes on screen shares the earlier timer. The 211-231 range is 11 ticks of 21 frames less the part of the first tick already gone when the brick is hit.

Cited by: Destructible terrain

Over its first 216 block columns, through the castle, World 1-1's collision map, as the probe reads it from the cartridge's block buffer, holds a floor with three pits (2, 3, and 2 blocks wide), six pipes (2, 3, 4, 4, 2, and 2 blocks tall), four 4-step stairs and an 8-step one, 13 ? blocks, 30 bricks, a hidden 1-up block, and the flagpole at column 198 on a one-block base. smb1/world-1-1

Value
{
 "columns": 216,
 "pits": [
  [
   69,
   2
  ],
  [
   86,
   3
  ],
  [
   153,
   2
  ]
 ],
 "pipes": [
  [
   28,
   2
  ],
  [
   38,
   3
  ],
  [
   46,
   4
  ],
  [
   57,
   4
  ],
  [
   163,
   2
  ],
  [
   179,
   2
  ]
 ],
 "stairs": [
  {
   "at": 134,
   "steps": [
    1,
    2,
    3,
    4
   ]
  },
  {
   "at": 140,
   "steps": [
    4,
    3,
    2,
    1
   ]
  },
  {
   "at": 148,
   "steps": [
    1,
    2,
    3,
    4,
    4
   ]
  },
  {
   "at": 155,
   "steps": [
    4,
    3,
    2,
    1
   ]
  },
  {
   "at": 181,
   "steps": [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    8
   ]
  },
  {
   "at": 198,
   "steps": [
    1
   ]
  }
 ],
 "questions": 13,
 "bricks": 30,
 "hidden": [
  64
 ],
 "pole": 198
}
Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/levels/objects.asm#L184-L197; level 1-1 L_GroundArea6:Super Mario Bros. (World) · 0x26a0-0x26b3 — L_GroundArea6Checked by claude, 2026-10-26 — read L_GroundArea6 at the pinned commit and decoded its first objects by hand: the ? blocks at columns 16, 21, 22 (row 3), and 23, the brick row at 20-24, the 2-block pipe at 28, and the hidden 1-up at column 64, row 6 ($06,$83 after the page flag). The probe's map has each, and its counts and the stage's cells match the valueRevised after a check by a second AI model, 2026-10-27.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-level-map.mjs

In other builds: Europe (same bytes); Japan Disk System (moved).

Columns are 16 px and count from the level's left edge (Mario starts in column 2), rows from the top of the play area (row 11 is the floor's top). The probe restarts the level at each page with HalfwayPage, clears the enemies, and reads the block buffer: the cells the game collides with, which is what the movement lab's world-1-1 stage copies. Steps count up from the floor, and the stair at 198 is the flagpole's base. Two of the bricks hold items (coins at column 94, a star at 101).

Mario catches the flagpole when his lower side collision point finds a pole metatile and the low 4 bits of his own x position (not the point's) are 6 to 9, so the pole is 4 px thick in each 16. His right-hand points are 13 px right of that x, so running right he catches World 1-1's pole (block column 198, x 3168 to 3183) with his x at 3158 to 3161. smb1/flagpole-catch

Value: nybble 6, 9 · side 13 · column 198 · catch 3158, 3161

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11371-L11384HandleClimbing: LDY $04 ; check low nybble of horizontal coordinate returned from CPY #$06 ; collision detection routine against certain values, this BCC ExHC ; makes actual physical part of vine or flagpole thinner CPY #$0a ; than 16 pixels BCC ChkForFlagpole … CMP #$24 ; check climbing metatiles BEQ FlagpoleCollision ; branch if flagpole ball found CMP #$25smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12354-L12358RetXC: LDA SprObject_X_Position,x ; otherwise load horizontal coordinate RetYC: AND #%00001111 ; and mask out high nybble STA $04 ; store masked out result heresmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12298-L12308BlockBuffer_X_Adder: … BlockBuffer_Y_Adder:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11242-L11281JSR CheckForClimbMTiles ; do sub to see if player bumped into anything climbable BCC CheckSideMTiles ; if not, branch to alternate section of code … JSR BlockBufferColli_Side ; do player-to-bg collision detection on other half of player BNE CheckSideMTiles ; if something found, branch … JSR CheckForClimbMTiles ; check for climbable metatiles BCC ContSChk ; if not found, skip and continue with code JMP HandleClimbing ; otherwise jump to handle climbingsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11235-L11244DoPlayerSideCheck: LDY $eb ; get block buffer adder offset INY INY ; increment offset 2 bytes to use adders for side collisions LDA #$02 ; set value here to be used as counter STA $00 SideCheckLoop: INY ; move onto the next one STY $eb ; store itsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12295-L12296BlockBufferAdderData:Super Mario Bros. (World) · 0x63c0-0x63c7 — BlockBuffer_X_AdderSuper Mario Bros. (World) · 0x63dc-0x63e3 — BlockBuffer_Y_AdderSuper Mario Bros. (World) · 0x63bd-0x63bf — BlockBufferAdderDataChecked by claude, 2026-10-26 — read HandleClimbing (L11371-L11384), BlockBufferCollision's return (L12320-L12358: the metatile at x plus the adder, but $04 from RetXC is the object's own x), the adder tables and DoPlayerSideCheck's start ($eb, from BlockBufferAdderData's $00 for big Mario, plus 2, then 1 per point: big Mario's side entries 3-6 are x+2 and x+13 at y+8 and y+24), and DoPlayerSideCheck through CheckSideMTiles (L11235-L11281). The window is x 3152 + 6 to 3152 + 9 with x + 13 in column 198. The probe's race case catches on frame 1270 with x 3159 (3157 the frame before)Revised after a check by a second AI model, 2026-10-27.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-stages.mjs

In other builds: Europe, Japan Disk System (same code, other addresses).

BlockBufferCollision returns the low nybble of the object's own x for a side check, though it looks up the metatile at x plus the point's offset. Each side has two points, 8 and 24 px below Mario's y (entries 3 to 6 of the adder tables for big Mario); a climbable metatile at the upper one moves on to the lower one, so only the lower point reaches HandleClimbing. Standing on the floor, that point is in the pole's base block, which stops him like a wall, so he catches the pole from the air. The probe's race case runs a route through World 1-1: the game catches on the first frame his x is in the window.

World 1-1's enemy list holds 16 Goombas and one Green Koopa Troopa. Four Goombas stand alone, at columns 22 and 40 on the floor (row 11) and 80 and 82 on the high bricks (row 3), and the Koopa is at column 107 on the floor. The other 12 come in six pairs, keyed to columns 54, 100, 117, 127, 131, and 177, which appear at the screen's right edge on the floor. On one run through the level with the star held, measured in Mesen, 16 of the 17 appeared: the pair at column 131 got one Goomba, because only one of the five enemy slots was free. smb1/world-1-1-enemies

About: Super Mario Bros. Enemy spawning

Value
{
 "singles": [
  {
   "kind": "goomba",
   "column": 22,
   "row": 11
  },
  {
   "kind": "goomba",
   "column": 40,
   "row": 11
  },
  {
   "kind": "goomba",
   "column": 80,
   "row": 3
  },
  {
   "kind": "goomba",
   "column": 82,
   "row": 3
  },
  {
   "kind": "green-koopa",
   "column": 107,
   "row": 11
  }
 ],
 "groups": [
  {
   "kind": "goomba",
   "column": 54,
   "row": 11,
   "count": 2
  },
  {
   "kind": "goomba",
   "column": 100,
   "row": 11,
   "count": 2
  },
  {
   "kind": "goomba",
   "column": 117,
   "row": 11,
   "count": 2
  },
  {
   "kind": "goomba",
   "column": 127,
   "row": 11,
   "count": 2
  },
  {
   "kind": "goomba",
   "column": 131,
   "row": 11,
   "count": 2
  },
  {
   "kind": "goomba",
   "column": 177,
   "row": 11,
   "count": 2
  }
 ],
 "raceSpawned": 16
}
Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/levels/enemies.asm#L89-L94; level 1-1 E_GroundArea6:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7770-L7774HandleGroupEnemies: LDY #$00 ; load value for green koopa troopa SEC SBC #$37 ; subtract $37 from second byte read PHA ; save result in stack for nowSuper Mario Bros. (World) · 0x1f11-0x1f2e — E_GroundArea6Checked by claude, 2026-10-28 — decoded E_GroundArea6 by hand (two bytes an enemy: column and row, then a page flag and the id; $0f is a page control and $1e $c2 $00 the area pointer). The second bytes $b7 and $37 are group $37, two Goombas on the floor, with and without the page flag. The probe's race spawned each single at its column's x and each pair at the screen's right edge, in this order, and 16 enemies in allRevised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.Probe: probes/super-mario-bros/enemies-1-1.mjs

In other builds: Europe, Japan Disk System (moved).

Columns and rows are those of smb1/world-1-1's map: 16 px columns from the level's left edge, rows from the top of the play area, with row 11 the floor. An enemy's row is the one it stands on, so the Goombas at 80 and 82 start on the high bricks (four rows above the low ones, eight above the floor). Which pair loses a Goomba depends on how many enemies are still on screen, including knocked-out ones still falling: in the probe's run the star knocked out each enemy Mario touched, and they kept their slots while they fell.

An enemy in Super Mario Bros.'s level data appears once the screen's right edge plus 48 px, rounded down to a 16 px column, reaches the enemy's column. A single enemy appears at its column's left edge, its y 8 px below its row's (row × 16 + 8) for an enemy id below $15, the Goomba's and the Koopa Troopa's among them, and a group appears at the screen's right edge, each member 24 px to the right of the last. Each one takes a free slot of the five, and a group member that finds none is dropped, not delayed (measured in Mesen). smb1/enemy-spawn

About: Super Mario Bros. Enemy spawning

Value: lead 48 · grid 16 · group spacing 24 · slots 5 · row Y 8

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6878-L6885CheckRightBounds: LDA ScreenRight_X_Pos ; add 48 to pixel coordinate of right boundary CLC ADC #$30 AND #%11110000 ; store high nybble STA $07 LDA ScreenRight_PageLoc ; add carry to page location of right boundary ADC #$00smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6930-L6943CheckRightExtBounds: LDA $07 ; check right boundary + 48 against CMP Enemy_X_Position,x ; column position without subtracting, LDA $06 ; then subtract borrow from page control temp SBC Enemy_PageLoc,x ; plus carry BCC CheckFrenzyBuffer ; if enemy object beyond extended boundary, branch LDA #$01 ; store value in vertical high byte STA Enemy_Y_HighPos,x LDA (EnemyData),y ; get first byte again ASL ; multiply by four to get the vertical ASL ; coordinate ASL …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7803-L7831GrLoop: LDX #$ff ; start at beginning of enemy buffers GSltLp: INX ; increment and branch if past CPX #$05 ; end of buffers BCS NextED LDA Enemy_Flag,x ; check to see if enemy is already BNE GSltLp ; stored in buffer, and branch if so LDA $01 STA Enemy_ID,x ; store enemy object identifier LDA $02 STA Enemy_PageLoc,x ; store page location for enemy object …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6858-L6875ProcessEnemyData: LDY EnemyDataOffset ; get offset of enemy object data LDA (EnemyData),y ; load first byte CMP #$ff ; check for EOD terminator BNE CheckEndofBuffer JMP CheckFrenzyBuffer ; if found, jump to check frenzy buffer, otherwise CheckEndofBuffer: AND #%00001111 ; check for special row $0e CMP #$0e BEQ CheckRightBounds ; if found, branch, otherwise CPX #$05 ; check for end of buffer BCC CheckRightBounds ; if not at end of buffer, branch …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7033-L7040CheckpointEnemyID: LDA Enemy_ID,x CMP #$15 ; check enemy object identifier for $15 or greater BCS InitEnemyRoutines ; and branch straight to the jump engine if found TAY ; save identifier in Y register for now LDA Enemy_Y_Position,x ADC #$08 ; add eight pixels to what will eventually be the STA Enemy_Y_Position,x ; enemy object's vertical coordinate ($00-$14 only)World 1-1's enemy list holds 16 Goombas and one Green Koopa Troopa. Four Goombas stand alone, at columns 22 and 40 on the floor (row 11) and 80 and 82 on the high bricks (row 3), and the Koopa is at column 107 on the floor. The other 12 come in six pairs, keyed to columns 54, 100, 117, 127, 131, and 177, which appear at the screen's right edge on the floor. On one run through the level with the star held, measured in Mesen, 16 of the 17 appeared: the pair at column 131 got one Goomba, because only one of the five enemy slots was free. VerifiedChecked by claude, 2026-10-28 — read CheckRightBounds (ScreenRight_X_Pos + $30, high nybble) and CheckRightExtBounds, and HandleGroupEnemies' loop, which places each member at ScreenRight_X_Pos plus $18 per member into the first slot with Enemy_Flag clear and gives up on the group when none is. In the probe's race each enemy appeared on the frame the rounded edge crossed its column, and each group's second member was 23 or 24 px right of the first at the end of that frame (it has taken its first step). CheckpointEnemyID adds 8 to the y of every enemy below id $15Checked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-10-28.Probe: probes/super-mario-bros/enemies-1-1.mjs

In other builds: Europe, Japan Disk System (same code, other addresses).

The loader runs once a frame for each empty slot, and not while the area parser is at its seventh task, so an enemy can come a frame late: in the probe's race, the pair at column 131 did. A Goomba's first frame sets it on the ground, so on the floor its y reads 184 (row 11 × 16 + 8) from the frame it appears.

Super Mario Bros.' screen scrolls only to the right, by as many px as Mario moved right this frame, once his x on screen (his x less the screen's left edge, as of when he was last drawn) is 80 px or more; below 112 px a move of 2 px or more scrolls 1 px less. A scroll lock or a recent bump into a wall's side stops it, and a moving platform's push counts as his movement. While a springboard is animating, Mario doesn't move and its animation counter counts as his movement instead. smb1/scroll-rule

About: Super Mario Bros. Scrolling

Value: from 80 · full 112 · slow from 2 · slow by 1 (px)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4165-L4215ScrollHandler: LDA Player_X_Scroll ; load value saved here CLC ADC Platform_X_Scroll ; add value used by left/right platforms STA Player_X_Scroll ; save as new value here to impose force on scroll LDA ScrollLock ; check scroll lock flag BNE InitScrlAmt ; skip a bunch of code here if set LDA Player_Pos_ForScroll CMP #$50 ; check player's horizontal screen position BCC InitScrlAmt ; if less than 80 pixels to the right, branch LDA SideCollisionTimer ; if timer related to player's side collision BNE InitScrlAmt ; not expired, branch …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4740-L4743GndMove: JSR ImposeFriction ; do a sub to impose friction on player's walk/run JSR MovePlayerHorizontally ; do another sub to move player horizontally STA Player_X_Scroll ; set returned value as player's movement speed for scrollsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L13892-L13895RenderPlayerSub: STA $07 ; store number of rows of sprites to draw LDA Player_Rel_XPos STA Player_Pos_ForScroll ; store player's relative horizontal positionsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4788-L4789JSR MovePlayerHorizontally ; do a sub to move player horizontally STA Player_X_Scroll ; set player's speed here, to be used for scroll latersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6487-L6533MovePlayerHorizontally: LDA JumpspringAnimCtrl ; if jumpspring currently animating, BNE ExXMove ; branch to leave … MoveObjectHorizontally: … LDA SprObject_X_Speed,x ; get saved value again LSR ; move high nybble to low LSR LSR LSR CMP #$08 ; if < 8, branch, do not change …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L14100-L14155RelativePlayerPosition: LDX #$00 ; set offsets for relative cooordinates LDY #$00 ; routine to correspond to player object JMP RelWOfs ; get the coordinates … RelWOfs: JSR GetObjRelativePosition ; get the coordinates … GetObjRelativePosition: … LDA SprObject_X_Position,x ; load horizontal coordinate SEC ; subtract left edge coordinate …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/ram.asm#L311-L312SprObject_Rel_XPos = $03ad Player_Rel_XPos = $03adChecked by claude, 2026-10-28 — read ScrollHandler at the pinned commit, with where its two inputs are set: Player_X_Scroll from MovePlayerHorizontally's movement, and Player_Pos_ForScroll from Player_Rel_XPos as the player is drawn; the ground path (GndMove) stores the movement too, MovePlayerHorizontally returns the whole px it added to his x, and Player_Rel_XPos is his x less ScreenLeft_X_Pos (GetObjRelativePosition); while JumpspringAnimCtrl is nonzero, MovePlayerHorizontally returns it without moving him, and ram.asm gives Player_Rel_XPos and SprObject_Rel_XPos one address ($03AD)Revised after a check by a second AI model, 2026-10-28.

In other builds: Europe (same code, other addresses); Japan Disk System (changed, 247 of 282 bytes the same).

The scroll never goes left: a move of 0 or less leaves it. Where ScrollLock is set, and how long SideCollisionTimer runs, aren't read here.

An enemy whose column is already left of the screen's right edge when the level data reaches it is skipped and never appears. With the game's hard-mode flag set, groups of Goombas come as Buzzy Beetles. smb1/enemy-spawn-skip

About: Super Mario Bros. Enemy spawning

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6914-L6928PositionEnemyObj: LDA EnemyObjectPageLoc ; store page control as page location STA Enemy_PageLoc,x ; for enemy object LDA (EnemyData),y ; get first byte of enemy object AND #%11110000 STA Enemy_X_Position,x ; store column position CMP ScreenRight_X_Pos ; check column position against right boundary LDA Enemy_PageLoc,x ; without subtracting, then subtract borrow SBC ScreenRight_PageLoc ; from page location BCS CheckRightExtBounds ; if enemy object beyond or at boundary, branch LDA (EnemyData),y AND #%00001111 ; check for special row $0e …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7017-L7031CheckThreeBytes: LDY EnemyDataOffset ; load current offset for enemy object data LDA (EnemyData),y ; get first byte AND #%00001111 ; check for special row $0e CMP #$0e BNE Inc2B Inc3B: INC EnemyDataOffset ; if row = $0e, increment three bytes Inc2B: INC EnemyDataOffset ; otherwise increment two bytes INC EnemyDataOffset LDA #$00 ; init page select for enemy objects …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7776-L7781BCS SnglID ; if so, branch PHA ; save another copy to stack LDY #Goomba ; load value for goomba enemy LDA PrimaryHardMode ; if primary hard mode flag not set, BEQ PullID ; branch, otherwise change to value LDY #BuzzyBeetle ; for buzzy beetleChecked by claude, 2026-10-28 — read PositionEnemyObj: an enemy's column below ScreenRight_X_Pos (with its page) branches to CheckThreeBytes, which steps past the entry without placing it; and HandleGroupEnemies, which loads BuzzyBeetle for the Goomba groups when PrimaryHardMode is setRevised after a check by a second AI model, 2026-10-28.

In other builds: Europe, Japan Disk System (same code, other addresses).

A Goomba starts walking left at 0.5 px a frame (1 px every second frame), and turns around at the same speed when it walks into a pipe or into another Goomba; two Goombas that meet both turn on the same frame. Walking off a ledge, it keeps its x speed and falls, its y speed growing by 61/256 px a frame every frame until its whole part reaches 3 px a frame (measured in Mesen). smb1/goomba-walk

About: Super Mario Bros. Enemy AI

Value: speed 0.5 · direction left · fall accel 61 · max fall speed 3 · drop rows 4 (px/frame)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7141-L7152NormalXSpdData: … InitNormalEnemy: LDY #$01 ; load offset of 1 by default LDA PrimaryHardMode ; check for primary hard mode flag set BNE GetESpd DEY ; if not set, decrement offset GetESpd: LDA NormalXSpdData,y ; get appropriate horizontal speed SetESpd: STA Enemy_X_Speed,x ; store as speed for enemy objectsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6554-L6563MoveD_EnemyVertically: LDY #$3d ; set quick movement amount downwards LDA Enemy_State,x ; then check enemy state CMP #$05 ; if not set to unique state for spiny's egg, go ahead BNE ContVMove ; and use, otherwise set different movement amount, continue on MoveFallingPlatform: LDY #$20 ; set movement amount ContVMove: JMP SetHiMax ; jump to skip the rest of thissmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10872-L10896EnemyTurnAround: LDA Enemy_ID,x ; check for specific enemies CMP #PiranhaPlant BEQ ExTA ; if piranha plant, leave CMP #Lakitu BEQ ExTA ; if lakitu, leave CMP #HammerBro BEQ ExTA ; if hammer bro, leave CMP #Spiny BEQ RXSpd ; if spiny, turn it around CMP #GreenParatroopaJump BEQ RXSpd ; if green paratroopa, turn it around …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11845-L11868DoEnemySideCheck: LDA Enemy_Y_Position,x ; if enemy within status bar, branch to leave CMP #$20 ; because there's nothing there that impedes movement BCC ExESdeC LDY #$16 ; start by finding block to the left of enemy ($00,$14) LDA #$02 ; set value here in what is also used as STA $eb ; OAM data offset SdeCLoop: LDA $eb ; check value CMP Enemy_MovingDir,x ; compare value against moving direction BNE NextSdeC ; branch if different and do not seek block there LDA #$01 ; set flag in A for save horizontal coordinate …Super Mario Bros. (World) · 0x431c-0x431d — NormalXSpdDataChecked by claude, 2026-10-28 — read InitNormalEnemy (speed $f8, in 1/16 px a frame), MoveD_EnemyVertically (downward force $3d, maximum 3), EnemyTurnAround (negates the speed and flips the moving direction), and DoEnemySideCheck (a solid block ahead turns the enemy). In the probe the first Goomba moved 50 px in 100 frames; the first pair turned at the third pipe (x 767 going left: one pixel into its last column) and the fourth (x 896 going right: its right edge at the pipe's left edge), and on each other; the Goomba on the high bricks fell four rows to the low ones, each frame's step 61/256 px longer than the last until the cap, still walkingChecked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.Probe: probes/super-mario-bros/enemies-1-1.mjs

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 98 of 107 bytes the same).

The fall's y speed is stored as a whole part and a fraction; the cap holds the whole part at 3, and the fraction keeps adding, so a long fall covers 3 to 3.5 px a frame. The Goomba at column 40 appears touching the second pipe and turns right two frames later.

Enemies test for touching each other only on odd frames and never in water levels. A touch turns both around for any enemy with an id below 7 but the Hammer Bro (Goombas, Koopa Troopas, and Buzzy Beetles), and for Spinies and jumping Green Paratroopas. If one of them is in a state from 6 up, as a kicked shell is, the other is knocked out instead, and an enemy already knocked out touches nothing. With the game's hard-mode flag set, a Goomba walks at 0.75 px a frame. smb1/goomba-turn-rules

About: Super Mario Bros. Enemy AI

Value: hard speed 0.75 (px/frame)

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10740-L10746EnemiesCollision: LDA FrameCounter ; check counter for d0 set LSR BCC ExSFN ; if d0 not set, leave LDA AreaType BEQ ExSFN ; if water area type, leave LDA Enemy_ID,xsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10813-L10870ProcEnemyCollisions: LDA Enemy_State,y ; check both enemy states for d5 set ORA Enemy_State,x AND #%00100000 ; if d5 is set in either state, or both, branch BNE ExitProcessEColl ; to leave and do nothing else at this point LDA Enemy_State,x CMP #$06 ; if second enemy state < $06, branch elsewhere BCC ProcSecondEnemyColl LDA Enemy_ID,x ; check second enemy identifier for hammer bro CMP #HammerBro ; if hammer bro found in alt state, branch to leave BEQ ExitProcessEColl LDA Enemy_State,y ; check first enemy state for d7 set …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10872-L10885EnemyTurnAround: LDA Enemy_ID,x ; check for specific enemies CMP #PiranhaPlant BEQ ExTA ; if piranha plant, leave CMP #Lakitu BEQ ExTA ; if lakitu, leave CMP #HammerBro BEQ ExTA ; if hammer bro, leave CMP #Spiny BEQ RXSpd ; if spiny, turn it around CMP #GreenParatroopaJump BEQ RXSpd ; if green paratroopa, turn it around …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7141-L7150NormalXSpdData: … InitNormalEnemy: LDY #$01 ; load offset of 1 by default LDA PrimaryHardMode ; check for primary hard mode flag set BNE GetESpd DEY ; if not set, decrement offset GetESpd: LDA NormalXSpdData,y ; get appropriate horizontal speedSuper Mario Bros. (World) · 0x431c-0x431d — NormalXSpdDataChecked by claude, 2026-10-28 — read EnemiesCollision (FrameCounter d0, AreaType 0 is water), ProcEnemyCollisions (d5, the defeated bit, in either state leaves; a state of $06 and up kills the other through ShellOrBlockDefeat; otherwise MoveEOfs turns both), EnemyTurnAround's id tests, and NormalXSpdData ($f4 with PrimaryHardMode)Revised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 147 of 155 bytes the same).

A Goomba dies when Mario touches it while moving down: it is flattened, Mario bounces up with a y speed of −4, and, with the game's hard-mode flag clear, the flat Goomba is erased two ticks of the 21-frame interval timer later, 22 to 42 frames. A fireball, a kicked shell running into it, Mario touching it while the star is on, or a block bumped under it knock it out instead: it takes the defeated state and falls off the screen. Any other touch hurts Mario, unless the stomp timer is running, which makes it a stomp, or his injury timer is, which makes it nothing. smb1/goomba-defeat

About: Super Mario Bros. Enemy AI

Value: bounce speed -4 · flat ticks 2 · frames per tick 21 · min frames 22 · max frames 42

Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10555-L10576ChkForPlayerInjury: LDA Player_Y_Speed ; check player's vertical speed BMI ChkInj ; perform procedure below if player moving upwards BNE EnemyStomped ; or not at all, and branch elsewhere if moving downwards ChkInj: LDA Enemy_ID,x ; branch if enemy object < $07 CMP #Bloober BCC ChkETmrs LDA Player_Y_Position ; add 12 pixels to player's vertical position CLC ADC #$0c CMP Enemy_Y_Position,x ; compare modified player's position to enemy's position …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10680-L10697RevivalRateData: … HandleStompedShellE: LDA #$04 ; set defeated state for enemy STA Enemy_State,x INC StompChainCounter ; increment the stomp counter LDA StompChainCounter ; add whatever is in the stomp counter CLC ; to whatever is in the stomp timer ADC StompTimer JSR SetupFloateyNumber ; award points accordingly INC StompTimer ; increment stomp timer of some sort LDY PrimaryHardMode ; check primary hard mode flag …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L8408-L8416ChkKillGoomba: CMP #$0e ; check to see if enemy timer has reached BNE NKGmba ; a certain point, and branch to leave if not LDA Enemy_ID,x CMP #Goomba ; check for goomba object BNE NKGmba ; branch if not found JSR EraseEnemyObject ; otherwise, kill this goomba object NKGmba: RTS ; leave!smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10497-L10500EColl: LDA StarInvincibleTimer ; if star mario invincibility timer expired, BEQ HandlePECollisions ; perform task here, otherwise kill enemy like JMP ShellOrBlockDefeat ; hit with a shell, or from beneathsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10292-L10309HandleEnemyFBallCol: JSR RelativeEnemyPosition ; get relative coordinate of enemy LDX $01 ; get current enemy object offset LDA Enemy_Flag,x ; check buffer flag for d7 set BPL ChkBuzzyBeetle ; branch if not set to continue AND #%00001111 ; otherwise mask out high nybble and TAX ; use low nybble as enemy offset LDA Enemy_ID,x CMP #Bowser ; check enemy identifier for bowser BEQ HurtBowser ; branch if found LDX $01 ; otherwise retrieve current enemy offset ChkBuzzyBeetle: …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10334-L10354ChkOtherEnemies: CMP #BulletBill_FrenzyVar BEQ ExHCF ; branch to leave if bullet bill (frenzy variant) CMP #Podoboo BEQ ExHCF ; branch to leave if podoboo CMP #$15 BCS ExHCF ; branch to leave if identifier => $15 ShellOrBlockDefeat: LDA Enemy_ID,x ; check for piranha plant CMP #PiranhaPlant BNE StnE ; branch if not found LDA Enemy_Y_Position,x …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10813-L10846ProcEnemyCollisions: LDA Enemy_State,y ; check both enemy states for d5 set ORA Enemy_State,x AND #%00100000 ; if d5 is set in either state, or both, branch BNE ExitProcessEColl ; to leave and do nothing else at this point LDA Enemy_State,x CMP #$06 ; if second enemy state < $06, branch elsewhere BCC ProcSecondEnemyColl LDA Enemy_ID,x ; check second enemy identifier for hammer bro CMP #HammerBro ; if hammer bro found in alt state, branch to leave BEQ ExitProcessEColl LDA Enemy_State,y ; check first enemy state for d7 set …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11945-L11949KillEnemyAboveBlock: JSR ShellOrBlockDefeat ; do this sub to kill enemy LDA #$fc ; alter vertical speed of enemy and leave STA Enemy_Y_Speed,x RTSA hit on big Mario sets the injury timer to 8, and enemy contact is skipped until it is back at 0. It is one of the interval timers, which the timer routine counts down once every 21 frames, so the window lasts 8 such ticks, 148 to 168 frames while the game's timers run. CodeSuper Mario Bros. (World) · 0x59e2-0x59e3 — RevivalRateDataChecked by claude, 2026-10-28 — read ChkForPlayerInjury (a positive Player_Y_Speed goes to EnemyStomped; a Goomba is below Bloober, so otherwise only StompTimer saves Mario), EnemyStomped through HandleStompedShellE (state 4, EnemyIntervalTimer $10 from RevivalRateData, $0b with PrimaryHardMode, bounce $fc), ChkKillGoomba (erased when the timer reaches $0e), EColl (StarInvincibleTimer goes to ShellOrBlockDefeat, which sets state d5), and KillEnemyAboveBlock (a bumped Goomba gets y speed $fc). The fireball path, HandleEnemyFBallCol, exempts Buzzy Beetles but not Goombas and falls through ChkOtherEnemies to ShellOrBlockDefeat; a kicked shell (state $06 and up) kills the other enemy through ProcEnemyCollisions and ShellCollisions; ChkETmrs sends a touch to EnemyStomped while StompTimer is set and leaves while InjuryTimer isRevised after a check by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.

In other builds: Japan Disk System (same code, other addresses); Europe (changed, 200 of 233 bytes the same).

In the probe's race, every Goomba Mario touched with the star took state $22 and fell off the bottom of the screen, as this reads. The flattened Goomba's timing isn't measured here. With the hard-mode flag set its timer starts at $0b, below the $0e this path erases it at; what happens then isn't followed here.

A Goomba's hit box is 10 px wide and 6 px tall: from 3 to 13 px right of its x and from 14 to 20 px below its y (measured in Mesen). smb1/goomba-hitbox

About: Super Mario Bros. Hitbox

Value: left 3 · right 13 · top 14 · bottom 20 (px)

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7116-L7118InitGoomba: JSR InitNormalEnemy ; set appropriate horizontal speed JMP SmallBBox ; set $09 as bounding box control, set other valuessmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L7189-L7191SmallBBox: LDA #$09 ; set specific bounding box size control BNE SetBBox ; unconditional branchsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12026-L12036BoundBoxCtrlData:Super Mario Bros. (World) · 0x620d-0x6234 — BoundBoxCtrlDataChecked by claude, 2026-10-28 — read InitGoomba (SmallBBox, control $09) and the tenth row of BoundBoxCtrlData ($03, $0e, $0d, $14), which BoundingBoxCore adds to the object's screen position. The probe read each walking Goomba's box from the collision code's buffer against its x on screen and its y, on the frames the first pair walks between the pipes; the most common offset, half the reads, is the valueChecked by a second AI model, 2026-10-28.Checked by a second AI model, 2026-11-18.Probe: probes/super-mario-bros/enemies-1-1.mjs

In other builds: Europe (changed, 41 of 50 bytes the same); Japan Disk System (changed, 44 of 50 bytes the same).

x is the Goomba's left edge in the level, and y reads 184 for a Goomba on the floor (smb1/enemy-spawn), so on the floor its box spans screen y 198 to 204. The box is built during the frame, before or after the Goomba's step, so a third of the probe's reads sit 1 px to one side or the other.

World 1-1 has 13 ? blocks: 11 placed one at a time and a row of two at columns 129 and 130. Three of the single ones hold a power-up: the left ? block in the first brick row (column 21), the ? block in the bricks past the first pit (column 78), and the high ? block at column 109. The other ten, the row's two among them, hold coins. smb1/world-1-1-power-ups

About: Super Mario Bros. Power-up

Value
{
 "blocks": [
  [
   21,
   7
  ],
  [
   78,
   7
  ],
  [
   109,
   3
  ]
 ]
}
Codesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/levels/objects.asm#L185-L195L_GroundArea6:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2837-L2844INY LDA (AreaData),y ; get second byte of area object ASL ; check for page select bit (d7), branch if not set BCC Chk1Row13 LDA AreaObjectPageSel ; check page select BNE Chk1Row13 INC AreaObjectPageSel ; if not already set, set it now INC AreaObjectPageLoc ; and increment page locationsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L3004-L3010LDA (AreaData),y AND #%11110000 ; mask out low nybble and move high to low LSR LSR LSR LSR CMP CurrentColumnPos ; is this where we're at?smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2908-L2916LDA (AreaData),y ; get first byte of level object again CMP #$fd BEQ EndAParse ; if end of level, leave this routine AND #$0f ; otherwise, mask out low nybble CMP #$0f ; row 15? BEQ ChkRow14 ; if so, keep the offset of 16 LDX #$08 ; otherwise load offset of 8 for special row 12 CMP #$0c ; row 12? BEQ ChkRow14 ; if so, keep the offset value of 8smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2944-L2954ChkSRows: CMP #$0c ; row 12-15? BCS SpecObj INY ; if not, get second byte of level object LDA (AreaData),y AND #%01110000 ; mask out all but d6-d4 BNE LrgObj ; if any bits set, branch to handle large object LDA #$16 STA $07 ; otherwise set offset of 24 for small object LDA (AreaData),y ; reload second byte of level object AND #%00001111 ; mask out higher nybble and jumpsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2968-L2971SpecObj: INY ; branch here for rows 12-15 LDA (AreaData),y AND #%01110000 ; get next byte and mask out all but d6-d4smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L3022-L3052; large objects (rows $00-$0b or 00-11, d6-d4 set) .dw VerticalPipe ; used by warp pipes .dw AreaStyleObject .dw RowOfBricks .dw RowOfSolidBlocks .dw RowOfCoins .dw ColumnOfBricks .dw ColumnOfSolidBlocks .dw VerticalPipe ; used by decoration pipes ; objects for special row $0c or 12 .dw Hole_Empty .dw PulleyRopeObject …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L3497-L3508QuestionBlockRow_High: LDA #$03 ; start on the fourth row .db $2c ; BIT instruction opcode QuestionBlockRow_Low: LDA #$07 ; start on the eighth row PHA ; save whatever row to the stack for now JSR ChkLrgObjLength ; get low nybble and save as length PLA TAX ; render question boxes with coins LDA #$c0 STA MetatileBuffer,xsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L3870-L3893ChkLrgObjLength: JSR GetLrgObjAttrib ; get row location and size (length if branched to from here) ChkLrgObjFixedLength: LDA AreaObjectLength,x ; check for set length counter CLC ; clear carry flag for not just starting BPL LenSet ; if counter not set, load it, otherwise leave alone TYA ; save length into length counter STA AreaObjectLength,x SEC ; set carry flag if just starting LenSet: RTS GetLrgObjAttrib: …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2977-L2980NormObj: STA $00 ; store value here (branch for small objects and rows 13 and 14) LDA AreaObjectLength,x ; is there something stored here already? BPL RunAObj ; if so, branch to do its particular subsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2880-L2884ChkLength: LDX ObjectOffset ; get buffer offset LDA AreaObjectLength,x ; check object length for anything stored here BMI ProcLoopb ; if not, branch to handle loopback DEC AreaObjectLength,x ; otherwise decrement length or get rid of itSuper Mario Bros. (World) · 0x269e-0x26f9 — L_GroundArea6Checked by claude, 2026-10-29 — decoded L_GroundArea6 by hand at the pinned commit, through column 170: each object is two bytes, the column in the first's high nybble (BackColC) and the row in its low one, a set d7 in the second moving on a page; in rows 0-11 a second byte with d6-d4 clear is a small object whose low nybble picks its entry ($16 on, past the 8 large objects, 8 row-12 and 6 row-15 ones), and in rows 12-15 d6-d4 pick the entry. $57,$00 (column 21, row 7, page 1), $e7,$00 (column 78, row 7, page 4) and $d3,$00 (column 109, row 3, page 6) are small type 0, QuestionBlock (power-up); $07,$81 (16), $63,$01 (22, row 3), $77,$01 (23), $e3,$01 (94, row 3), $a7,$01 (106), $d7,$01 (109), $07,$81 (112) and $a7,$01 (170) are type 1 (coin); and $1c,$61 (column 129, row 12, type 6) is QuestionBlockRow_High, two ? blocks with coins ($c0) on row 3: GetLrgObjAttrib reads the length 1 from the second byte's low nybble, ChkLrgObjLength stores it as the object's counter on its first column, the parser runs the object again on each column while the counter isn't negative and decrements it after each, so length N covers N + 1 columns. The row-12 entries $5c,$01, $6c,$02 and $9c,$01 are the pits. The 13 match smb1/world-1-1's count from the block bufferRevised after a check by a second AI model, 2026-10-29.Checked by a second AI model, 2026-11-18.

In other builds: Europe (changed, 267 of 274 bytes the same); Japan Disk System (changed, 222 of 274 bytes the same).

Columns are 16 px from the level's left edge, rows from the top of the play area. The movement lab's world-1-1 stage marks these three blocks item: power-up.

A ? block's power-up is a mushroom when Mario is small and a fire flower when he's big. It appears 8 px above the block's top, behind the background, on the frame he bumps it, and rises a pixel on every frame whose frame counter is a multiple of 4: 17 px over 17 such frames. On the last it starts moving right at 1 px a frame and comes in front of the background. Until it has risen 5 px it isn't drawn and can't be touched. smb1/power-up-emerge

About: Super Mario Bros. Power-up

Value: below 8 · every 4 · until 17 · shown from 6 · speed 16

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6281-L6290MushFlowerBlock: LDA #$00 ; load mushroom/fire flower into power-up type .db $2c ; BIT instruction opcode StarBlock: LDA #$02 ; load star into power-up type .db $2c ; BIT instruction opcode ExtraLifeMushBlock: LDA #$03 ; load 1-up mushroom into power-up typesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6050-L6085SetupPowerUp: … LDA Block_X_Position,x ; store horizontal coordinate of block object STA Enemy_X_Position+5 ; as horizontal coordinate of power-up object LDA #$01 STA Enemy_Y_HighPos+5 ; set vertical high byte of power-up object LDA Block_Y_Position,x ; get vertical coordinate of block object SEC SBC #$08 ; subtract 8 pixels STA Enemy_Y_Position+5 ; and use as vertical coordinate of power-up object … LDA #$01 ; this is a residual jump point in enemy object jump table …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6110-L6136GrowThePowerUp: LDA FrameCounter ; get frame counter AND #$03 ; mask out all but 2 LSB BNE ChkPUSte ; if any bits set here, branch DEC Enemy_Y_Position+5 ; otherwise decrement vertical coordinate slowly LDA Enemy_State+5 ; load power-up object state INC Enemy_State+5 ; increment state for next frame (to make power-up rise) CMP #$11 ; if power-up object state not yet past 16th pixel, BCC ChkPUSte ; branch ahead to last part here LDA #$10 STA Enemy_X_Speed,x ; otherwise set horizontal speed LDA #%10000000 …Checked by claude, 2026-10-29 — read MushFlowerBlock and SetupPowerUp (type 0 becomes PlayerStatus below 2, so 0 small, 1 super; a fiery 2 shifts to 1) and GrowThePowerUp with ChkPUSte at the pinned commit. In the probe, small Mario bumps the column-21 block: the mushroom appears at the block's x and its top less 8 on the bump's frame, rises a pixel on each frame the counter is a multiple of 4, moves off on the 17th, and the model matches it every frameRevised after a check by a second AI model, 2026-10-29.Probe: probes/lab/smb1-mushroom.mjs

In other builds: Europe, Japan Disk System (same code, other addresses).

The state starts at 1 and counts up on each rising frame; the rise ends on the frame the old state is 17 ($11), which sets speed $10 (16/16 px a frame) and state $80. Drawing and the touch test run from state 6. The rise's frames follow the frame counter, so the first comes 0 to 3 frames after the bump.

Once out, a mushroom moves as a walking enemy does: 1 px a frame, turned around by a solid block at its side, falling off an edge with gravity of 61/256 px a frame per frame up to 3 px a frame, and landing on a block its foot (8 px across, 24 down) finds when its y is 8 to 12 px into a tile row. A fire flower stays where it rose. smb1/power-up-motion

About: Super Mario Bros. Power-up

Value
{
 "gravity": 61,
 "maxSpeed": 3,
 "foot": [
  8,
  24
 ],
 "land": [
  8,
  12
 ],
 "sides": [
  [
   0,
   20
  ],
  [
   16,
   20
  ]
 ],
 "checks": [
  6,
  193
 ]
}
Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6091-L6104BEQ ExitPUp ; if not set, branch to leave ASL ; shift to check if d7 was set in object state BCC GrowThePowerUp ; if not set, branch ahead to skip this part LDA TimerControl ; if master timer control set, BNE RunPUSubs ; branch ahead to enemy object routines LDA PowerUpType ; check power-up type BEQ ShroomM ; if normal mushroom, branch ahead to move it CMP #$03 BEQ ShroomM ; if 1-up mushroom, branch ahead to move it CMP #$02 BNE RunPUSubs ; if not star, branch elsewhere to skip movement JSR MoveJumpingEnemy ; otherwise impose gravity on star power-up and make it jump …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L8335-L8340MoveNormalEnemy: LDY #$00 ; init Y to leave horizontal movement as-is LDA Enemy_State,x AND #%01000000 ; check enemy state for d6 set, if set skip BNE FallE ; to move enemy vertically, then horizontally if necessary LDA Enemy_State,xsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6554-L6563MoveD_EnemyVertically: LDY #$3d ; set quick movement amount downwards LDA Enemy_State,x ; then check enemy state CMP #$05 ; if not set to unique state for spiny's egg, go ahead BNE ContVMove ; and use, otherwise set different movement amount, continue on MoveFallingPlatform: LDY #$20 ; set movement amount ContVMove: JMP SetHiMax ; jump to skip the rest of thissmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6599-L6606MoveJ_EnemyVertically: LDY #$1c ; set movement amount for podoboo/other objects SetHiMax: LDA #$03 ; set maximum speed in A SetXMoveAmt: STY $00 ; set movement amount here INX ; increment X for enemy offset JSR ImposeGravitySprObj ; do a sub to move enemy object downwardssmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6625-L6628ImposeGravitySprObj: STA $02 ; set maximum speed here LDA #$00 ; set value to move downwards JMP ImposeGravity ; jump to the code that actually moves itsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6681-L6694LDA SprObject_Y_MoveForce,x CLC ADC $00 ; add downward movement amount to contents of $0433 STA SprObject_Y_MoveForce,x LDA SprObject_Y_Speed,x ; add carry to vertical speed and store ADC #$00 STA SprObject_Y_Speed,x CMP $02 ; compare to maximum speed BMI ChkUpM ; if less than preset value, skip this part LDA SprObject_Y_MoveForce,x CMP #$80 ; if less positively than preset maximum, skip this part BCC ChkUpM …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11636-L11641EnemyToBGCollisionDet: LDA Enemy_State,x ; check enemy state for d6 set AND #%00100000 BNE ExEBG ; if set, branch to leave JSR SubtEnemyYPos ; otherwise, do a subroutine here BCC ExEBG ; if enemy vertical coord + 62 < 68, branch to leavesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11658-L11669CPY #Spiny ; if enemy object is spiny, branch BEQ YesIn CPY #PowerUpObject ; if special power-up object, branch BEQ YesIn CPY #$07 ; if enemy object =>$07, branch to leave BCS ExEBGChk YesIn: JSR ChkUnderEnemy ; if enemy object < $07, or = $12 or $2e, do this sub BNE HandleEToBGCollision ; if block underneath enemy, branch NoEToBGCollision: JMP ChkForRedKoopa ; otherwise skip and do something elsesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11966-L11969ChkUnderEnemy: LDA #$00 ; set flag in A for save vertical coordinate LDY #$15 ; set Y to check the bottom middle (8,18) of enemy object JMP BlockBufferChk_Enemy ; hop to it!smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12298-L12308BlockBuffer_X_Adder: … BlockBuffer_Y_Adder:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11674-L11678HandleEToBGCollision: JSR ChkForNonSolids ; if something is underneath enemy, find out what BEQ NoEToBGCollision ; if blank $26, coins, or hidden blocks, jump, enemy falls through CMP #$23 BNE LandEnemyProperly ; check for blank metatile $23 and branch if not foundsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11743-L11756LandEnemyProperly: LDA $04 ; check lower nybble of vertical coordinate saved earlier SEC SBC #$08 ; subtract eight pixels CMP #$05 ; used to determine whether enemy landed from falling BCS ChkForRedKoopa ; branch if lower nybble in range of $0d-$0f before subtract LDA Enemy_State,x AND #%01000000 ; branch if d6 in enemy state is set BNE LandEnemyInitState LDA Enemy_State,x ASL ; branch if d7 in enemy state is not set BCC ChkLandedEnemyState …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11805-L11818LandEnemyInitState: JSR EnemyLanding ; land enemy properly LDA Enemy_State,x AND #%10000000 ; if d7 of enemy state is set, branch BNE NMovShellFallBit LDA #$00 ; otherwise initialize enemy state and leave STA Enemy_State,x ; note this will also turn spiny's egg into spiny RTS NMovShellFallBit: LDA Enemy_State,x ; nullify d6 of enemy state, save other bits AND #%10111111 ; and store, then leave STA Enemy_State,x …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11904-L11916EnemyLanding: JSR InitVStf ; do something here to vertical speed and something else LDA Enemy_Y_Position,x AND #%11110000 ; save high nybble of vertical coordinate, and ORA #%00001000 ; set d3, then store, probably used to set enemy object STA Enemy_Y_Position,x ; neatly on whatever it's landing on RTS SubtEnemyYPos: LDA Enemy_Y_Position,x ; add 62 pixels to enemy object's CLC ; vertical coordinate ADC #$3e CMP #$44 ; compare against a certain rangesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11822-L11839ChkForRedKoopa: LDA Enemy_ID,x ; check for red koopa troopa $03 CMP #RedKoopa BNE Chk2MSBSt ; branch if not found LDA Enemy_State,x BEQ ChkForBump_HammerBroJ ; if enemy found and in normal state, branch Chk2MSBSt: LDA Enemy_State,x ; save enemy state into Y TAY ASL ; check for d7 set BCC GetSteFromD ; branch if not set LDA Enemy_State,x …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11845-L11865DoEnemySideCheck: LDA Enemy_Y_Position,x ; if enemy within status bar, branch to leave CMP #$20 ; because there's nothing there that impedes movement BCC ExESdeC LDY #$16 ; start by finding block to the left of enemy ($00,$14) LDA #$02 ; set value here in what is also used as STA $eb ; OAM data offset SdeCLoop: LDA $eb ; check value CMP Enemy_MovingDir,x ; compare value against moving direction BNE NextSdeC ; branch if different and do not seek block there LDA #$01 ; set flag in A for save horizontal coordinate …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11869-L11881ChkForBump_HammerBroJ: CPX #$05 ; check if we're on the special use slot BEQ NoBump ; and if so, branch ahead and do not play sound LDA Enemy_State,x ; if enemy state d7 not set, branch ASL ; ahead and do not play sound BCC NoBump LDA #Sfx_Bump ; otherwise, play bump sound STA Square1SoundQueue ; sound will never be played if branching from ChkForRedKoopa NoBump: LDA Enemy_ID,x ; check for hammer bro CMP #$05 BNE InvEnemyDir ; branch if not foundsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L11887-L11888InvEnemyDir: JMP RXSpd ; jump to turn the enemy aroundsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10886-L10891RXSpd: LDA Enemy_X_Speed,x ; load horizontal speed EOR #$ff ; get two's compliment for horizontal speed TAY INY STY Enemy_X_Speed,x ; store as new horizontal speedA Goomba starts walking left at 0.5 px a frame (1 px every second frame), and turns around at the same speed when it walks into a pipe or into another Goomba; two Goombas that meet both turn on the same frame. Walking off a ledge, it keeps its x speed and falls, its y speed growing by 61/256 px a frame every frame until its whole part reaches 3 px a frame (measured in Mesen). VerifiedSuper Mario Bros. (World) · 0x63c0-0x63f7 — BlockBuffer_X_Adder, BlockBuffer_Y_AdderChecked by claude, 2026-10-29 — read PowerUpObjHandler's moving part, MoveNormalEnemy, MoveD_EnemyVertically ($3d down, then SetHiMax's maximum 3 and SetXMoveAmt's $00, which ImposeGravity adds to the move force each frame), EnemyToBGCollisionDet (it leaves unless SubtEnemyYPos's y + $3e reaches $44 without wrapping: y 6 to 193; ChkUnderEnemy reads adder $15, 8 across and $18 down), HandleEToBGCollision, LandEnemyProperly, LandEnemyInitState, EnemyLanding, ChkForRedKoopa and Chk2MSBSt (no block under a moving power-up sets d6, falling), and DoEnemySideCheck (adders $16 and $17: 0 or $10 across, $14 down) with ChkForBump_HammerBroJ, which skips the bump sound for slot 5 and turns it through InvEnemyDir and RXSpd, at the pinned commit. In the probe the mushroom drops off the risen block's edge onto the brick row, slides along it, and falls to the floor past its end, the model matching every frameRevised after a check by a second AI model, 2026-10-29.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-mushroom.mjs

In other builds: Europe (changed, 334 of 362 bytes the same); Japan Disk System (changed, 321 of 362 bytes the same).

The foot test reads the block under (x + 8, y + 24); a solid one lands a falling mushroom when y's low nybble is 8 to 12, setting it to 8 and clearing its y speed; otherwise, or with no block there, it falls. The y fraction's carry comes from a separate accumulator (Enemy_YMF_Dummy) that a landing doesn't clear. The tests run only while its y is 6 to 193 on the screen. A wall turns it with no sound: the bump sound is skipped for the power-up's slot.

Mario takes a power-up when its box, 2 to 14 px across its sprite and 9 to 21 down, touches his (edges count), tested only on frames with an even frame counter. Small Mario becomes super and super Mario fiery; either way the game stops for the change and puts him in the on-the-ground state, wherever he is. smb1/power-up-grab

About: Super Mario Bros. Power-up

Value
{
 "every": 2,
 "box": {
  "left": 2,
  "top": 9,
  "right": 14,
  "bottom": 21
 }
}
Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10468-L10485PlayerEnemyCollision: LDA FrameCounter ; check counter for d0 set LSR BCS NoPUp ; if set, branch to leave JSR CheckPlayerVertical ; if player object is completely offscreen or BCS NoPECol ; if down past 224th pixel row, branch to leave LDA EnemyOffscrBitsMasked,x ; if current enemy is offscreen by any amount, BNE NoPECol ; go ahead and branch to leave LDA GameEngineSubroutine CMP #$08 ; if not set to run player control routine BNE NoPECol ; on next frame, branch to leave LDA Enemy_State,x …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10492-L10496CheckForPUpCollision: LDY Enemy_ID,x CPY #PowerUpObject ; check for power-up object BNE EColl ; if not found, branch to next part JMP HandlePowerUpCollision ; otherwise, unconditional jump backwardssmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10411-L10414HandlePowerUpCollision: JSR EraseEnemyObject ; erase the power-up object LDA #$06 JSR SetupFloateyNumber ; award 1000 points to player by defaultsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L6067-L6068LDA #$03 STA Enemy_BoundBoxCtrl+5 ; set bounding box size control for power-up objectsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12126-L12147LDA SprObj_BoundBoxCtrl,x ; load value here to be used as offset for X ASL ; multiply that by four and use as X ASL TAX LDA $01 ; add the first number in the bounding box data to the CLC ; relative horizontal coordinate using enemy object offset ADC BoundBoxCtrlData,x ; and store somewhere using same offset * 4 STA BoundingBox_UL_Corner,y ; store here LDA $01 CLC ADC BoundBoxCtrlData+2,x ; add the third number in the bounding box data to the STA BoundingBox_LR_Corner,y ; relative horizontal coordinate and store …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12026-L12030BoundBoxCtrlData:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12205-L12211CollisionCoreLoop: LDA BoundingBox_UL_Corner,y ; compare left/top coordinates CMP BoundingBox_UL_Corner,x ; of first and second objects' bounding boxes BCS FirstBoxGreater ; if first left/top => second, branch CMP BoundingBox_LR_Corner,x ; otherwise compare to right/bottom of second BCC SecondBoxVerticalChk ; if first left/top < second right/bottom, branch elsewhere BEQ CollisionFound ; if somehow equal, collision, thus branchsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L12220-L12235SecondBoxVerticalChk: LDA BoundingBox_LR_Corner,x ; check to see if the vertical bottom of the box CMP BoundingBox_UL_Corner,x ; is greater than the vertical top BCC CollisionFound ; if somehow less, vertical wrap collision, thus branch LDA BoundingBox_LR_Corner,y ; otherwise compare horizontal right or vertical bottom CMP BoundingBox_UL_Corner,x ; of first box with horizontal left or vertical top of second box BCS CollisionFound ; if equal or greater, collision, thus branch LDY $06 ; otherwise return with carry clear and Y = $0006 RTS FirstBoxGreater: CMP BoundingBox_UL_Corner,x ; compare first and second box horizontal left/vertical top again BEQ CollisionFound ; if first coordinate = second, collision, thus branch …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10427-L10456Shroom_Flower_PUp: LDA PlayerStatus ; if player status = small, branch BEQ UpToSuper CMP #$01 ; if player status not super, leave BNE NoPUp LDX ObjectOffset ; get enemy offset, not necessary LDA #$02 ; set player status to fiery STA PlayerStatus JSR GetPlayerColors ; run sub to change colors of player LDX ObjectOffset ; get enemy offset again, and again not necessary LDA #$0c ; set value to be used by subroutine tree (fiery) JMP UpToFiery ; jump to set values accordingly …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10599-L10604SetPRout: STA GameEngineSubroutine ; load new value to run subroutine on next frame STY Player_State ; store new player state LDY #$ff STY TimerControl ; set master timer control flag to halt timers INYSuper Mario Bros. (World) · 0x620d-0x621c — BoundBoxCtrlDataChecked by claude, 2026-10-29 — read PlayerEnemyCollision through CheckForPUpCollision's jump to HandlePowerUpCollision, HandlePowerUpCollision through UpToFiery, SetPRout, SetupPowerUp's BoundBoxCtrl 3, BoundingBoxCore (the control times 4 indexes BoundBoxCtrlData: its first and third numbers added to the screen x, its second and fourth to y, so row 4, $02, $09, $0e, $15) and SprObjectCollisionCore, whose compares count equal edges as touching, at the pinned commit. In the probe the boxes first touch on a frame with an odd counter and he takes the mushroom on the next, and the model takes it on the same framesRevised after a check by a second AI model, 2026-10-29.Checked by a second AI model, 2026-11-18.Probe: probes/lab/smb1-mushroom.mjs

In other builds: Europe (changed, 204 of 220 bytes the same); Japan Disk System (changed, 190 of 220 bytes the same).

The boxes are built from the screen positions after this frame's moves: Mario's before his background collision pushes him out, the power-up's after its own. The touch test also needs Mario on the screen's rows (y below 208) and the power-up fully on screen. A fiery Mario takes it for the points alone.

Taking a mushroom stops the game for the next 59 frames: no timer runs and Mario doesn't move, though the frame counter keeps counting. His size changes on the 7th of them, and play resumes on the frame after the 59th. Taking a fire flower stops it for 63 frames. smb1/power-up-growth

About: Super Mario Bros. Power-up

Value: frames 59 · size at 7 · fire frames 63

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L121-L141BCS PauseSkip LDA TimerControl ; if master timer control not set, decrement BEQ DecTimers ; all frame and interval timers DEC TimerControl BNE NoDecTimers DecTimers: LDX #$14 ; load end offset for end of frame timers DEC IntervalTimerControl ; decrement interval timer control, BPL DecTimersLoop ; if not expired, only frame timers will decrement LDA #$14 STA IntervalTimerControl ; if control for interval timers expired, LDX #$23 ; interval timers will decrement along with frame timers …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4548-L4556PlayerChangeSize: LDA TimerControl ; check master timer control CMP #$f8 ; for specific moment in time BNE EndChgSize ; branch if before or after that point JMP InitChangeSize ; otherwise run code to get growing/shrinking going EndChgSize: CMP #$c4 ; check again for another specific moment BNE ExitChgSize ; and branch to leave if before or after that point JSR DonePlayerTask ; otherwise do sub to init timer control and set routinesmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4572-L4580InitChangeSize: LDY PlayerChangeSizeFlag ; if growing/shrinking flag already set BNE ExitBoth ; then branch to leave STY PlayerAnimCtrl ; otherwise initialize player's animation frame control INC PlayerChangeSizeFlag ; set growing/shrinking flag LDA PlayerSize EOR #$01 ; invert player's size STA PlayerSize ExitBoth:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4592-L4604DonePlayerTask: LDA #$00 STA TimerControl ; initialize master timer control to continue timers LDA #$08 STA GameEngineSubroutine ; set player control routine to run next frame RTS ; leave PlayerFireFlower: LDA TimerControl ; check master timer control CMP #$c0 ; for specific moment in time BEQ ResetPalFireFlower ; branch if at moment, not before or after LDA FrameCounter ; get frame countersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4266-L4279GameRoutines: LDA GameEngineSubroutine ; run routine based on number (a few of these routines are JSR JumpEngine ; merely placeholders as conditions for other routines) .dw Entrance_GameTimerSetup .dw Vine_AutoClimb .dw SideExitPipeEntry .dw VerticalPipeEntry .dw FlagpoleSlide .dw PlayerEndLevel .dw PlayerLoseLife .dw PlayerEntrance .dw PlayerCtrlRoutine …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L10599-L10604SetPRout: STA GameEngineSubroutine ; load new value to run subroutine on next frame STY Player_State ; store new player state LDY #$ff STY TimerControl ; set master timer control flag to halt timers INYChecked by claude, 2026-10-29 — read the frame's timer code (a nonzero TimerControl is decremented, and the timers skipped, while FrameCounter still counts), SetPRout (TimerControl $ff, GameEngineSubroutine 9 on the frame he takes it), GameRoutines (9 runs PlayerChangeSize in place of PlayerCtrlRoutine, so he doesn't move), PlayerChangeSize ($f8 starts the change, $c4 ends it), InitChangeSize, DonePlayerTask and PlayerFireFlower ($c0) at the pinned commit. In the probe TimerControl counts down from $ff, PlayerSize flips 7 frames after the grab, GameEngineSubroutine returns to 8 at the end of the 59th frame after, and Mario moves again on the nextRevised after a check by a second AI model, 2026-10-29.Probe: probes/lab/smb1-mushroom.mjs

In other builds: Europe (changed, 128 of 129 bytes the same); Japan Disk System (changed, 100 of 129 bytes the same).

$ff less 7 is $f8 and less 59 is $c4; the fire flower's $c0 is 63. Only PlayerCtrlRoutine reads the buttons into A_B_Buttons, and it doesn't run while the game is stopped, so SaveAB keeps saving the A held on the frame he took it: a press then held through the stop doesn't jump on the first frame after it (the probe's clip case presses A there).

At the movement lab's start in World 1-1 (the game started from power-on, Mario standing still, then 10 frames), the frame counter reads 166, and the leftover sub-pixel part of a power-up's fall is 0. smb1/lab-start-counters

Value: frame counter 166 · y dummy 0

Verifiedsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L140-L141NoDecTimers: INC FrameCounter ; increment frame countersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/ram.asm#L334-L336SprObject_YMF_Dummy = $0416 Player_YMF_Dummy = $0416 Enemy_YMF_Dummy = $0417Checked by claude, 2026-10-29 — the probe reaches the start as the sprite capture does (probes/sprites/super-mario-bros-run.lua: Start pressed every 30th frame on the title, World 1-1 reached, Mario standing, 10 frames) and reads FrameCounter ($09) and Enemy_YMF_Dummy+5 ($041c)Revised after a check by a second AI model, 2026-10-29.Probe: probes/lab/smb1-mushroom.mjs

In other builds: Europe (same bytes); Japan Disk System (moved).

Timing that rests on the frame counter (a power-up's rise, the even frames a touch is tested on) depends on where a run starts; the lab's model takes it from here. The leftover is the power-up slot's Enemy_YMF_Dummy, which ImposeGravity adds the fall's fraction to; a landing doesn't clear it, so it carries from one fall to the next.

On land in Super Mario Bros., A jumps, and B held while walking runs; Fire Mario's B also throws a fireball. Left and Right walk, and Down crouches big Mario, Super or Fire, on the ground; small Mario doesn't crouch. Start on controller 1 pauses the game and resumes it. smb1/scheme

Value: a jump · b run, shoot · start pause · dpad move, crouch

CodeSuper Mario Bros. instruction booklet (NES) · p. 4, 2. Names of Controller Parts, A buttonJump... ... Mario (Luigi) jumps higher if you hold the button down longer.Super Mario Bros. instruction booklet (NES) · p. 4, 2. Names of Controller Parts, B buttonAccelerate ... Press this button to speed up, then jump and you can go all the … Fireballs ...... After you pick up the fire flower, you can use this button to throwSuper Mario Bros. instruction booklet (NES) · p. 3, 2. Names of Controller Parts, Control PadWalk to the right. … (Push button B at the … Crouch. … (Super Mario only.)Super Mario Bros. instruction booklet (NES) · p. 5, START buttonIf you wish to interrupt play in the middle of a game, press the START button. … The pause tone will sound, and the game will stop. Press the START button againsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4913-L4918LDA A_B_Buttons ; check for A button press AND #A_Button BEQ NoJump ; if not, branch to something else AND PreviousA_B_Buttons ; if button not pressed in previous frame, branch BEQ ProcJumping NoJump:smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5000-L5010ProcPRun: INY ; if mario on the ground, increment Y LDA AreaType ; check area type BEQ ChkRFast ; if water type, branch DEY ; decrement Y by default for non-water type area LDA Left_Right_Buttons ; get left/right controller bits CMP Player_MovingDir ; check against moving direction BNE ChkRFast ; if controller bits <> moving direction, skip this part LDA A_B_Buttons ; check for b button pressed AND #B_Button BNE SetRTmr ; if pressed, skip ahead to set timersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5024-L5025SetRTmr: LDA #$0a ; if b button pressed, set running timersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5142-L5161ProcFireball_Bubble: LDA PlayerStatus ; check player's status CMP #$02 BCC ProcAirBubbles ; if not fiery, branch LDA A_B_Buttons AND #B_Button ; check for b button pressed BEQ ProcFireballs ; branch if not pressed AND PreviousA_B_Buttons BNE ProcFireballs ; if button pressed in previous frame, branch LDA FireballCounter ; load fireball counter AND #%00000001 ; get LSB and use as offset for buffer TAX …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4372-L4378SaveJoyp: LDA SavedJoypadBits ; otherwise store A and B buttons in $0a AND #%11000000 STA A_B_Buttons LDA SavedJoypadBits ; store left and right buttons in $0c AND #%00000011 STA Left_Right_Buttonssmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4702-L4711PlayerMovementSubs: LDA #$00 ; set A to init crouch flag by default LDY PlayerSize ; is player small? BNE SetCrouch ; if so, branch LDA Player_State ; check state of player BNE ProcMove ; if not on the ground, branch LDA Up_Down_Buttons ; load controller bits for up and down AND #%00000100 ; single out bit for down button SetCrouch: STA CrouchingFlag ; store value in crouch flagsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L213-L216ChkStart: LDA SavedJoypad1Bits ; check to see if start is pressed AND #Start_Button ; on controller 1 BEQ ClrPauseTimersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L186-L188LDA GamePauseStatus ; if in pause mode, do not perform operation mode stuff LSR BCS SkipMainOpersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4080-L4083GameCoreRoutine: LDX CurrentPlayer ; get which player is on the screen LDA SavedJoypadBits,x ; use appropriate player's controller bits STA SavedJoypadBits ; as the master controller bitsSuper Mario Bros. instruction booklet (NES) · p. 3, 2. Names of Controller Parts, Control Pad — the chart's left arrow; the scout checked the line against the page imageWalk to the left.Checked by claude, 2026-11-07 — read CheckForJumping (A), ProcPRun and SetRTmr (B sets the running timer on the ground outside water when the pad holds the way Mario moves), ProcFireball_Bubble (B, Fire Mario), SaveJoyp, PlayerMovementSubs (Down sets the crouch flag only when Mario isn't small, on the ground), ChkStart with the NMI's pause test, and GameCoreRoutine (the player on screen takes his own controller's bits) at the pinned commit; the manual's pp. 3-5Revised after a check by a second AI model, 2026-11-07.

In other builds: Europe (same bytes); Japan Disk System (moved).

The manual's chart prints the Control Pad's Up as "? ? ?" (p. 3, read from the page image). A jump starts only on the frame A goes down (smb1/jump-start). The fireball test also needs a free fireball slot and Mario within the screen's height, neither crouching nor climbing. Down with Left or Right on the ground cancels both (smb1/down-on-ground). A second player's Luigi reads controller 2 for everything but Start. B counts toward a run only on the ground, with the pad held the way Mario is moving.

Cited by: NES controller, Super Mario Bros.

In Super Mario Bros.'s water areas, A swims: each press sends Mario up a stroke, except while he is still rising after the last stroke's timer has run out. B no longer runs there, but Fire Mario's B still throws fireballs. The Control Pad moves him and crouches big Mario on the floor, and Start pauses as on land. Below a line near the bottom of the screen, or off the screen vertically, the game ignores the Control Pad, A, and B, though Start still pauses. smb1/scheme-swimming

Value: mode swimming · a swim · b shoot · start pause · dpad move, crouch

CodeSuper Mario Bros. instruction booklet (NES) · p. 4, 2. Names of Controller Parts, A buttonSwim... ..When you're in the water, each press of this button makes you bobsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L2337-L2341LDA AreaType ; check area type BNE ChkStPos ; if water type, set swimming flag, otherwise do not set INY ChkStPos: STY SwimmingFlagsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4921-L4930ProcJumping: LDA Player_State ; check player state BEQ InitJS ; if on the ground, branch LDA SwimmingFlag ; if swimming flag not set, jump to do something else BEQ NoJump ; to prevent midair jumping, otherwise continue LDA JumpSwimTimer ; if jump/swim timer nonzero, branch BNE InitJS LDA Player_Y_Speed ; check player's vertical speed BPL InitJS ; if player's vertical speed motionless or down, branch JMP X_Physics ; if timer at zero and player still rising, do not swimsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L5000-L5003ProcPRun: INY ; if mario on the ground, increment Y LDA AreaType ; check area type BEQ ChkRFast ; if water type, branchsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L4361-L4371LDA AreaType ; are we in a water type area? BNE SaveJoyp ; if not, branch LDY Player_Y_HighPos DEY ; if not in vertical area between BNE DisJoyp ; status bar and bottom, branch LDA Player_Y_Position CMP #$d0 ; if nearing the bottom of the screen or BCC SaveJoyp ; not in the vertical area between status bar or bottom, DisJoyp: LDA #$00 ; disable controller bits STA SavedJoypadBitssmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L213-L216ChkStart: LDA SavedJoypad1Bits ; check to see if start is pressed AND #Start_Button ; on controller 1 BEQ ClrPauseTimerChecked by claude, 2026-11-07 — read the area setup that sets the swimming flag for a water-type area (type 0), ProcJumping's swim branch, ProcPRun's water branch past the B test, and PlayerCtrlRoutine's water test that clears the controller bits at the pinned commit; ProcFireball_Bubble, PlayerMovementSubs, and ChkStart (cited under smb1/scheme) test no area type ; the water test clears the engine's copy of the bits, and the pause reads controller 1's ownRevised after a check by a second AI model, 2026-11-07.

In other builds: Europe (same bytes); Japan Disk System (same code, other addresses).

The line is vertical position $D0, 208 px down the screen. A stroke starts through the same setup as a jump.

Cited by: NES controller, Super Mario Bros.

On Super Mario Bros.'s title screen, Select moves the mushroom between the one- and two-player games and Start begins, from either controller. Holding A with Start begins at the first area of the world where the last game ended. Once the game has been beaten and B pressed on the ending screen, B on the title screen steps through the worlds. smb1/scheme-title

Value: mode title screen · select choose · start confirm

CodeSuper Mario Bros. instruction booklet (NES) · p. 4, SELECT buttonUse this button to move the mushroom mark to theSuper Mario Bros. instruction booklet (NES) · p. 5, START buttonPress this button to begin.smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L330-L353GameMenuRoutine: LDY #$00 LDA SavedJoypad1Bits ; check to see if either player pressed ORA SavedJoypad2Bits ; only the start button (either joypad) CMP #Start_Button BEQ StartGame CMP #A_Button+Start_Button ; check to see if A + start was pressed BNE ChkSelect ; if not, branch to check select button StartGame: JMP ChkContinue ; if either start or A + start, execute here ChkSelect: CMP #Select_Button ; check to see if the select button was pressed …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L364-L376CPY #$01 ; was the B button pressed earlier? if so, branch BEQ IncWorldSel ; note this will not be run if world selection is disabled LDA NumberOfPlayers ; if no, must have been the select button, therefore EOR #%00000001 ; change number of players and draw icon accordingly STA NumberOfPlayers JSR DrawMushroomIcon JMP NullJoypad IncWorldSel: LDX WorldSelectNumber ; increment world select number INX TXA AND #%00000111 ; mask out higher bits …smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L402-L407ChkContinue: LDY DemoTimer ; if timer for demo has expired, reset modes BEQ ResetTitle ASL ; check to see if A button was also pushed BCC StartWorld1 ; if not, don't load continue function's world number LDA ContinueWorld ; load previously saved world number for secretsmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L428-L433GoContinue: STA WorldNumber ; start both players at the first area STA OffScr_WorldNumber ; of the previously saved world number LDX #$00 ; note that on power-up using this function STX AreaNumber ; will make no difference STX OffScr_AreaNumbersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L622-L626LDA WorldEndTimer ; check to see if world end timer expired BNE EndExitOne ; branch to leave if not LDY WorldNumber ; check world number CPY #World8 ; if on world 8, player is done with game, BCS EndChkBButton ; thus branch to read controllersmb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1) · src/prg.asm#L638-L645EndChkBButton: LDA SavedJoypad1Bits ORA SavedJoypad2Bits ; check to see if B button was pressed on AND #B_Button ; either controller BEQ EndExitTwo ; branch to leave if not LDA #$01 ; otherwise set world selection flag STA WorldSelectEnableFlag LDA #$ff ; remove onscreen player's livesChecked by claude, 2026-11-07 — read GameMenuRoutine, its Select and B branch, ChkContinue and GoContinue (A with Start), and EndChkBButton at the pinned commit; the world comes from the game over that set it (L2481-L2482)Checked by a second AI model, 2026-11-07.

In other builds: Europe (same bytes); Japan Disk System (same code, other addresses).

A scheme's value maps single buttons, so A with Start and B's world select stay out of it. During the attract-mode demo, Start or Select returns to the title screen.

Cited by: NES controller, Super Mario Bros.