For many players, the Special Stages of Sonic 1 can be particularly frustrating for a number of different reasons–rotation, steering, and jumping are the most common reasons listed. Forum member Mercury, best known for the Sonic Physics Guide and Sonic: The One Ring, examined the stages and realized that Special Stages don’t have the variable jump height present in the rest of the game. He investigated and found there was an unused routine for reducing Sonic’s jump height in the Special Stages within the code of the game. Using the power of trigonometry, he repaired and enabled the routine, leading to a fix that combines the X and Y speed using cos and sin to find how fast Sonic’s moving upward at the current angle in a Special Stage. It compares this combined speed with the jump release speed ($400) and if it’s greater, then it uses similar code to the normal jump to make Sonic move at $400 in the current angle. Simple.
You can read more about this fix and download a patched copy of the game at the Sonic Retro forums.