Actions

SCHG How-to

Difference between revisions of "Fix the Walk-Jump Bug in Sonic 1"

From Sonic Retro

(Changed the guide to a much better method of fixing this bug)
m (Text replacement - "\[\[Category:SCHG How-tos.*" to "")
 
(13 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{GuideBy|Cinossu}}
+
{{GuideBy|Cinossu|Mercury|PsychoSk8r}}
  
In ''[[Sonic the Hedgehog (16-bit)|Sonic the Hedgehog]]'' there's a lovely bug where Sonic jumps into the air in his walking animation. It occurs in several places (to the right of the first purple rock in Green Hill Zone Act 2 being a good place to see it), but they all have one thing in common; they are near an object that calls the '''SolidObject''' routine.
+
In ''[[Sonic the Hedgehog (16-bit)|Sonic the Hedgehog]]'' there's a lovely bug where Sonic jumps into the air in his walking animation. It occurs in several places (to the right of the second purple rock with a yellow spring on top of it in [[Green Hill Zone]] Act 2 being a good place to see it, as well as near the lava in [[Marble Zone]]), but they all have one thing in common; they are near an object that calls the '''SolidObject''' routine.
  
 
Instead of changing how jumps are shown within Sonic's object code, you can fix this within the '''SolidObject''' routine itself (and if you look in Sonic 2, a variant of this is used as well).
 
Instead of changing how jumps are shown within Sonic's object code, you can fix this within the '''SolidObject''' routine itself (and if you look in Sonic 2, a variant of this is used as well).
 +
 +
==Hivebrain's 2005 Disassembly==
 +
 +
===Jumping===
  
 
The first thing you'll want to find is '''loc_FB92'''. It starts off looking like this:
 
The first thing you'll want to find is '''loc_FB92'''. It starts off looking like this:
  
<asm>loc_FB92:
+
<syntaxhighlight lang="asm">
 +
loc_FB92:
 +
btst #5,$22(a0)
 +
beq.s loc_FBAC
 +
move.w #1,$1C(a1) ; use walking animation
 +
 
 +
loc_FBA0:
 +
bclr #5,$22(a0)
 +
...</syntaxhighlight>
 +
 
 +
As the comment says, it sets the walking animation for use right here. Your first assumption may be to remove that instruction altogether, but you don't want to do that, as some little animation bugs can still occur this way. The way to fix it is to add a conditional branch, checking to see if Sonic's animation should be set to rolling, and skipping the changing of his animation if so. You should change the code to look something like this:
 +
 
 +
<syntaxhighlight lang="asm">loc_FB92:
 +
btst #5,$22(a0)
 +
beq.s loc_FBAC
 +
cmp.b #2,$1C(a1) ; check if in jumping/rolling animation
 +
beq.s loc_FBA0
 +
move.w #1,$1C(a1) ; use walking animation
 +
 
 +
loc_FBA0:
 +
bclr #5,$22(a0)
 +
...</syntaxhighlight>
 +
 
 +
And that's it! A much simpler method of getting rid of this bug, and one that doesn't alter the original player object as well.
 +
 
 +
The above fix only works concerning solid objects other than [[Monitor|Monitors]], meaning there will still be a fair number of areas in which the walk-jump bug will occur unless you also modify the following code. Find the '''Obj26''' label, and scroll down until you see this:
 +
 
 +
<syntaxhighlight lang="asm">
 +
loc_A25C:
 +
btst #5,$22(a0)
 +
beq.s Obj26_Animate
 +
move.w #1,$1C(a1)
 +
 
 +
loc_A26A:
 +
bclr #5,$22(a0)
 +
bclr #5,$22(a1)
 +
...</syntaxhighlight>
 +
 
 +
and replace it with this:
 +
 
 +
<syntaxhighlight lang="asm">
 +
loc_A25C:
 +
btst #5,$22(a0)
 +
beq.s Obj26_Animate
 +
cmp.b #2,$1C(a1) ; check if in jumping/rolling animation
 +
beq.s loc_A26A
 +
move.w #1,$1C(a1)
 +
 
 +
loc_A26A:
 +
bclr #5,$22(a0)
 +
bclr #5,$22(a1)
 +
...</syntaxhighlight>
 +
 
 +
===Drowning===
 +
 
 +
There is also another related bug: if Sonic drowns while adjacent to a solid object or Monitor, he will fall off the screen in his walking animation, and not his drowning animation as he should. This can be fixed by adding a check for his drowning animation in addition to his jumping/rolling animation in the code described above.
 +
 
 +
'''SolidObject''':
 +
 
 +
<syntaxhighlight lang="asm">loc_FB92:
 
btst #5,$22(a0)
 
btst #5,$22(a0)
 
beq.s loc_FBAC
 
beq.s loc_FBAC
 +
cmp.b #2,$1C(a1) ; check if in jumping/rolling animation
 +
beq.s loc_FBA0
 +
cmp.b #$17,$1C(a1) ; check if in drowning animation
 +
beq.s loc_FBA0
 
move.w #1,$1C(a1) ; use walking animation
 
move.w #1,$1C(a1) ; use walking animation
  
 
loc_FBA0:
 
loc_FBA0:
 
bclr #5,$22(a0)
 
bclr #5,$22(a0)
...</asm>
+
...</syntaxhighlight>
 +
 
 +
'''Obj26''' (Monitor):
 +
 
 +
<syntaxhighlight lang="asm">
 +
loc_A25C:
 +
btst #5,$22(a0)
 +
beq.s Obj26_Animate
 +
cmp.b #2,$1C(a1) ; check if in jumping/rolling animation
 +
beq.s loc_A26A
 +
cmp.b #$17,$1C(a1) ; check if in drowning animation
 +
beq.s loc_A26A
 +
move.w #1,$1C(a1)
 +
 
 +
loc_A26A:
 +
bclr #5,$22(a0)
 +
bclr #5,$22(a1)
 +
...</syntaxhighlight>
 +
 
 +
===Hurt by spikes===
 +
 
 +
There is yet another related bug: if Sonic walks or runs into sideways-pointing spikes, he will be hurt as usual, but bounce in his walking animation, and not his hurt animation. This can be fixed by adding a check for his hurt animation.
  
If you look at the comment left, it sets the walking animation for use right here. Your first assumption may be to remove this call altogether, but you don't want to do that as some little animation bugs can still occur this way. The way to fix it is to add a conditional branch over it, checking to see if Sonic's animation should be set to rolling. You should change the code to look something like this:
+
'''SolidObject''':
  
<asm>loc_FB92:
+
<syntaxhighlight lang="asm">loc_FB92:
 
btst #5,$22(a0)
 
btst #5,$22(a0)
 
beq.s loc_FBAC
 
beq.s loc_FBAC
 
cmp.b #2,$1C(a1) ; check if in jumping/rolling animation
 
cmp.b #2,$1C(a1) ; check if in jumping/rolling animation
 +
beq.s loc_FBA0
 +
cmp.b #$17,$1C(a1) ; check if in drowning animation
 +
beq.s loc_FBA0
 +
cmp.b #$1A,$1C(a1) ; check if in hurt animation
 
beq.s loc_FBA0
 
beq.s loc_FBA0
 
move.w #1,$1C(a1) ; use walking animation
 
move.w #1,$1C(a1) ; use walking animation
Line 27: Line 119:
 
loc_FBA0:
 
loc_FBA0:
 
bclr #5,$22(a0)
 
bclr #5,$22(a0)
...</asm>
+
...</syntaxhighlight>
 +
 
 +
==GitHub Disassembly==
 +
 
 +
===Jumping===
 +
 
 +
The first thing you'll want to find is '''Solid_Ignore'''. Open ''_incObj\sub SolidObject.asm'', it starts off looking like this:
 +
 
 +
<syntaxhighlight lang="asm">Solid_Ignore:
 +
btst #5,obStatus(a0) ; is Sonic pushing?
 +
beq.s Solid_Debug ; if not, branch
 +
move.w #id_Run,obAnim(a1) ; use running animation
 +
 
 +
Solid_NotPushing:
 +
bclr #5,obStatus(a0) ; clear pushing flag</syntaxhighlight>
 +
 
 +
 
 +
As the comment says, it sets the walking animation for use right here. Your first assumption may be to remove that instruction altogether, but you don't want to do that, as some little animation bugs can still occur this way. The way to fix it is to add a conditional branch, checking to see if Sonic's animation should be set to rolling, and skipping the changing of his animation if so. You should change the code to look something like this:
 +
 
 +
<syntaxhighlight lang="asm">Solid_Ignore:
 +
btst #5,obStatus(a0) ; is Sonic pushing?
 +
beq.s Solid_Debug ; if not, branch
 +
cmpi.b #id_Roll,obAnim(a1) ; is Sonic in his jumping/rolling animation?
 +
beq.s Solid_NotPushing ; if so, branch
 +
move.w #id_Run,obAnim(a1) ; use running animation
 +
 
 +
Solid_NotPushing:
 +
bclr #5,obStatus(a0) ; clear pushing flag
 +
...</syntaxhighlight>
  
 
And that's it! A much simpler method of getting rid of this bug, and one that doesn't alter the original player object as well.
 
And that's it! A much simpler method of getting rid of this bug, and one that doesn't alter the original player object as well.
  
==Original Guide==
+
The above fix only works concerning solid objects other than Monitors, meaning there will still be a fair number of areas in which the walk-jump bug will occur unless you also modify the following code. Open ''_incObj\26 Monitor.asm'' and scroll down until you see this:
{{GuideBy|Aquaslash}}
+
 
 +
<syntaxhighlight lang="asm">
 +
loc_A25C:
 +
btst #5,obStatus(a0)
 +
beq.s Mon_Animate
 +
move.w #1,obAnim(a1) ; clear obAnim and set obNextAni to 1
 +
 
 +
loc_A26A:
 +
bclr #5,obStatus(a0)
 +
bclr #5,obStatus(a1)
 +
...</syntaxhighlight>
 +
 
 +
and replace it with this:
 +
 
 +
<syntaxhighlight lang="asm">
 +
loc_A25C:
 +
btst #5,obStatus(a0)
 +
beq.s Mon_Animate
 +
cmpi.b #id_Roll,obAnim(a1) ; is Sonic in his jumping/rolling animation?
 +
beq.s loc_A26A ; if so, branch
 +
move.w #1,obAnim(a1) ; clear obAnim and set obNextAni to 1, putting Sonic in his walking animation
 +
 
 +
loc_A26A:
 +
bclr #5,obStatus(a0)
 +
bclr #5,obStatus(a1)
 +
...</syntaxhighlight>
  
In the original ''[[Sonic the Hedgehog (16-bit)|Sonic the Hedgehog]]'' there exists an odd bug where Sonic does not use his Spin Attack while jumping next to certain objects.  He'll walk in place instead of rolling into a ball.  In addition to looking way weird, this can also hamper the game play a great deal.  It's most noticeable in [[Final Zone]], where it can cost players a few hits.  Today, we're going to fix that annoying glitch (because if I have to play ONE more hack with it, I'm losing it).
+
===Drowning===
  
The first thing we want to look for is the modes for controlling Sonic, which is where this fix will be called from.  We'll want to call this in the air at all times so look for "Obj01_MdJump".  Once there, find the line "bsr.w Sonic_JumpHeight". This is an optimal place for our fix since it'll be called after Sonic's jump height is looked at. You'll want to paste this line after it:
+
There is also another related bug: if Sonic drowns while adjacent to a solid object or Monitor, he will fall off the screen in his walking animation, and not his drowning animation as he should. This can be fixed by adding a check for his drowning animation in addition to his jumping/rolling animation in the code described above.
  
<asm>bsr.w FixMZBug</asm>
+
'''SolidObject''':
  
Thus, the completed section should look like this (give or take your own modifications):
+
<syntaxhighlight lang="asm">Solid_Ignore:
 +
btst #5,obStatus(a0) ; is Sonic pushing?
 +
beq.s Solid_Debug ; if not, branch
 +
cmpi.b #id_Roll,obAnim(a1) ; is Sonic in his jumping/rolling animation?
 +
beq.s Solid_NotPushing ; if so, branch
 +
cmpi.b #id_Drown,obAnim(a1) ; is Sonic in his drowning animation?
 +
beq.s Solid_NotPushing ; if so, branch
 +
move.w #id_Run,obAnim(a1) ; use running animation
  
<asm>
+
Solid_NotPushing:
bsr.w Sonic_JumpHeight
+
bclr #5,obStatus(a0) ; clear pushing flag
bsr.w FixMZBug
+
...</syntaxhighlight>
bsr.w Sonic_ChgJumpDir
 
bsr.w Sonic_LevelBound
 
jsr ObjectFall
 
btst #6,$22(a0)
 
beq.s loc_12E5C
 
subi.w #$28,$12(a0)</asm>
 
  
We'll also want to do this at the second check of the jump modes: "Obj01_MdJump2"  Once there, paste the same fix line in the same spot.  It should look similar to this:
+
'''Monitor''':
  
<asm>Obj01_MdJump2: ; XREF: Obj01_Modes
+
<syntaxhighlight lang="asm">
bsr.w Sonic_JumpHeight
+
loc_A25C:
bsr.w FixMZBug
+
btst #5,obStatus(a0)
bsr.w Sonic_ChgJumpDir
+
beq.s Mon_Animate
bsr.w Sonic_LevelBound
+
cmpi.b #id_Roll,obAnim(a1) ; is Sonic in his jumping/rolling animation?
jsr ObjectFall
+
beq.s loc_A26A ; if so, branch
btst #6,$22(a0)
+
cmpi.b #id_Drown,obAnim(a1) ; is Sonic in his drowning animation?
beq.s loc_12EA6
+
beq.s loc_A26A ; if so, branch
subi.w #$28,$12(a0)</asm>
+
move.w #1,obAnim(a1) ; clear obAnim and set obNextAni to 1, putting Sonic in his walking animation
  
Now for the fix. Find "Sonic_SlopeResist". We're going to place our fix BEFORE it. Make some space after the routine above it and add the following:
+
loc_A26A:
 +
bclr #5,obStatus(a0)
 +
bclr #5,obStatus(a1)
 +
...</syntaxhighlight>
  
<asm>
+
===Hurt by spikes===
; ---------------------------------------------------------------------------
 
; Subroutine to fix that godawful jumping bug
 
; ---------------------------------------------------------------------------
 
  
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
+
There is yet another related bug: if Sonic walks or runs into sideways-pointing spikes, he will be hurt as usual, but bounce in his walking animation, and not his hurt animation. This can be fixed by adding a check for his hurt animation.
  
FixMZBug:
+
'''SolidObject''':
      tst.b  $3C(a0) ; Are we jumping?
 
      beq  @rts ; If not, rts
 
      tst.w $12(a0) ; Just to make sure, is speed negative, aka are we going up?
 
    blt @jumping ; If yes, branch
 
     
 
@rts:
 
      rts
 
     
 
@jumping:
 
      cmp.b  #$01,$1C(a0) ; Are we using the walking animation?
 
      blt    @fix_bug ; If yes, fix that.
 
      rts
 
     
 
@fix_bug:
 
      move.b  #$2,$1C(a0) ; Set animation to rolling.
 
      rts
 
; End of function FixMZBug
 
; ===========================================================================
 
</asm>
 
  
As explained by the comments, this checks if Sonic's moving upwards while using the walking animation. If he is, the proper rolling animation is put in it's place, problems are solved, and the Final Zone boss dies in record time!
+
<syntaxhighlight lang="asm">Solid_Ignore:
 +
btst #5,obStatus(a0) ; is Sonic pushing?
 +
beq.s Solid_Debug ; if not, branch
 +
cmpi.b #id_Roll,obAnim(a1) ; is Sonic in his jumping/rolling animation?
 +
beq.s Solid_NotPushing ; if so, branch
 +
cmpi.b #id_Drown,obAnim(a1) ; is Sonic in his drowning animation?
 +
beq.s Solid_NotPushing ; if so, branch
 +
cmpi.b #id_Hurt,obAnim(a1) ; is Sonic in his hurt animation?
 +
beq.s Solid_NotPushing ; if so, branch
 +
move.w #id_Run,obAnim(a1) ; use running animation
  
That's it! It's one of those simple, but necessary fixes. Put it in your ''Sonic 1'' hack. NOW. Else I'll hunt you down and force you to do it >:(.
+
Solid_NotPushing:
 +
bclr #5,obStatus(a0) ; clear pushing flag
 +
...</syntaxhighlight>
  
(Special thanks go to [[Puto]] for helping out with this)
 
  
[[Category:SCHG How-tos|Fix the Walk-Jump Bug in Sonic 1]]
+
{{S1Howtos}}
 +
|Fix the Walk-Jump Bug in Sonic 1]]

Latest revision as of 10:52, 25 August 2018

(Original guide by Cinossu and Mercury)

In Sonic the Hedgehog there's a lovely bug where Sonic jumps into the air in his walking animation. It occurs in several places (to the right of the second purple rock with a yellow spring on top of it in Green Hill Zone Act 2 being a good place to see it, as well as near the lava in Marble Zone), but they all have one thing in common; they are near an object that calls the SolidObject routine.

Instead of changing how jumps are shown within Sonic's object code, you can fix this within the SolidObject routine itself (and if you look in Sonic 2, a variant of this is used as well).

Hivebrain's 2005 Disassembly

Jumping

The first thing you'll want to find is loc_FB92. It starts off looking like this:

loc_FB92:
		btst	#5,$22(a0)
		beq.s	loc_FBAC
		move.w	#1,$1C(a1)	; use walking animation

loc_FBA0:
		bclr	#5,$22(a0)
		...

As the comment says, it sets the walking animation for use right here. Your first assumption may be to remove that instruction altogether, but you don't want to do that, as some little animation bugs can still occur this way. The way to fix it is to add a conditional branch, checking to see if Sonic's animation should be set to rolling, and skipping the changing of his animation if so. You should change the code to look something like this:

loc_FB92:
		btst	#5,$22(a0)
		beq.s	loc_FBAC
		cmp.b	#2,$1C(a1)	; check if in jumping/rolling animation
		beq.s	loc_FBA0
		move.w	#1,$1C(a1)	; use walking animation

loc_FBA0:
		bclr	#5,$22(a0)
		...

And that's it! A much simpler method of getting rid of this bug, and one that doesn't alter the original player object as well.

The above fix only works concerning solid objects other than Monitors, meaning there will still be a fair number of areas in which the walk-jump bug will occur unless you also modify the following code. Find the Obj26 label, and scroll down until you see this:

loc_A25C:
		btst	#5,$22(a0)
		beq.s	Obj26_Animate
		move.w	#1,$1C(a1)

loc_A26A:
		bclr	#5,$22(a0)
		bclr	#5,$22(a1)
		...

and replace it with this:

loc_A25C:
		btst	#5,$22(a0)
		beq.s	Obj26_Animate
		cmp.b	#2,$1C(a1)	; check if in jumping/rolling animation
		beq.s	loc_A26A
		move.w	#1,$1C(a1)

loc_A26A:
		bclr	#5,$22(a0)
		bclr	#5,$22(a1)
		...

Drowning

There is also another related bug: if Sonic drowns while adjacent to a solid object or Monitor, he will fall off the screen in his walking animation, and not his drowning animation as he should. This can be fixed by adding a check for his drowning animation in addition to his jumping/rolling animation in the code described above.

SolidObject:

loc_FB92:
		btst	#5,$22(a0)
		beq.s	loc_FBAC
		cmp.b	#2,$1C(a1)	; check if in jumping/rolling animation
		beq.s	loc_FBA0
		cmp.b	#$17,$1C(a1)	; check if in drowning animation
		beq.s	loc_FBA0
		move.w	#1,$1C(a1)	; use walking animation

loc_FBA0:
		bclr	#5,$22(a0)
		...

Obj26 (Monitor):

loc_A25C:
		btst	#5,$22(a0)
		beq.s	Obj26_Animate
		cmp.b	#2,$1C(a1)	; check if in jumping/rolling animation
		beq.s	loc_A26A
		cmp.b	#$17,$1C(a1)	; check if in drowning animation
		beq.s	loc_A26A
		move.w	#1,$1C(a1)

loc_A26A:
		bclr	#5,$22(a0)
		bclr	#5,$22(a1)
		...

Hurt by spikes

There is yet another related bug: if Sonic walks or runs into sideways-pointing spikes, he will be hurt as usual, but bounce in his walking animation, and not his hurt animation. This can be fixed by adding a check for his hurt animation.

SolidObject:

loc_FB92:
		btst	#5,$22(a0)
		beq.s	loc_FBAC
		cmp.b	#2,$1C(a1)	; check if in jumping/rolling animation
		beq.s	loc_FBA0
		cmp.b	#$17,$1C(a1)	; check if in drowning animation
		beq.s	loc_FBA0
		cmp.b	#$1A,$1C(a1)	; check if in hurt animation
		beq.s	loc_FBA0
		move.w	#1,$1C(a1)	; use walking animation

loc_FBA0:
		bclr	#5,$22(a0)
		...

GitHub Disassembly

Jumping

The first thing you'll want to find is Solid_Ignore. Open _incObj\sub SolidObject.asm, it starts off looking like this:

Solid_Ignore:
		btst	#5,obStatus(a0)	; is Sonic pushing?
		beq.s	Solid_Debug	; if not, branch
		move.w	#id_Run,obAnim(a1) ; use running animation

Solid_NotPushing:
		bclr	#5,obStatus(a0)	; clear pushing flag


As the comment says, it sets the walking animation for use right here. Your first assumption may be to remove that instruction altogether, but you don't want to do that, as some little animation bugs can still occur this way. The way to fix it is to add a conditional branch, checking to see if Sonic's animation should be set to rolling, and skipping the changing of his animation if so. You should change the code to look something like this:

Solid_Ignore:
		btst	#5,obStatus(a0)	; is Sonic pushing?
		beq.s	Solid_Debug	; if not, branch
		cmpi.b	#id_Roll,obAnim(a1)	; is Sonic in his jumping/rolling animation?
		beq.s	Solid_NotPushing	; if so, branch
		move.w	#id_Run,obAnim(a1) ; use running animation

Solid_NotPushing:
		bclr	#5,obStatus(a0)	; clear pushing flag
		...

And that's it! A much simpler method of getting rid of this bug, and one that doesn't alter the original player object as well.

The above fix only works concerning solid objects other than Monitors, meaning there will still be a fair number of areas in which the walk-jump bug will occur unless you also modify the following code. Open _incObj\26 Monitor.asm and scroll down until you see this:

loc_A25C:
		btst	#5,obStatus(a0)
		beq.s	Mon_Animate
		move.w	#1,obAnim(a1)	; clear obAnim and set obNextAni to 1

loc_A26A:
		bclr	#5,obStatus(a0)
		bclr	#5,obStatus(a1)
		...

and replace it with this:

loc_A25C:
		btst	#5,obStatus(a0)
		beq.s	Mon_Animate
		cmpi.b	#id_Roll,obAnim(a1)	; is Sonic in his jumping/rolling animation?
		beq.s	loc_A26A	; if so, branch
		move.w	#1,obAnim(a1)	; clear obAnim and set obNextAni to 1, putting Sonic in his walking animation

loc_A26A:
		bclr	#5,obStatus(a0)
		bclr	#5,obStatus(a1)
		...

Drowning

There is also another related bug: if Sonic drowns while adjacent to a solid object or Monitor, he will fall off the screen in his walking animation, and not his drowning animation as he should. This can be fixed by adding a check for his drowning animation in addition to his jumping/rolling animation in the code described above.

SolidObject:

Solid_Ignore:
		btst	#5,obStatus(a0)	; is Sonic pushing?
		beq.s	Solid_Debug	; if not, branch
		cmpi.b	#id_Roll,obAnim(a1)	; is Sonic in his jumping/rolling animation?
		beq.s	Solid_NotPushing	; if so, branch
		cmpi.b	#id_Drown,obAnim(a1)	; is Sonic in his drowning animation?
		beq.s	Solid_NotPushing	; if so, branch
		move.w	#id_Run,obAnim(a1) ; use running animation

Solid_NotPushing:
		bclr	#5,obStatus(a0)	; clear pushing flag
		...

Monitor:

loc_A25C:
		btst	#5,obStatus(a0)
		beq.s	Mon_Animate
		cmpi.b	#id_Roll,obAnim(a1)	; is Sonic in his jumping/rolling animation?
		beq.s	loc_A26A	; if so, branch
		cmpi.b	#id_Drown,obAnim(a1)	; is Sonic in his drowning animation?
		beq.s	loc_A26A	; if so, branch
		move.w	#1,obAnim(a1)	; clear obAnim and set obNextAni to 1, putting Sonic in his walking animation

loc_A26A:
		bclr	#5,obStatus(a0)
		bclr	#5,obStatus(a1)
		...

Hurt by spikes

There is yet another related bug: if Sonic walks or runs into sideways-pointing spikes, he will be hurt as usual, but bounce in his walking animation, and not his hurt animation. This can be fixed by adding a check for his hurt animation.

SolidObject:

Solid_Ignore:
		btst	#5,obStatus(a0)	; is Sonic pushing?
		beq.s	Solid_Debug	; if not, branch
		cmpi.b	#id_Roll,obAnim(a1)	; is Sonic in his jumping/rolling animation?
		beq.s	Solid_NotPushing	; if so, branch
		cmpi.b	#id_Drown,obAnim(a1)	; is Sonic in his drowning animation?
		beq.s	Solid_NotPushing	; if so, branch
		cmpi.b	#id_Hurt,obAnim(a1)	; is Sonic in his hurt animation?
		beq.s	Solid_NotPushing	; if so, branch
		move.w	#id_Run,obAnim(a1) ; use running animation

Solid_NotPushing:
		bclr	#5,obStatus(a0)	; clear pushing flag
		...


SCHG How-To Guide: Sonic the Hedgehog (16-bit)
Fixing Bugs
Fix Demo Playback | Fix a Race Condition with Pattern Load Cues | Fix the SEGA Sound | Display the Press Start Button Text | Fix the Level Select Menu | Fix the Hidden Points Bug | Fix Accidental Deletion of Scattered Rings | Fix Ring Timers | Fix the Walk-Jump Bug | Correct Drowning Bugs | Fix the Death Boundary Bug | Fix the Camera Follow Bug | Fix Song Restoration Bugs | Fix the HUD Blinking | Fix the Level Select Graphics Bug | Fix a remember sprite related bug
Changing Design Choices
Change Spike Behavior | Collide with Water After Being Hurt | Fix Special Stage Jumping Physics | Improve the Fade In\Fade Out Progression Routines | Fix Scattered Rings' Underwater Physics | Remove the Speed Cap | Port the REV01 Background Effects | Port Sonic 2's Level Art Loader | Retain Rings Between Acts | Add Sonic 2 (Simon Wai Prototype) Level Select | Improve ObjectMove Subroutines | Port Sonic 2 Level Select
Adding Features
Add Spin Dash ( Part 1 / Part 2 / Part 3 / Part 4 ) | Add Eggman Monitor | Add Super Sonic | Add the Air Roll
Sound Features
Expand the Sound Index | Play Different Songs Per Act | Port Sonic 2 Final Sound Driver | Port Sonic 3's Sound Driver | Port Flamewing's Sonic 3 & Knuckles Sound Driver | Change The SEGA Sound
Extending the Game
Load Chunks From ROM | Add Extra Characters | Make an Alternative Title Screen | Use Dynamic Tilesets | Make GHZ Load Alternate Art | Make Ending Load Alternate Art | Add a New Zone | Set Up the Goggle Monitor | Add New Moves | Add a Dynamic Collision System | Dynamic Special Stage Walls System | Extend Sprite Mappings and Art Limit | Enigma Credits | Use Dynamic Palettes
Miscellaneous
Convert the Hivebrain 2005 Disassembly to ASM68K
Split Disassembly Guides
Set Up a Split Disassembly | Basic Level Editing | Basic Art Editing | Basic ASM Editing (Spin Dash)

|Fix the Walk-Jump Bug in Sonic 1]]