data/claims/s1disasm.yamlSonic the Hedgehog (sonicretro/s1disasm)
Game: Sonic the Hedgehog.
Sonic's jump speed, son_jumpspeed, is $680 subpixels per frame (6.5 px/frame) out of water. s1disasm/jump-speed
About: Sonic the Hedgehog Jump
Value: 1664 1/256 px/frame
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L8son_jumpspeed: equ $680 ; Sonic's jump speeds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/01 Sonic.asm#L1218move.w #son_jumpspeed,d2 ; set initial jump forceSonic Physics Guide: Jumping · Constantsjump_force 6.5 (6 pixels and 128 supbixels)Checked by claude, 2026-10-20 — read the equate and Sonic_Jump at the pinned commit1664/256 = 6.5 px/frame exactly. Underwater it is $380.
Cited by: Sonic the Hedgehog, Variable jump height
Sonic_Jump adds the jump speed along the ground normal (CalcSine of angle − $40); on flat ground that is exactly -$680 to Y speed, nothing to X. s1disasm/jump-vector
About: Sonic the Hedgehog Jump
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L1224-L1233subi.b #$40,d0 ; rotate it perpendicularly for jump trajectory
jsr (CalcSine).l ; find the direction Sonic should jump
…
muls.w d2,d0 ; apply jump force to the sine angle
asr.l #8,d0 ; shift it to upper word
add.w d0,obVelY(a0) ; apply to Y speeds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/sub CalcSine.asm#L53 — Sine_Data entry $C0 (the table starts at L29, eight entries per line)dc.w -$100,-$FF,-$FF,-$FF,-$FE,-$FE,-$FD,-$FC ; =Sonic Physics Guide: Jumping · Jump Velocityboth X Speed and Y Speed must have jump_force subtracted from them, using cos() and sin() to get the right values.Checked by claude, 2026-10-20 — read Sonic_JumpCited by: Sonic the Hedgehog, Variable jump height
ObjectFall's gravity equate adds $38 subpixels/frame to an airborne object's downward speed each frame, Sonic's included. s1disasm/gravity
About: Sonic the Hedgehog Gravity
Value: 56 1/256 px/frame²
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/sub ObjectFall & SpeedToPos.asm#L5gravity: equ $38 ; gravity constant used by many objectss1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/01 Sonic.asm#L363jsr (ObjectFall).l ; apply gravity and update Sonic's position based on his current velocitiesSonic Physics Guide: Air State · Constantsgravity_force 0.21875 (56 subpixels)Checked by claude, 2026-10-20 — read the equate and Sonic_MdJump2 at the pinned commit56/256 = 0.21875 px/frame² exactly. The same value applies whether or not the button is held.
Cited by: Sonic the Hedgehog, Variable jump height
During a jump, with no jump button held, Sonic_JumpHeight clamps any rise faster than 4 px/frame to exactly -$400. s1disasm/release-cap
About: Sonic the Hedgehog Variable jump height
Value: -1024 1/256 px/frame
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L1273-L1288tst.b jumping(a0) ; is Sonic airborne specifically from a jump?
…
move.w #-$400,d1 ; set max jump height
…
cmp.w obVelY(a0),d1 ; get current y speed
ble.s .return ; is Sonic moving up slower than the cap speed? if yes, branch
move.b (v_jpadhold2).w,d0 ; get currently held buttons
andi.b #btnABC,d0 ; is A, B or C still held after jumping?
bne.s .return ; if yes, branch
move.w d1,obVelY(a0) ; otherwise, cap Sonic's maximum jump heightSonic Physics Guide: Jumping · Variable Jump Heightthe computer checks to see if Y Speed is less than -4 (e.g. -5 is "less" than -4). If it is, then Y Speed is set to -4.Checked by claude, 2026-10-20 — read Sonic_JumpHeight at the pinned commit−1024/256 = −4 px/frame exactly. The check runs on every airborne frame without the button, not only on the release frame. Underwater, the cap is -$200.
Cited by: Sonic the Hedgehog, Variable jump height
Gravity slows Sonic's 6.5 px/frame take-off below the 4 px/frame release cap within 12 airborne updates. s1disasm/release-window
About: Sonic the Hedgehog Variable jump height
Value: 12 updates
T4 reproduceds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L8son_jumpspeed: equ $680 ; Sonic's jump speeds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/sub ObjectFall & SpeedToPos.asm#L5gravity: equ $38 ; gravity constant used by many objectss1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/01 Sonic.asm#L1276-L1284move.w #-$400,d1 ; set max jump height
…
cmp.w obVelY(a0),d1 ; get current y speed
ble.s .return ; is Sonic moving up slower than the cap speed? if yes, branchChecked by claude, 2026-10-20 — read the jump speed, gravity, and Sonic_JumpHeight at the pinned commit; −$680 + 11 × $38 is −$418, still faster than the cap, and −$680 + 12 × $38 is −$3E0, slower; the probe counts 12 by stepping the speedProbe: probes/jump-physics/jump-heights.mjsSo a release after the 12th airborne update changes nothing. Out of water only.
Cited by: Variable jump height
In the airborne-rolling mode (Sonic_MdJump2), the release check runs before ObjectFall moves Sonic and adds gravity. s1disasm/release-order
About: Sonic the Hedgehog Variable jump height
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L359-L363Sonic_MdJump2: ; While Sonic is in the air and rolling (usually, but not limited to, jumping)
bsr.w Sonic_JumpHeight ; handle Sonic's jump height based on whether the jump button is still held
…
jsr (ObjectFall).l ; apply gravity and update Sonic's position based on his current velocitiesSonic Physics Guide: Jumping · Variable Jump HeightThe check to see if the button is not being held is performed before the Player is moved to his new position and gravity_force is added to Y Speed.Checked by claude, 2026-10-20 — read Sonic_Modes and Sonic_MdJump2 at the pinned commitCited by: Variable jump height
Sonic doesn't move on the press frame; Sonic_Jump drops its return address, skipping the rest of the grounded routine, SpeedToPos included. s1disasm/jump-frame-no-move
About: Sonic the Hedgehog Jump
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L1236addq.l #4,sp ; run in-air subroutines when we returns1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/01 Sonic.asm#L317-L323Sonic_MdNormal: ; While Sonic is on the ground and not rolling
bsr.w Sonic_Jump ; check if we need to jump
…
jsr (SpeedToPos).l ; update Sonic's position based on his current velocitiesSonic Physics Guide: Jumping · Bugs when JumpingIf you do press the jump button, it exits the rest of the cycle - so the Player doesn't move at all during the step in which you jump, vertically or horizontally.Checked by claude, 2026-10-20 — read Sonic_Jump and Sonic_MdNormal at the pinned commitThe disassembly's comment says "run in-air subroutines when we return", but the code just returns from Sonic_MdNormal; the in-air mode runs from the next frame. The guide's account matches the code.
Cited by: Sonic the Hedgehog, Variable jump height
A standing jump curls Sonic up, shrinking his height radius from 19 to 14 and adding 5 to Y, so his feet stay put. s1disasm/roll-shift
About: Sonic the Hedgehog Jump
Value: 5 px
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L1250-L1254move.b #sonic_roll_height,obHeight(a0) ; set height to rolling size
…
addq.w #sonic_height-sonic_roll_height,obY(a0) ; adjust Y-position to align Sonic to the floors1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _Constants.asm#L312-L314sonic_height: equ 38/2 ; Sonic's height
…
sonic_roll_height: equ 28/2 ; Sonic's height (rolling)Sonic Physics Guide: Characters · SonicWhen Jumping or rolling, his Width Radius is 7 and his Height Radius is 14, resulting in 15 pixels wide and 29 pixels tall.Checked by claude, 2026-10-20 — read Sonic_Jump and the size equates at the pinned commitThe atlas measures jump height at the feet (Y + height radius), which this shift leaves unchanged.
Cited by: Sonic the Hedgehog, Variable jump height
ObjectFall adds the pre-gravity speed, shifted left 8 bits, to the 32-bit position, so positions are 16.16 and speeds 8.8 fixed point. s1disasm/fixed-point-motion
About: Sonic the Hedgehog Gravity
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/sub ObjectFall & SpeedToPos.asm#L16-L20move.w obVelY(a0),d0 ; load vertical speed
addi.w #gravity,obVelY(a0) ; increase vertical speed (apply gravity)
ext.l d0 ; extend speed to longword
asl.l #8,d0 ; shift speed up a byte (16.16 fixed point)
add.l d0,d3 ; add speed to Y-axis positionSonic Physics Guide: Calculations (Pixel and Subpixel) · Pixel and SubpixelEach pixel is effectively split into 256 slices along both axis and this means the finest fidelity available for movement is 1/256th of a pixel (aka 0.00390625).Checked by claude, 2026-10-20 — read ObjectFall at the pinned commitBecause speeds are shifted into the upper half of the position's fraction, motion resolution is 1/256 px, as the guide says. The drawn pixel is the floor of the position.
Cited by: Sonic the Hedgehog, Subpixel, Variable jump height
Sonic 1 never caps falling speed in the air; with FixBugs = 0, Sonic_JumpHeight's only cap is upward (-$FC0) and skipped after jumps. s1disasm/no-fall-cap
About: Sonic the Hedgehog Gravity
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L1291-L1302.return:
if FixBugs=0
; This prevents the max Y-vel cap from running while jumping
rts ; return
…
cmpi.w #-$FC0,obVelY(a0) ; is Sonic moving up just below the maximum screen scroll speed? (-$1000)Sonic Physics Guide: Air State · Top Y SpeedIn Sonic 1, the Player's Y Speed is not limited.Checked by claude, 2026-10-20 — read Sonic_JumpHeight and the FixBugs switch (sonic.asm L20) at the pinned commitA downward clamp to $FC0 exists only in the FixBugs build, and on landing on a steep slope, where Sonic_FloorDown caps the fall speed before turning it into ground speed (L1601-L1605).
Cited by: Sonic the Hedgehog, Variable jump height
Sonic gets no grace window after leaving a ledge: only the grounded modes, Sonic_MdNormal and Sonic_MdRoll, call Sonic_Jump. s1disasm/no-coyote-time
About: Sonic the Hedgehog Coyote time
T3 code-verifieds1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) ·_incObj/01 Sonic.asm#L113-L116Sonic_Modes: dc.w Sonic_MdNormal-Sonic_Modes ; 0 - while on the ground and not rolling
dc.w Sonic_MdJump-Sonic_Modes ; 2 - while in the air and not rollings1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/01 Sonic.asm#L318bsr.w Sonic_Jump ; check if we need to jumps1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/01 Sonic.asm#L348bsr.w Sonic_Jump ; check if we need to jumpChecked by claude, 2026-10-20 — read Sonic_Modes and all four mode routines at the pinned commitCited by: Coyote time, Sonic the Hedgehog, Variable jump height
Simulating the jump code (flat ground, out of water) gives apexes of 39 px tapped and 100 px held, airtimes 39 and 62 frames. s1disasm/apex-by-hold
About: Sonic the Hedgehog Variable jump height
Value
{
"tap": {
"apex": 39,
"airtime": 39
},
"full": {
"apex": 100,
"airtime": 62
}
}_incObj/01 Sonic.asm#L1273-L1288 — release caps1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm) · _incObj/sub ObjectFall & SpeedToPos.asm#L16-L20 — motionChecked by claude, 2026-10-20 — ran the probe and the widget model tests; both agreeProbe: probes/jump-physics/jump-heights.mjsHeights are whole drawn pixels at the feet; airtime is frames from the press until the feet are back at take-off height. The real landing also depends on Sonic_Floor's sensors, which the simulation leaves out.
Cited by: Variable jump height