need help with 3 (separate) problems

Discussion in 'Discussion and Q&A Archive' started by Lil-G, Dec 16, 2014.

Thread Status:
Not open for further replies.
  1. Lil-G

    Lil-G Friendly Local Noob Root Admin

    Joined:
    Oct 21, 2014
    Messages:
    13
    Location:
    olathe, KS
    1. animation

    ok, so i'm trying to add a animation for when you jump on a spring. in the animation sub-routine i have the sprites created and it works. but when i add extra frames for spring animation it causes sonic's sprites to garble up and crash the game. here is the animation code

    Code:
    ; ---------------------------------------------------------------------------
    ; Animation script - Sonic
    ; ---------------------------------------------------------------------------
    ; off_1B618:
    SonicAniData: offsetTable
    SonAni_Walk_ptr: offsetTableEntry.w SonAni_Walk ; 0 ; 0
    SonAni_Run_ptr: offsetTableEntry.w SonAni_Run ; 1 ; 1
    SonAni_Roll_ptr: offsetTableEntry.w SonAni_Roll ; 2 ; 2
    SonAni_Roll2_ptr: offsetTableEntry.w SonAni_Roll2 ; 3 ; 3
    SonAni_Push_ptr: offsetTableEntry.w SonAni_Push ; 4 ; 4
    SonAni_Wait_ptr: offsetTableEntry.w SonAni_Wait ; 5 ; 5
    SonAni_Balance_ptr: offsetTableEntry.w SonAni_Balance ; 6 ; 6
    SonAni_LookUp_ptr: offsetTableEntry.w SonAni_LookUp ; 7 ; 7
    SonAni_Duck_ptr: offsetTableEntry.w SonAni_Duck ; 8 ; 8
    SonAni_Spindash_ptr: offsetTableEntry.w SonAni_Spindash ; 9 ; 9
    SonAni_Blink_ptr: offsetTableEntry.w SonAni_Blink ; 10 ; $A
    SonAni_GetUp_ptr: offsetTableEntry.w SonAni_GetUp ; 11 ; $B
    SonAni_Balance2_ptr: offsetTableEntry.w SonAni_Balance2 ; 12 ; $C
    SonAni_Stop_ptr: offsetTableEntry.w SonAni_Stop ; 13 ; $D
    SonAni_Float_ptr: offsetTableEntry.w SonAni_Float ; 14 ; $E
    SonAni_Float2_ptr: offsetTableEntry.w SonAni_Float2 ; 15 ; $F
    SonAni_Spring_ptr: offsetTableEntry.w SonAni_Spring ; 16 ; $10
    SonAni_Hang_ptr: offsetTableEntry.w SonAni_Hang ; 17 ; $11
    SonAni_Dash2_ptr: offsetTableEntry.w SonAni_Dash2 ; 18 ; $12
    SonAni_Dash3_ptr: offsetTableEntry.w SonAni_Dash3 ; 19 ; $13
    SonAni_Hang2_ptr: offsetTableEntry.w SonAni_Hang2 ; 20 ; $14
    SonAni_Bubble_ptr: offsetTableEntry.w SonAni_Bubble ; 21 ; $15
    SonAni_DeathBW_ptr: offsetTableEntry.w SonAni_DeathBW ; 22 ; $16
    SonAni_Drown_ptr: offsetTableEntry.w SonAni_Drown ; 23 ; $17
    SonAni_Death_ptr: offsetTableEntry.w SonAni_Death ; 24 ; $18
    SonAni_Hurt_ptr: offsetTableEntry.w SonAni_Hurt ; 25 ; $19
    SonAni_Hurt2_ptr: offsetTableEntry.w SonAni_Hurt ; 26 ; $1A
    SonAni_Slide_ptr: offsetTableEntry.w SonAni_Slide ; 27 ; $1B
    SonAni_Blank_ptr: offsetTableEntry.w SonAni_Blank ; 28 ; $1C
    SonAni_Balance3_ptr: offsetTableEntry.w SonAni_Balance3 ; 29 ; $1D
    SonAni_Balance4_ptr: offsetTableEntry.w SonAni_Balance4 ; 30 ; $1E
    SupSonAni_Transform_ptr: offsetTableEntry.w SupSonAni_Transform ; 31 ; $1F
    SonAni_Lying_ptr: offsetTableEntry.w SonAni_Lying ; 32 ; $20
    SonAni_LieDown_ptr: offsetTableEntry.w SonAni_LieDown ; 33 ; $21
    SonAni_springd_ptr: offsetTableEntry.w SonAni_springd ; 34 ; $22
    SonAni_Walk: dc.b $FF, $F,$10,$11,$12,$13,$14, $D, $E,$FF
    SonAni_Run: dc.b $FF,$2D,$2E,$2F,$30,$FF,$FF,$FF,$FF,$FF
    SonAni_Roll: dc.b $FE,$3D,$3E,$3F,$40,$FF
    SonAni_Roll2: dc.b $FE,$3D,$3E,$3F,$40,$FF
    SonAni_Push: dc.b $FD,$48,$49,$4A,$4B,$FF,$FF,$FF,$FF,$FF
    SonAni_Wait:
    dc.b 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    dc.b 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2
    dc.b 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 4, 4, 4, 5, 5
    dc.b 5, 4, 4, 4, 5, 5, 5, 4, 4, 4, 5, 5, 5, 6, 6, 6
    dc.b 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 5, 5, 5, 4, 4, 4
    dc.b 5, 5, 5, 4, 4, 4, 5, 5, 5, 4, 4, 4, 5, 5, 5, 6
    dc.b 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 5, 5, 5, 4
    dc.b 4, 4, 5, 5, 5, 4, 4, 4, 5, 5, 5, 4, 4, 4, 5, 5
    dc.b 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 5, 5
    dc.b 5, 4, 4, 4, 5, 5, 5, 4, 4, 4, 5, 5, 5, 4, 4, 4
    dc.b 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 8
    dc.b 8, 9, 9, 9,$FE, 6
    SonAni_Balance: dc.b $10,$CC,$CD,$FF
    SonAni_LookUp: dc.b 5, $B, $C,$FE, 1
    SonAni_Duck: dc.b 5,$4C,$4D,$FE, 1
    SonAni_Spindash:dc.b 2,$43,$44,$45,$46,$FF
    SonAni_Blink: dc.b 1, 2,$FD, 0
    SonAni_GetUp: dc.b 3, $A,$FD, 0
    SonAni_Balance2:dc.b 4,$C8,$C9,$CA,$FF
    SonAni_Stop: dc.b 5,$D2,$D3,$D4,$D5,$FD, 0 ; halt/skidding animation
    SonAni_Float: dc.b 7,$54,$59,$FF
    SonAni_Float2: dc.b 7,$54,$55,$56,$57,$58,$FF
    SonAni_Spring: dc.b $2F,$5B,$FD, 34
    SonAni_Hang: dc.b 1,$50,$51,$FF
    SonAni_Dash2: dc.b $F,$43,$43,$43,$FE, 1
    SonAni_Dash3: dc.b $F,$43,$44,$FE, 1
    SonAni_Hang2: dc.b $13,$6B,$6C,$FF
    SonAni_Bubble: dc.b $B,$5A,$5A,$11,$12,$FD, 0 ; breathe
    SonAni_DeathBW: dc.b $20,$5E,$FF
    SonAni_Drown: dc.b $20,$5D,$FF
    SonAni_Death: dc.b $20,$5C,$FF
    SonAni_Hurt: dc.b $40,$4E,$4F,$FF
    SonAni_Slide: dc.b 9,$4E,$4F,$FF
    SonAni_Blank: dc.b $77, 0,$FD, 0
    SonAni_Balance3:dc.b $A,$CF,$D0,$D1,$FF
    SonAni_Balance4:dc.b 3,$CF,$D0,$D1,$FE, 4
    SonAni_Lying: dc.b 9, 8, 9,$FF
    SonAni_LieDown: dc.b 3, 7,$FD, 0
    SonAni_springd: dc.b 9,$D6,$D7,$D8,$FF ;its this line that crashes
    
    even
    anyone know whats wrong here?
     2. weird bug when getting a life
    i have no idea where this bug came from. when you get a life (life monitor, rings, etc) it causes the game to fade out and go to the sega screen with all the art after the sega screen is garbled.
     
    i would put the code but i have no idea where the bug came from

     
    3. spindash sound broken
     i noticed that after changing the sprites (not the actual animations just sprites) the spindash noise stopped working. the sound works the first time you use it but after that it has no noise when reving
    the spindash code

    Code:
    ; ---------------------------------------------------------------------------
    
    ; Subroutine to check for starting to charge a spindash
    ; ---------------------------------------------------------------------------

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

    ; loc_1AC3E:
    Sonic_CheckSpindash:
    tst.b spindash_flag(a0)
    bne.s Sonic_UpdateSpindash
    cmpi.b #AniIDSonAni_Duck,anim(a0)
    bne.s return_1AC8C
    move.b (Ctrl_1_Press_Logical).w,d0
    andi.b #button_B_mask|button_C_mask|button_A_mask,d0
    beq.w return_1AC8C
    move.b #AniIDSonAni_Spindash,anim(a0)
    move.w #SndID_SpindashRev,d0
    jsr (PlaySound).l
    addq.l #4,sp
    move.b #1,spindash_flag(a0)
    move.w #0,spindash_counter(a0)
    cmpi.b #$C,air_left(a0) ; if he's drowning, branch to not make dust
    blo.s +
    move.b #2,(Sonic_Dust+anim).w
    +
    bsr.w Sonic_LevelBound
    bsr.w AnglePos

    return_1AC8C:
    rts
    ; End of subroutine Sonic_CheckSpindash


    ; ---------------------------------------------------------------------------
    ; Subrouting to update an already-charging spindash
    ; ---------------------------------------------------------------------------

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

    ; loc_1AC8E:
    Sonic_UpdateSpindash:
    move.b (Ctrl_1_Held_Logical).w,d0
    btst #button_down,d0
    bne.w Sonic_ChargingSpindash

    ; unleash the charged spindash and start rolling quickly:
    move.b #$E,y_radius(a0)
    move.b #7,x_radius(a0)
    move.b #AniIDSonAni_Roll,anim(a0)
    addq.w #5,y_pos(a0) ; add the difference between Sonic's rolling and standing heights
    move.b #0,spindash_flag(a0)
    moveq #0,d0
    move.b spindash_counter(a0),d0
    add.w d0,d0
    move.w SpindashSpeeds(pc,d0.w),inertia(a0)
    tst.b (Super_Sonic_flag).w
    beq.s +
    move.w SpindashSpeedsSuper(pc,d0.w),inertia(a0)
    +
    move.w inertia(a0),d0
    subi.w #$800,d0
    add.w d0,d0
    andi.w #$1F00,d0
    neg.w d0
    addi.w #$2000,d0
    move.w d0,(Horiz_scroll_delay_val).w
    btst #0,status(a0)
    beq.s +
    neg.w inertia(a0)
    +
    bset #2,status(a0)
    move.b #0,(Sonic_Dust+anim).w
    move.w #SndID_SpindashRelease,d0 ; spindash zoom sound
    jsr (PlaySound).l
    bra.s Obj01_Spindash_ResetScr
    ; ===========================================================================
    ; word_1AD0C:
    SpindashSpeeds:
    dc.w $800 ; 0
    dc.w $880 ; 1
    dc.w $900 ; 2
    dc.w $980 ; 3
    dc.w $A00 ; 4
    dc.w $A80 ; 5
    dc.w $B00 ; 6
    dc.w $B80 ; 7
    dc.w $C00 ; 8
    ; word_1AD1E:
    SpindashSpeedsSuper:
    dc.w $B00 ; 0
    dc.w $B80 ; 1
    dc.w $C00 ; 2
    dc.w $C80 ; 3
    dc.w $D00 ; 4
    dc.w $D80 ; 5
    dc.w $E00 ; 6
    dc.w $E80 ; 7
    dc.w $F00 ; 8
    ; ===========================================================================
    ; loc_1AD30:
    Sonic_ChargingSpindash: ; If still charging the dash...
    tst.w spindash_counter(a0)
    beq.s +
    move.w spindash_counter(a0),d0
    lsr.w #5,d0
    sub.w d0,spindash_counter(a0)
    bcc.s +
    move.w #0,spindash_counter(a0)
    +
    move.b (Ctrl_1_Press_Logical).w,d0
    andi.b #button_B_mask|button_C_mask|button_A_mask,d0
    beq.w Obj01_Spindash_ResetScr
    move.w #(AniIDSonAni_Spindash<< 8),anim(a0)
    move.w #SndID_SpindashRev,d0
    jsr (PlaySound).l
    addi.w #$200,spindash_counter(a0)
    cmpi.w #$800,spindash_counter(a0)
    blo.s Obj01_Spindash_ResetScr
    move.w #$800,spindash_counter(a0)

    ; loc_1AD78:
    Obj01_Spindash_ResetScr:
    addq.l #4,sp
    cmpi.w #$60,(Camera_Y_pos_bias).w
    beq.s loc_1AD8C
    bhs.s +
    addq.w #4,(Camera_Y_pos_bias).w
    + subq.w #2,(Camera_Y_pos_bias).w

    loc_1AD8C:
    bsr.w Sonic_LevelBound
    bsr.w AnglePos
    rts
    ; End of subroutine Sonic_UpdateSpindash

    4 not really a problem but something i need help with

    i'm going to resprite tails but his tails are combined with his sprite.

    is there anyway to "disable" tail's tails? i think i might have to comment out the routine to create that object, but i don't know if that will work

    that won't work, i'll need to disable and re-enable his tails under certain conditions.
     
    Last edited by a moderator: Dec 19, 2014
  2. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    ok well I know I will get blasted for saying this but the main problem is your using the SVN version - I have no clue as I only use the older stuff as it how I was taught... just out of curiosity try doing the animation on a older version and see what happens. Sorry I couldnt be more help.
     
  3. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    No, SVN version has nothing to do with it. I too find the older version easier to work with, but that's personal preference, not because the SVN is some kind of broken mess. Discouraging anyone from using it does nothing to help the person.
     
    Last edited by a moderator: Dec 17, 2014
  4. Lil-G

    Lil-G Friendly Local Noob Root Admin

    Joined:
    Oct 21, 2014
    Messages:
    13
    Location:
    olathe, KS
    oh, i forgot to add that i have the clone driver installed (v2.2.4.1b)
     
  5. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016

    HMM
     
  6. Lil-G

    Lil-G Friendly Local Noob Root Admin

    Joined:
    Oct 21, 2014
    Messages:
    13
    Location:
    olathe, KS
    i did free up ram its just when i tried to make it use $600 it would say the ram was overflowed (after removing the things you suggested in the guide) and when i removed almost all of the unused ram addresses it gave me 200 2002 warnings about the addresses being unaligned, although now that i think about it i could probably just added a even to fix that. i'll see if that works. sorry if i made a stupid mistake, i'm a noob at ASM right now

    edit: ok setting it to $5A0 fixed it

    edit 2:wait, how did you know that the amount of ram i set it to was $500? i did't post that part of the code?
     
    Last edited by a moderator: Dec 17, 2014
  7. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    I was just giving my opinion stephen - I never said it was a mess just that I find it hard to use so dont tend to bother with it.
     
  8. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    You said using it was the problem. That was misleading as it is not the problem. Expressing an opinion on something is fine, just don't use that bias to mislead someone, that's all.
     
Thread Status:
Not open for further replies.