S1 Custom Abilities.Need Guidance.HELP!

Discussion in 'Discussion and Q&A Archive' started by midgetonebeta, Nov 6, 2008.

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

    midgetonebeta Newcomer Trialist

    Joined:
    Oct 27, 2008
    Messages:
    4
    im trying to write my own Custom Attack. Even though it was stated " it's friggin cliche though.. x.x " By a friend a mines. Im trying to port Super Peel out.


    So im trying to make my own code so i can get used to the Asm code. And For starters dont ask me to Read 11 pages of code reading not working to much im the hands on type.


    this is my code so far : I want it to use the running animation so i can change it to the Peel out animation im drawing out. This is also gona all be covered in my Next tutorial I got the Ok from Shobiz to use his Button Press Data. So in Savior for these projects i would appreciate some help.. Thanks in advance to who ever reply.


    Sonic_Speeddash:


    tst.b $39(a0) ; already spindashing?


    bne.s loc4_1AC8E ; if set, branch


    cmpi.b #7,$1C(a0) ; is anim duck


    bne.s locret4_1AC8C ; if not, return


    move.b ($FFFFF603).w,d0 ; read controller


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


    beq.w locret4_1AC8C ; if not, return


    move.b #$1F,$1C(a0) ; set spindash anim (9 in s2)


    move.w #$D1,d0 ; spin sound ($E0 in s2)


    jsr (PlaySound_Special).l ; play spin sound


    addq.l #4,sp ; increment stack ptr


    move.b #1,$39(a0) ; set spindash flag


    move.w #0,$3A(a0) ; set charge count to 0


    cmpi.b #$C,$28(a0) ; ??? oxygen remaining?


    move.b #2,($FFFFD1DC).w ; Set the spindash dust animation to $2


    loc4_1AC84:


    bsr.w Sonic_LevelBound


    bsr.w Sonic_AnglePos


    locret4_1AC8C:


    rts


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


    loc4_1AC8E:


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


    move.b ($FFFFF602).w,d0 ; read controller


    btst #1,d0 ; check down button


    bne.w loc4_1AD30 ; if set, branch


    move.b #$E,$16(a0) ; $16(a0) is height/2


    move.b #7,$17(a0) ; $17(a0) is width/2


    move.b #2,$1C(a0) ; set animation to roll


    addq.w #5,$C(a0) ; $C(a0) is Y coordinate


    move.b #0,$39(a0) ; clear spindash flag


    moveq #0,d0


    move.b $3A(a0),d0 ; copy charge count


    add.w d0,d0 ; double it


    move.w spdsh_norm2(pc,d0.w),$14(a0) ; get normal speed


    tst.b ($FFFFFE19).w ; is sonic super?


    beq.s loc4_1ACD0 ; if no, branch


    move.w spdsh_super2(pc,d0.w),$14(a0) ; get super speed


    loc4_1ACD0: ; TODO: figure this out


    move.w $14(a0),d0 ; get inertia


    subi.w #$800,d0 ; subtract $800


    add.w d0,d0 ; double it


    andi.w #$1F00,d0 ; mask it against $1F00


    neg.w d0 ; negate it


    addi.w #$2000,d0 ; add $2000


    move.w d0,($FFFFC904).w ; move to $EED0


    btst #0,$22(a0) ; is sonic facing right?


    beq.s loc4_1ACF4 ; if not, branch


    neg.w $14(a0) ; negate inertia


    loc4_1ACF4:


    bset #2,$22(a0) ; set unused (in s1) flag


    move.b #0,($FFFFD1DC).w ; clear spindash dust animation


    move.w #$BC,d0 ; spin release sound


    jsr (PlaySound_Special).l ; play it!


    bra.s loc4_1AD78


    ;
     
    Last edited by a moderator: Nov 6, 2008
Thread Status:
Not open for further replies.