How to fix Tails' tails display behaviour (S2 & S3K)

Discussion in 'Tutorials Archive' started by redhotsonic, Sep 8, 2012.

Thread Status:
Not open for further replies.
  1. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Here's a quick one for you lot. This isn't a bug as such, more like... a design change. 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.


    [​IMG]


    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 both games.


    Sonic 2 fix - Xenowhirl and SVN Disassemblies


    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 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


    lea (MainCharacter).w,a1 ; Load MainCharacter into a1


    cmpi.w #2,(Player_mode).w ; Is it a Tails Alone game?


    beq.s + ; If so, branch and skip next command


    lea (Sidekick).w,a1 ; Tails must be a sidekick. Load Sidekick into a1 instead


    +


    move.w invulnerable_time(a1),d0 ; Move Tails' invulnerable time to d0


    beq.s + ; 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


    bcs.s + ; If the Carry bit is set, branch and display his tails


    rts ; Otherwise, do not display Tails' tails


    +


    jmp (DisplaySprite).l ; Display Tails' tails



    Done.


    Sonic 3 and Knuckles fix - SVN Disassembly


    Go to "loc_1615A:" and you should see this:



    loc_1615A:
    bsr.w Tails_Tail_Load_PLC


    jmp (Draw_Sprite).l



    This is where Tails' Tails object gets animated and displayed. Change all this to:



    loc_1615A:
    bsr.w Tails_Tail_Load_PLC


    lea ($FFFFB000).w,a1 ; Load MainCharacter into a1


    cmpi.w #2,($FFFFFF08).w ; Is it a Tails Alone game?


    beq.s + ; If so, branch and skip next command


    lea ($FFFFB04A).w,a1 ; Tails must be a sidekick. Load Sidekick into a1 instead


    +


    move.b $34(a1),d0 ; Move Tails' invulnerable time to d0


    beq.s + ; Is invulnerable_time 0? If so, always display his tails


    addq.b #1,d0 ; Make d0 the same as old invulnerable_time's d0


    lsr.b #3,d0 ; Shift bits to the right 3 times


    bcs.s + ; If the Carry bit is set, branch and display his tails


    rts ; Otherwise, do not display Tails' tails


    +


    jmp (Draw_Sprite).l ; Display Tails' tails



    Done.


    You should now end up seeing Tails like this:


    [​IMG]


    Ta-dah!
     
    Last edited by a moderator: Sep 9, 2012
  2. Mike B Berry

    Mike B Berry A grandiose return Member

    Joined:
    Jun 6, 2012
    Messages:
    377
    Location:
    New places, newer motivation
    You know that has always pissed me off. Could I ask if the same thing happened in the demos of the game? I never paid that much attention to that situation in the betas.
     
    Last edited by a moderator: Sep 8, 2012
  3. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    First post been updated. I should of realised Tails was already loaded in a2, so there was no point loading him into a1 then comparing maincharacter. Anyway, enjoy!


    EDIT: Actually, a2 gets over-written, put it back to normal. Sorry, guys
     
    Last edited by a moderator: Sep 9, 2012
Thread Status:
Not open for further replies.