Difference between revisions of "Fix Tails subanimation error"
From Sonic Retro
(Making checks safer (stopped using signed condition, added upper boundary check)) |
m (Text replacement - "\[\[Category:SCHG How-tos.*" to "") |
||
(2 intermediate revisions by one other user not shown) | |||
Line 6: | Line 6: | ||
Go to "Obj05_Main:" and find this coding: | Go to "Obj05_Main:" and find this coding: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
moveq #0,d0 | moveq #0,d0 | ||
move.b anim(a2),d0 | move.b anim(a2),d0 | ||
Line 13: | Line 13: | ||
moveq #4,d0 | moveq #4,d0 | ||
+ | + | ||
− | </ | + | </syntaxhighlight> |
When Tails is next to something he's about to push, his pushing tails animation is set. The thing is, just before he pushes, one walking anim appears, which conflicts both tails animations. So, change it to this: | When Tails is next to something he's about to push, his pushing tails animation is set. The thing is, just before he pushes, one walking anim appears, which conflicts both tails animations. So, change it to this: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
moveq #0,d0 | moveq #0,d0 | ||
move.b anim(a2),d0 | move.b anim(a2),d0 | ||
Line 28: | Line 28: | ||
moveq #4,d0 | moveq #4,d0 | ||
+ | + | ||
− | </ | + | </syntaxhighlight> |
Now, as soon as he's about to push, it will still do his one walking animation, but his mapping frame wouldn't have reached #$63 yet, so it won't set the tails' pushing subanimation. That means no more conflicts. Then when he does do his pushing animation, the subanimation will set accordingly without conflicting. | Now, as soon as he's about to push, it will still do his one walking animation, but his mapping frame wouldn't have reached #$63 yet, so it won't set the tails' pushing subanimation. That means no more conflicts. Then when he does do his pushing animation, the subanimation will set accordingly without conflicting. | ||
Line 40: | Line 40: | ||
Go to "loc_1D288:" and you should see this: | Go to "loc_1D288:" and you should see this: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
loc_1D288: | loc_1D288: | ||
lea (Obj05AniData).l,a1 | lea (Obj05AniData).l,a1 | ||
Line 47: | Line 47: | ||
jsr (DisplaySprite).l | jsr (DisplaySprite).l | ||
rts | rts | ||
− | </ | + | </syntaxhighlight> |
This is where the Tails' Tails object gets animated and displayed. Change all this to: | This is where the Tails' Tails object gets animated and displayed. Change all this to: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
loc_1D288: | loc_1D288: | ||
lea (Obj05AniData).l,a1 | lea (Obj05AniData).l,a1 | ||
Line 67: | Line 67: | ||
.return: | .return: | ||
rts | rts | ||
− | </ | + | </syntaxhighlight> |
Done. | Done. | ||
Line 73: | Line 73: | ||
==Fix #3: Balancing fix== | ==Fix #3: Balancing fix== | ||
Not really a bug, though some people think his tails disappear. I always thought that the tails were behind his head, but if you do not like that, then go to "Obj05AniSelection:" and change this: | Not really a bug, though some people think his tails disappear. I always thought that the tails were behind his head, but if you do not like that, then go to "Obj05AniSelection:" and change this: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
dc.b 0 ; TailsAni_Balance -> Blank | dc.b 0 ; TailsAni_Balance -> Blank | ||
− | </ | + | </syntaxhighlight> |
I recommend changing the 0 to a $A, but you can change it to whatever you like. | I recommend changing the 0 to a $A, but you can change it to whatever you like. | ||
==Fix #4: Looking up fix== | ==Fix #4: Looking up fix== | ||
Again, not really a bug, but his tails flicker when looking up. Fixing this is just as easy. In the same bit of code that we were in for fix 3, change this: | Again, not really a bug, but his tails flicker when looking up. Fixing this is just as easy. In the same bit of code that we were in for fix 3, change this: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
dc.b 2 ; TailsAni_LookUp -> Flick | dc.b 2 ; TailsAni_LookUp -> Flick | ||
− | </ | + | </syntaxhighlight> |
Change that 2 to a 1 and it should be fine. | Change that 2 to a 1 and it should be fine. | ||
{{S2Howtos}} | {{S2Howtos}} | ||
− | + | |{{PAGENAME}}]] |
Latest revision as of 11:11, 25 August 2018
(Original guide by redhotsonic)
Contents
Fix #1: Pushing bug
When Tails is standing next to a solid object, his tails use their pushing subanimation as opposed to a standard idle subanimation. Also, during the few frames before Tails enters his actual pushing animation, his tails look corrupted. Let's fix that:
Go to "Obj05_Main:" and find this coding:
moveq #0,d0
move.b anim(a2),d0
btst #5,status(a2)
beq.s +
moveq #4,d0
+
When Tails is next to something he's about to push, his pushing tails animation is set. The thing is, just before he pushes, one walking anim appears, which conflicts both tails animations. So, change it to this:
moveq #0,d0
move.b anim(a2),d0
btst #5,status(a2) ; is Tails about to push against something?
beq.s + ; if not, branch
cmpi.b #$63,mapping_frame(a2) ; Is Tails in his pushing animation yet?
blo.s + ; If not yet, branch, and do not set tails' tail pushing animation
cmpi.b #$66,mapping_frame(a2) ; ''
bhi.s + ; ''
moveq #4,d0
+
Now, as soon as he's about to push, it will still do his one walking animation, but his mapping frame wouldn't have reached #$63 yet, so it won't set the tails' pushing subanimation. That means no more conflicts. Then when he does do his pushing animation, the subanimation will set accordingly without conflicting.
Fix #2: Hurt flashing bug
We all know that Tails has another object attached to him half the time; "Tails' Tails". Used for when he's standing, jumping, etc. Sometimes, his tails are drawn within Tails himself, like when he is walking.
Something that has always bugged me in Sonic 2 is that when he gets hurt, he becomes invulnerable for a couple of seconds, and he flashes, but the object "Tails' tails" does not. When this object isn't being used (like when Tails is walking and the tails are drawn within him) his tails do flash.
To me, this looks strange. This happens in both Sonic 2 and Sonic 3 and Knuckles. I'm about to show you how to fix it in Sonic 2. I will have a guide up on the wiki for the Sonic 3 fix soon. In the meantime, simply go to this forum post.Go to "loc_1D288:" and you should see this:
loc_1D288:
lea (Obj05AniData).l,a1
bsr.w Tails_Animate_Part2
bsr.w LoadTailsTailsDynPLC
jsr (DisplaySprite).l
rts
This is where the Tails' Tails object gets animated and displayed. Change all this to:
loc_1D288:
lea (Obj05AniData).l,a1
bsr.w Tails_Animate_Part2
bsr.w LoadTailsTailsDynPLC
movea.w parent(a0),a1 ; Move Tails' register to a1
move.w invulnerable_time(a1),d0 ; Move Tails' invulnerable time to d0
beq.s .display ; Is invulnerable_time 0? If so, always display his tails
addq.w #1,d0 ; Make d0 the same as old invulnerable_time's d0
lsr.w #3,d0 ; Shift bits to the right 3 times
bcc.s .return ; If the Carry bit is not set, branch and do not display Tails' tails
.display:
jmp (DisplaySprite).l ; Display Tails' tails
.return:
rts
Done.
Fix #3: Balancing fix
Not really a bug, though some people think his tails disappear. I always thought that the tails were behind his head, but if you do not like that, then go to "Obj05AniSelection:" and change this:
dc.b 0 ; TailsAni_Balance -> Blank
I recommend changing the 0 to a $A, but you can change it to whatever you like.
Fix #4: Looking up fix
Again, not really a bug, but his tails flicker when looking up. Fixing this is just as easy. In the same bit of code that we were in for fix 3, change this:
dc.b 2 ; TailsAni_LookUp -> Flick
Change that 2 to a 1 and it should be fine.
|Fix Tails subanimation error]]