Sonic and Tails take off at $680 subpixels per frame (6.5 px/frame) and Knuckles at $600 (6 px/frame); underwater the speeds are $380 and $300. | sonic3k.asm L23342–23350sonic3k.asm L28578–28581sonic3k.asm L32494–32497 | Code |
MoveSprite adds $38 subpixels/frame to a falling player's speed, Sonic 1's and Sonic 2's gravity, and underwater the air modes take $28 back. | sonic3k.asm L36077–36078sonic3k.asm L22442–22449 | Code |
With no jump button held, Sonic_JumpHeight cuts a rise faster than 4 px/frame to exactly -$400 (-$200 underwater); a press once the rise is no faster than that starts a shield move instead. | sonic3k.asm L23404–23415 | Code |
Sonic_Init sets the top speed to $600, the acceleration to $C, and the deceleration to $80 subpixels, the values of Sonic 1 and Sonic 2. | sonic3k.asm L21950–21952sonic3k.asm L22902–22908 | Code |
In the air Sonic_ChgJumpDir still adds $18 a frame, but a Sonic already faster than the top speed keeps his speed; Sonic 1 and Sonic 2 pulled him down to it. | sonic3k.asm L23129–23155s3.asm L20845–20866 | Code |
Sonic 3 & Knuckles keeps Sonic 1's air drag, X speed less X speed shifted right 5 bits while Y speed is from −$400 to −1. | sonic3k.asm L23169–23193 | Code |
Sonic 3 & Knuckles has no grace window after a ledge: Sonic_Jump is called only from the grounded modes. | sonic3k.asm L22328–22330sonic3k.asm L22402–22405sonic3k.asm L22385–22389 | Code |
The spin dash is Sonic 2's, with the same $200 a press to $800, the same 1/32 decay, and the same release speeds from $800 to $C00. | sonic3k.asm L23740–23743sonic3k.asm L23773–23782sonic3k.asm L23798–23814 | Code |
Unlike Sonic 1 and Sonic 2, a standing player slides on a slope whose push, sine × $20, is at least $D; the walking and rolling factors stay $20 and $50. | sonic3k.asm L23866–23896sonic3k.asm L23914 | Code |
Below $280 ground speed on a steep slope the player now slips, a $80 push along the slope and a 30-frame d-pad lock, and falls off only near walls and ceilings; Sonic 1 and 2 dropped him from any slope past 45°. | sonic3k.asm L23953–23983 | Code |
Rolling keeps Sonic 2's numbers, friction of half the acceleration ($6), $20 more against the d-pad, and X speed clamped to $1000. | sonic3k.asm L22962–22969sonic3k.asm L23055–23057 | Code |
| Against objects the player is still a 16 px wide box whose half-height is his height radius minus 3, and ducking no longer shrinks it. | sonic3k.asm L20679–20689 | Code |
A hit throws the player up at -$400 and away from the object at $200 (half both underwater), the speeds of Sonic 1 and Sonic 2. | sonic3k.asm L21130–21141 | Code |
| The invulnerability count is now a byte but still 120, set by the hit and again on landing, and still blinks the sprite. | sonic3k.asm L21146sonic3k.asm L24545sonic3k.asm L22073–22078 | Code |
| Hit without a shield, the player drops his rings, at most 32 as bouncing rings, and the count goes to 0; with no rings he dies. | sonic3k.asm L21102–21118sonic3k.asm L35603–35606sonic3k.asm L35658 | Code |
A hit with any shield costs the shield, not the rings; HurtCharacter clears the shield bit and all three element bits together (`andi.b | sonic3k.asm L21110–21124sonic3k.constants.asm L184–190 | Code |
An elemental shield makes the player immune to each object whose shield_reaction byte names that element, and any shield deflects objects flagged for it at 8 px/frame. | sonic3k.asm L21039–21083 | Code |
A second press during a jump, once the rise is no faster than 4 px/frame (2 underwater), uses the shield: fire dashes at 8 px/frame and stops the fall, lightning jumps again at -$580, and bubble stops dead and drops at 8 px/frame, then bounces at 7.5 px/frame on landing. | sonic3k.asm L23400–23411sonic3k.asm L23446–23488sonic3k.asm L24436–24441 | Code |
| With no shield, the press gives Sonic the insta-shield, which while active makes him invincible and widens his hit box to 48 × 48 px. | sonic3k.asm L23508–23514sonic3k.asm L20656–20666 | Code |
Sonic 3 alone (s3.asm) has the same shield moves and insta-shield; its transformation check asks only for the seven Chaos Emeralds and 50 rings. | s3.asm L21122–21184 | Code |
Tails flies for 480 frames, a count of 240 that drops every other frame; flying adds $8 gravity a frame, and while time remains each press lifts him $20 a frame for up to 30 frames, until he rises faster than 1 px/frame. | sonic3k.asm L28703–28705sonic3k.asm L27632–27674sonic3k.asm L27610–27614 | Code |
Knuckles's glide starts at 4 px/frame and gains $4 a frame to a cap of 24 px/frame, and its fall settles near 0.5 px/frame, $20 added below $80 and taken above. | sonic3k.asm L32600–32613sonic3k.asm L31642–31663sonic3k.asm L31723–31731sonic3k.asm L30748–30764 | Code |
With neither Left nor Right held, Sonic_Move takes the current acceleration off a standing or running Sonic's ground speed each frame, stopping at 0, as Sonic 2 does; that is $C out of water and without speed shoes (ground-speeds), and $C for Super Sonic. With the infinite-inertia flag some objects set (bit 7 of status_secondary), it skips the d-pad and the friction both. | sonic3k.asm L22713–22735sonic3k.asm L22467–22468sonic3k.asm L22709–22711 | Code |
Sonic 3 & Knuckles keeps Sonic 2's skid bug: on flat ground, not mid-flip (flip_type not negative), a reversal skids (stopping animation, facing his motion) when the slowed speed is at least $400 moving right but only $301 moving left, because the angle read overwrites the speed's low byte. | sonic3k.asm L22850–22879sonic3k.asm L22916–22943sonic3k.asm L38 | Code |
| On the ground the d-pad turns Sonic only when his ground speed is 0 or already that way, and a skid turns him to face his motion; rolling, the same, with no skid; in the air, Left or Right turns him at once unless he jumped from a roll. While the spin dash charges, the d-pad doesn't turn him. On the ground and rolling, the d-pad is skipped altogether while an object holds his controls: move_lock, the infinite-inertia flag (bit 7 of status_secondary), or, rolling, a negative spin_dash_flag (pinball mode). | sonic3k.asm L22822–22828sonic3k.asm L22893–22897sonic3k.asm L23073–23080sonic3k.asm L23127–23133sonic3k.asm L23762–23764sonic3k.asm L22467–22470sonic3k.asm L22970–22975 | Code |
| Standing, Sonic's floor and ceiling sensors sit 19 px above and below his center and 9 px to each side, a 19 × 39 px box; curled up, 14 and 7, 15 × 29 px; his wall sensors sit 10 px to either side. These are Sonic 2's sizes. | sonic3k.asm L21940–21943sonic3k.asm L23296–23299sonic3k.asm L20231sonic3k.asm L20548 | Code |
With Down held, neither Left nor Right, and no infinite-inertia flag (bit 7 of status_secondary), Sonic curls into a roll at a ground speed of $100 or more either way, twice Sonic 2's $80; slower than that, unless he stands on an object, he crouches, where Sonic 2 and Sonic 3 alone crouch only from Sonic_Move's standstill branch. | sonic3k.asm L23258–23278s3.asm L20970–20976s3.asm L20420–20423 | Code |
Outside pinball mode (spin_dash_flag set on a roll) and without the infinite-inertia flag, a roll ends once friction and the d-pad leave the ground speed under $80 either way, and the speed left is kept; Sonic 2 and Sonic 3 alone unroll only at 0. Standing up moves his center 5 px up with normal gravity. In pinball mode a positive flag sets the speed to $400 in his facing direction instead, and a negative one skips the d-pad, friction, and this check. | sonic3k.asm L23007–23028s3.asm L20728–20739sonic3k.asm L22970–22973sonic3k.asm L23032–23036 | Code |
Crouching (animation 8), a press of A, B, or C starts the spin dash's charge at 0; while Down stays held, each frame first takes 1/32 of the counter (rounded down) and a press adds $200, to $800; letting go of Down releases it, curling him (5 px down) and setting the ground speed from the counter's high byte (spindash; Super Sonic's table is faster), negated facing left. On the start, charge, and release frames he doesn't move, and the floor sensors still run. The charge's decay, step, and cap are Sonic 2's. | sonic3k.asm L23679–23696sonic3k.asm L23737–23746sonic3k.asm L23770–23771sonic3k.asm L23796–23822 | Code |
With room overhead (jump-headroom), a jump press adds the jump speed along the ground's normal, -$680 straight up on flat ground with normal gravity (jump-speed gives the underwater and Super speeds), keeps the X speed, and ends the frame: the jump frame moves nothing. Standing, the jump curls Sonic and moves his center 5 px down (up with reverse gravity); from a roll he keeps the standing size (roll-jump-size). | sonic3k.asm L23353–23366sonic3k.asm L23370–23386 | Code |
A jump from a roll sets the roll-jump flag, and while it is set Sonic_ChgJumpDir skips the d-pad: no steering and no turning, though the air drag still runs. Landing clears it, as Sonic 2's Sonic_ResetOnFloor does; unlike Sonic 2, whose Sonic_JumpHeight only caps the rise, a jump press once his rise is no faster than 4 px/frame (2 underwater) clears it too (insta-shield-motion), as in Sonic 3 alone. | sonic3k.asm L23392–23393sonic3k.asm L23127–23128sonic3k.asm L24408s3.asm L21115 | Code |
| A jump from a roll resets Sonic's sensors to the standing size, 19 px below his center, while his ball stays drawn, so he lands 5 px higher than a standing jump would, and landing moves him by the difference, 0. Sonic 2 has the same order of instructions. | sonic3k.asm L23370–23373sonic3k.asm L24381–24388 | Code |
| A jump press during a jump, once the rise is no faster than 4 px/frame (2 underwater) and before any shield move or insta-shield this jump, clears the roll-jump flag before the shield checks, so a roll jump gets its steering back. With no shield, not invincible, not Super, and short of turning Super (50 rings, Update_HUD_timer nonzero, and seven Super Emeralds, or seven Chaos Emeralds with Emeralds_converted_flag clear), the insta-shield follows and doesn't change his position or speed; with an elemental shield its move follows (shield-moves). Later presses do nothing until he lands. | sonic3k.asm L23432–23438sonic3k.asm L23446–23481sonic3k.asm L23494–23506sonic3k.asm L23508–23514sonic3k.asm L34647–34651sonic3k.asm L24415–24426sonic3k.asm L23400–23411s3.asm L21115 | Code |
| Landing on flat ground keeps Sonic's horizontal speed as his ground speed, sets his Y speed to 0, and, if he was curled and spin_dash_flag is clear (not pinball mode), uncurls him; with normal gravity a ball from a standing jump or a roll moves 5 px up, one from a roll jump doesn't move. It clears the jump, roll-jump, and insta-shield flags; with the bubble shield used, it bounces him instead (shield-moves). | sonic3k.asm L24139–24142sonic3k.asm L24365–24368sonic3k.asm L24375–24409sonic3k.asm L24415–24426 | Code |
| The lab's stages are built of Angel Island Act 1's block 1, a full 16 × 16 px block solid from every side; Sonic 3 & Knuckles's level collision is 16 × 16 px blocks, and a sensor's search looks in its block and at most one more. | sonic3k.asm L19250–19264sonic3k.asm L19301–19325 | Code |
On a flat floor, not standing on an object, after each ground move, Player_AnglePos reads two floor sensors, at his center's X ± his width radius and his center's Y + his height radius; the nearer floor counts, and from 1 to 14 px into it he moves up to its surface. | sonic3k.asm L18812–18847sonic3k.asm L18886–18893 | Code |
| On flat ground, not on an object, when both floor sensors find the floor more than |X speed's high byte| + 4 px below, at most 14, Sonic leaves the ground with his speeds as they are, unless stick_to_convex is set; closer than that, he moves down to it. Sonic 2 has the same rule; Sonic 1 used a flat 14 px. | sonic3k.asm L18853–18879sonic3k.asm L18854 | Code |
| Outside Competition mode, on flat ground with a ground speed, Sonic's wall sensor sits 10 px ahead of where the frame's speeds would put his center and 8 px below it; in the air his side sensors sit 10 px to either side of his center at its height. | sonic3k.asm L19725–19773sonic3k.asm L20224–20231sonic3k.asm L20541–20548 | Code |
| On flat ground, with a ground speed and bit 6 of object_control clear (no object carrying him), a wall at the sensor ahead cuts the frame's X speed by the sensor's depth in whole pixels, so the move stops him beside it, and sets the ground speed to 0. | sonic3k.asm L22747–22809 | Code |
In the air SonicKnux_DoLevelCollision picks one of four checks by the direction of his speeds after gravity, from GetArcTan less $20: mostly down, mostly up, mostly left, or mostly right. The arctangent table puts the split where the smaller speed is 250/256 of the larger. | sonic3k.asm L24083–24093sonic3k.asm L3094–3118sonic3k.asm L3132–3133 | Code |
| Moving mostly down or up, both side sensors push Sonic out of a wall and stop his X speed; moving mostly left or right, only that side's does, and it also sets his ground speed to his Y speed. Unlike Sonic 2, a push moving left or right doesn't end the checks: the ceiling and then the floor are still tested. | sonic3k.asm L24094–24105sonic3k.asm L24203–24212sonic3k.asm L24312–24321s3.asm L21730–21743 | Code |
| Sonic's head sensors are read in the air only while he moves mostly up, left, or right. Inside a ceiling he moves down by the depth; moving up under a flat ceiling his Y speed becomes 0, moving sideways only if he was rising, and the floor isn't tested that frame. Moving mostly left, a head 20 px or more inside a ceiling is instead pushed off a wall on his right, a check Sonic 2 lacks. | sonic3k.asm L24211–24240sonic3k.asm L24283–24297sonic3k.asm L24321–24335 | Code |
| Falling mostly down, Sonic lands when a floor sensor is inside the ground unless both are deeper than his Y speed's whole pixels plus 8, and moves up by the deeper one's depth; moving mostly left or right and not rising, any depth lands him; rising, he doesn't land, except in a wind tunnel. | sonic3k.asm L24108–24126sonic3k.asm L24243–24261 | Code |
| Standing on flat ground, not on an object, not Super or Hyper, with no move_lock or infinite-inertia flag, with ground speed 0 after the left and right steps, and the floor under his center 12 px or more below his feet, Sonic turns to face right if last frame's right floor sensor met no block, or else left if the left one met none, and balances; otherwise Down crouches. Sonic 2 turned him only if the floor 6 px back the other way was also that far down. | sonic3k.asm L22480–22490sonic3k.asm L22566–22576sonic3k.asm L22587–22591sonic3k.asm L22602–22618sonic3k.asm L22035–22036sonic3k.asm L22467–22470s3.asm L20343–20347 | Code |
| Standing or rolling on flat ground with normal gravity, a jump press goes through only when the head sensors find 6 or more clear pixel rows above them; refused, the rest of the ground frame runs. On slopes and walls, and with reverse gravity, the sensors used turn with the angle. | sonic3k.asm L23329–23341sonic3k.asm L19855–19862 | Code |
| On the ground, while Background_collision_flag is clear, nothing but a jump press looks above Sonic: walking or rolling under a block that overlaps him, he stays on the ground. | sonic3k.asm L22328–22337sonic3k.asm L22402–22411 | Code |
Sonic dies once his Y position is more than 224 px below the level's bottom boundary, unless the level has set Disable_death_plane; with reverse gravity it is the top boundary instead. In Angel Island Act 1, run in MAME, every one of 18 falls into a pit killed him on the first frame after his center passed the boundary plus 224 px; the other branches are read in the code only. | sonic3k.asm L23207–23243 | Verified |
A frame-by-frame model of Sonic_MdNormal, Sonic_MdRoll, Sonic_MdJump, and SonicKnux_Spindash on flat ground, with the insta-shield, matches Sonic 3 & Knuckles itself, run in MAME with Sonic alone on a floor built of Angel Island Act 1's blocks, on every frame of the movement lab's flat-ground presets, stress scripts, and spin-dash and roll scripts and of 100 random input scripts. | sonic3k.asm L22328–22337sonic3k.asm L22385–22451sonic3k.asm L22463–22951sonic3k.asm L22959–23196sonic3k.asm L23258–23438sonic3k.asm L23679–23822sonic3k.asm L24075–24160sonic3k.asm L24375–24426sonic3k.asm L36108–36110sonic3k.asm L1324–1328sonic3k.asm L22006 | Verified |
| On stages built in Angel Island Act 1 from the act's full 16 × 16 block, the movement lab's Sonic 3 & Knuckles model matches the game itself, run in MAME, on every frame of 100 random stages with random input scripts, three in four with floating blocks, and of the lab's stage presets, until a fall into a pit kills him at the bottom boundary or he nears the end of the built floor. | sonic3k.asm L18764–18900sonic3k.asm L19223–19340sonic3k.asm L19509–19700sonic3k.asm L19715–19900sonic3k.asm L20016–20030sonic3k.asm L20224–20300sonic3k.asm L20541–20555sonic3k.asm L22566–22650sonic3k.asm L24075–24360sonic3k.asm L3075–3133 | Verified |
On flat ground, Sonic 3 & Knuckles changes when Sonic rolls and stands: Down curls him only from $100, not Sonic 2's $80, and, off objects, crouches him while he is still moving slower, where Sonic 2 crouched only from a standstill; a roll stands up under $80 with that speed kept, where Sonic 2's rolls on to 0 (both outside pinball mode). In the air he keeps a speed above the top while steering, where Sonic 2 pulled him down to it; a second press after a roll jump gives back steering, which Sonic 2's jump never did; a wall push moving sideways no longer ends the frame's checks; and a head 20 px into a ceiling moving left is pushed off a right wall instead, a check Sonic 2 lacks. Standing over a drop, not Super, he turns toward it at once, where Sonic 2 turned only if the floor 6 px the other way was also low. | sonic3k.asm L23271–23275sonic3k.asm L23012–23016sonic3k.asm L23139–23142sonic3k.asm L23438sonic3k.asm L24207–24212sonic3k.asm L24215–24217sonic3k.asm L22587–22591s3.asm L21730–21743s3.asm L21115 | Code |
Built at the pinned commit with its own build scripts, as they stand (FixBugs = 0, Sonic 3 Complete off), skdisasm reproduces the No-Intro Sonic & Knuckles + Sonic The Hedgehog 3 (USA) ROM byte for byte: buildSK.lua (sonic3k.asm) gives its first 2 MB, the code the locked-on game runs, and buildS3.lua (s3.asm) its last 2 MB. | sonic3k.asm L38s3.asm L25buildSK.lua L28buildS3.lua L10 | Code |
| Sonic 3's credits name Yuji Naka as producer and lead programmer, Hirokazu Yasuhara as director and lead game designer, Hisayoshi Yoshida and Takashi Iizuka as senior game designers, Hiroshi Nikaidoh and Masanobu Yamamoto as senior programmers, and Takashi Thomas Yuda as character designer. | s3.asm L77532–77583 | Code |
| Sonic & Knuckles's credits name Yuji Naka as producer and lead programmer, Hirokazu Yasuhara as director and lead game designer, Hisayoshi Yoshida and Takashi Iizuka as senior game designers, Takahiro Hamano and Masanobu Yamamoto as senior programmers, and Takashi Thomas Yuda as character designer. Sonic 3's name Hiroshi Nikaidoh where these name Hamano. | sonic3k.asm L122109–122169s3.asm L77570–77576 | Code |
| Sonic 3's credits name Brad Buxer, Bobby Brooks, Darryl Ross, Geoff Grace, Doug Grigsby III, and Scirocco as music composers, beside the Sega Sound Team, which includes Jun Senoue. Sonic & Knuckles alone credits Howard Drossin as its composer; locked onto Sonic 3, its credits list all seven. | s3.asm L77645–77671s3.asm L77705–77711sonic3k.asm L121578–121585sonic3k.asm L121612–121616sonic3k.constants.asm L967sonic3k.asm L122269–122277sonic3k.asm L122663–122695 | Code |