Tails flight problem

Discussion in 'Discussion and Q&A Archive' started by Tornado, Feb 16, 2009.

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

    Tornado Active Member Member

    Joined:
    Dec 1, 2008
    Messages:
    30
    Location:
    Hydrocity - Angel Island
    Hey, I wonder if anyone can help me, because I tried in various ways, but in vain.


    Below follows the code. If anyone knows where the problem will have its due credit. :downs:



    Tails_Test_For_Flight:
    tst.b $2F(a0)


    bne.w locret_151A2


    move.b (Ctrl_1_Press).w,d0 ; read controller


    andi.b #$70,d0 ; pressing A/B/C ?


    beq.w locret_151A2 ; if not, return


    cmpi.w #2,($FFFFFF08).w


    bne.s loc_15156


    tst.b (Status_Secondary).w


    bne.s loc_1515C


    cmpi.b #7,(Emerald_count).w


    bcs.s loc_1515C


    cmpi.w #$32,(Ring_Count).w


    bcs.s loc_1515C


    tst.b (Update_HUD_timer).w


    bne.s JmpTo_Sonic_CheckGoSuper


    bra.s loc_1515C


    JmpTo_Sonic_CheckGoSuper:


    jmp Sonic_CheckGoSuper


    ; ===========================================================================


    loc_15156:


    tst.w (Tails_control_counter).w


    beq.s locret_151A2


    loc_1515C:


    btst #2,$2A(a0)


    beq.s loc_1518C


    bclr #2,$2A(a0)


    move.b $1E(a0),d1


    move.b $44(a0),$1E(a0)


    move.b $45(a0),$1F(a0)


    sub.b $44(a0),d1


    ext.w d1


    tst.b (obj_control).w


    beq.s loc_15188


    neg.w d0


    loc_15188:


    add.w d1,$14(a0)


    loc_1518C:


    bclr #4,$2A(a0)


    move.b #1,$2F(a0)


    move.b #-$10,$25(a0)


    bsr.w Tails_Set_Flying_Animation


    locret_151A2:


    rts


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    Tails_Set_Flying_Animation:


    btst #6,$2A(a0)


    bne.s loc_14914


    moveq #$20,d0


    tst.w ($FFFFFFE8).w


    bne.s loc_148F4


    tst.w $1A(a0)


    bpl.s loc_148C4


    moveq #$21,d0


    loc_148C4:


    tst.b ($FFFFF73E).w


    beq.s loc_148CC


    addq.b #2,d0


    loc_148CC:


    tst.b $25(a0)


    bne.s loc_148F4


    moveq #$24,d0


    move.b d0,$20(a0)


    tst.b 4(a0)


    bpl.s locret_148F2


    move.b ($FFFFFE05).w,d0


    addq.b #8,d0


    andi.b #$F,d0


    bne.s locret_148F2


    moveq #-$45,d0


    jsr (PlaySound).l


    locret_148F2:


    rts


    ; ===========================================================================


    loc_148F4:


    move.b d0,$20(a0)


    tst.b 4(a0)


    bpl.s locret_14912


    move.b ($FFFFFE05).w,d0


    addq.b #8,d0


    andi.b #$F,d0


    bne.s locret_14912


    moveq #-$46,d0


    jsr (PlaySound).l


    locret_14912:


    rts


    ; ===========================================================================


    loc_14914:


    moveq #$25,d0


    tst.w $1A(a0)


    bpl.s loc_1491E


    moveq #$26,d0


    loc_1491E:


    tst.b ($FFFFF73E).w


    beq.s loc_14926


    moveq #$27,d0


    loc_14926:


    tst.b $25(a0)


    bne.s loc_1492E


    moveq #$28,d0


    loc_1492E:


    move.b d0,$20(a0)


    rts


    ; End of function Tails_Set_Flying_Animation



    And in Tails_Jumpheight:



    Tails_JumpHeight:
    tst.b jumping(a0) ; is Tails jumping?


    beq.s Tails_UpVelCap ; if not, branch


    move.w #-$400,d1


    btst #6,status(a0) ; is Tails underwater?


    beq.s + ; if not, branch


    move.w #-$200,d1


    +


    cmp.w y_vel(a0),d1 ; is Tails going up faster than d1?


    ble.s Tails_Test_For_Flight ; if not, branch (Tails_Test_For_Flight in Sonic 3)


    move.b (Ctrl_2_Held_Logical).w,d0


    andi.b #$70,d0 ; is a jump button pressed?


    bne.s + ; if yes, branch


    move.w d1,y_vel(a0) ; immediately reduce Tails's upward speed to d1


    +


    rts


    ; ---------------------------------------------------------------------------


    ; loc_1C6F8:


    Tails_UpVelCap:


    tst.b spindash_flag(a0) ; is Tails charging a spindash or in a rolling-only area?


    bne.s return_1C70C ; if yes, return


    cmpi.w #-$FC0,y_vel(a0) ; is Tails moving up really fast?


    bge.s return_1C70C ; if not, return


    move.w #-$FC0,y_vel(a0) ; cap upward speed


    return_1C70C:


    rts


    ; End of subroutine Tails_JumpHeight



    Well, like I said, it was in vain, but I hope someone can help me.


    Note: This code is for the Sonic 2.
     
    Last edited by a moderator: Feb 16, 2009
  2. Alriightyman

    Alriightyman I'm back! Member

    Joined:
    Oct 3, 2007
    Messages:
    156
    Location:
    USA
    It's simple, you need to convert sonic 3 sst to sonic 2 sst. For example, $2A(ax) in Sonic 3 is status. In Sonic 2, Status is $22(ax). So you would change $2A(ax) to $22(ax) [note: x would be any number from 0 to 7]. Check this for Sonic 2, and this for Sonic 3 for a list of all the SSTs. Those should help you out.
     
    Last edited by a moderator: Feb 17, 2009
  3. Tornado

    Tornado Active Member Member

    Joined:
    Dec 1, 2008
    Messages:
    30
    Location:
    Hydrocity - Angel Island
    Thanks Alriightyman,I will try to do it again. Thanks again.
     
Thread Status:
Not open for further replies.