Knuckles sliding and falling animations won't load

Discussion in 'Discussion and Q&A Archive' started by Animemaster, Apr 19, 2009.

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

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Edit: Guys! the ram adress suggested don't work! i still need someone to help me solve this!


    Well here i am with another puzzle that i can't sought.(although it maybe more simple than i think) when knuckles falls from glide or slide, he doesn't use the animtion i set for him. Instead he stills uses the glide animation, no matter what animation i change it too. Here is the whole gliding code:



    Code:
    Knuckles_GlideControl:				  ; ...
    
    
    
    ; FUNCTION CHUNK AT 00315C40 SIZE 0000003C BYTES
    
    
    
    		move.b	$21(a0),d0
    
    		beq.s	return_3156B8
    
    		cmp.b	#2,d0
    
    		beq.w	Knuckles_FallingFromGlide
    
    		cmp.b	#3,d0
    
    		beq.w	Knuckles_Sliding
    
    		
    
    
    
    Knuckles_NormalGlide:
    
    		move.b	#$A,$16(a0)
    
    		move.b	#$A,$17(a0)
    
    		bsr.w   sonic_floor
    
    		
    
    		move.b	#$13,$16(a0)
    
    		move.b	#9,$17(a0)
    
    		btst	#1,($FFFFF7AC).w
    
    		beq.s	Knuckles_BeginSlide
    
    		move.b	($FFFFF602).w,d0
    
    		and.b	#$70,d0
    
    		bne.s	loc_31574C
    
    		move.b	#2,$21(a0)
    
    		move.b	#$21,$1C(a0)
    
    		bclr	#0,$22(a0)
    
    		tst.w	$10(a0)
    
    		bpl.s	loc_315736
    
    		bset	#0,$22(a0)
    
    
    
    loc_315736:					  ; ...
    
    		asr	$10(a0)
    
    		asr	$10(a0)
    
    		move.b	#$13,$16(a0)
    
    		move.b	#9,$17(a0)
    
    		rts
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_31574C:					  ; ...
    
                    bra.w	sub_315C7C
    
    ; ---------------------------------------------------------------------------
    
    
    
    Knuckles_BeginSlide:				  ; ...
    
    		bclr	#0,$22(a0)
    
    		tst.w	$10(a0)
    
    		bpl.s	loc_315762
    
    		bset	#0,$22(a0)
    
    
    
    loc_315762:					  ; ...
    
    		move.b	$26(a0),d0
    
    		add.b	#$20,d0
    
    		and.b	#$3E,d0
    
    		beq.s	loc_315780
    
    		move.w	$14(a0),$10(a0)
    
    		move.w	#0,$12(a0)
    
    		bra.w	Sonic_ResetOnFloor
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_315780:					  ; ...
    
    		move.b	#3,$21(a0)
    
    		move.b	#$4A,$1A(a0)
    
    		move.b	#$7F,$1E(a0)
    
    		move.b	#0,$1B(a0)
    
    		
    
    		
    
    
    
    return_3157AC:					  ; ...
    
    		rts
    
    
    
    Knuckles_FallingFromGlide:			  ; ...
    
    		bsr.w	Sonic_ChgJumpDir
    
    		add.w	#$38,$12(a0)
    
    		btst	#6,$22(a0)
    
    		beq.s	loc_3158B2
    
    		sub.w	#$28,$12(a0)
    
    
    
    loc_3158B2:					  ; ...
    
    		bsr.w   sonic_floor
    
    		btst	#1,($FFFFF7AC).w
    
    		bne.s	return_315900
    
    		move.w	#0,$14(a0)
    
    		move.w	#0,$10(a0)
    
    		move.w	#0,$12(a0)
    
    		move.b	$16(a0),d0
    
    		sub.b	#$13,d0
    
    		ext.w	d0
    
    		add.w	d0,$C(a0)
    
    		move.b	$26(a0),d0
    
    		add.b	#$20,d0
    
    		and.b	#$3E,d0
    
    		beq.s	loc_3158F0
    
    		bra.w	Sonic_ResetOnFloor
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_3158F0:					  ; ...
    
    		bsr.w	Sonic_ResetOnFloor
    
    		move.w	#$F,$2E(a0)
    
    		move.b	#$22,$1C(a0)
    
    
    
    return_315900:					  ; ...
    
    		rts
    
    
    
    ; ---------------------------------------------------------------------------
    
    
    
    Knuckles_Sliding:				  ; ...
    
    		move.b	($FFFFF602).w,d0
    
    		and.b	#$70,d0
    
    		beq.s	loc_315926
    
    		tst.w	$10(a0)
    
    		bpl.s	loc_31591E
    
    		add.w	#$20,$10(a0)
    
    		bmi.s	loc_31591C
    
    		bra.s	loc_315926
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_31591C:					  ; ...
    
    		bra.s	loc_315958
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_31591E:					  ; ...
    
    		sub.w	#$20,$10(a0)
    
    		bpl.s	loc_315958
    
    
    
    loc_315926:					  ; ...
    
    		move.w	#0,$14(a0)
    
    		move.w	#0,$10(a0)
    
    		move.w	#0,$12(a0)
    
    		move.b	$16(a0),d0
    
    		sub.b	#$13,d0
    
    		ext.w	d0
    
    		add.w	d0,$C(a0)
    
    		bsr.w	Sonic_ResetOnFloor
    
    		move.w	#$F,$2E(a0)
    
    		move.b	#$23,$1C(a0)
    
    		rts
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_315958:					  ; ...
    
    		move.b	#$A,$16(a0)
    
    		move.b	#$A,$17(a0)
    
    		bsr.w	Sonic_Floor
    
    		bsr.w	Objhitfloor
    
    		cmp.w	#$E,d1
    
    		bge.s	loc_315988
    
    		add.w	d1,$C(a0)
    
    		move.b	d3,$26(a0)
    
    		move.b	#$13,$16(a0)
    
    		move.b	#9,$17(a0)
    
    		rts
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_315988:					  ; ...
    
    		move.b	#2,$21(a0)
    
    		move.b	#$21,$1C(a0)
    
    		move.b	#$13,$16(a0)
    
    		move.b	#9,$17(a0)
    
    		bset	#1,($FFFFF7AC).w
    
    		rts
    
    ; =============== S U B	R O U T	I N E =======================================
    
    
    
    
    
    sub_315C7C:					  ; ...
    
    		move.b	#$20,$1E(a0)
    
    		move.b	#0,$1B(a0)
    
    		move.w	#$2020,$1C(a0)
    
    		bclr	#5,$22(a0)
    
    		bclr	#0,$22(a0)
    
    		moveq	#0,d0
    
    		move.b	$1F(a0),d0
    
    		add.b	#$10,d0
    
    		lsr.w	#5,d0
    
    		move.b	byte_315CC2(pc,d0.w),d1
    
    		move.b	d1,$1A(a0)
    
    		cmp.b	#$42,d1
    
    		bne.s	return_315CC0
    
    		bset	#0,$22(a0)
    
    		move.b	#$3E,$1A(a0)
    
    
    
    return_315CC0:					  ; ...
    
    		rts
    
    ; End of function sub_315C7C
    
    
    
    ; ---------------------------------------------------------------------------
    
    byte_315CC2:	dc.b $3E,$3F,$40,$41,$42,$41,$40,$3F; 0	; ...
    
    ; =============== S U B	R O U T	I N E =======================================
    
    
    
    
    
    Knuckles_GlideSpeedControl:			  ; ...
    
    		cmp.b	#1,$21(a0)
    
    		bne.w	loc_315D88
    
    		move.w	$14(a0),d0
    
    		cmp.w	#$400,d0
    
    		bcc.s	loc_315CE2
    
    		addq.w	#8,d0
    
    		bra.s	loc_315CFC
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_315CE2:					  ; ...
    
    		cmp.w	#$1800,d0
    
    		bcc.s	loc_315CFC
    
    		move.b	$1F(a0),d1
    
    		and.b	#$7F,d1
    
    		bne.s	loc_315CFC
    
    		addq.w	#4,d0
    
    		tst.b	($FFFFFE19).w
    
    		beq.s	loc_315CFC
    
    		addq.w	#8,d0
    
    
    
    loc_315CFC:					  ; ...
    
    		move.w	d0,$14(a0)
    
    		move.b	$1F(a0),d0
    
    		btst	#2,($FFFFF602).w
    
    		beq.s	loc_315D1C
    
    		cmp.b	#$80,d0
    
    		beq.s	loc_315D1C
    
    		tst.b	d0
    
    		bpl.s	loc_315D18
    
    		neg.b	d0
    
    
    
    loc_315D18:					  ; ...
    
    		addq.b	#2,d0
    
    		bra.s	loc_315D3A
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_315D1C:					  ; ...
    
    		btst	#3,($FFFFF602).w
    
    		beq.s	loc_315D30
    
    		tst.b	d0
    
    		beq.s	loc_315D30
    
    		bmi.s	loc_315D2C
    
    		neg.b	d0
    
    
    
    loc_315D2C:					  ; ...
    
    		addq.b	#2,d0
    
    		bra.s	loc_315D3A
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_315D30:					  ; ...
    
    		move.b	d0,d1
    
    		and.b	#$7F,d1
    
    		beq.s	loc_315D3A
    
    		addq.b	#2,d0
    
    
    
    loc_315D3A:					  ; ...
    
    		move.b	d0,$1F(a0)
    
    		move.b	$1F(a0),d0
    
    		jsr	CalcSine
    
    		muls.w	$14(a0),d1
    
    		asr.l	#8,d1
    
    		move.w	d1,$10(a0)
    
    		cmp.w	#$80,$12(a0)
    
    		blt.s	loc_315D62
    
    		sub.w	#$20,$12(a0)
    
    		bra.s	loc_315D68
    
    ; ---------------------------------------------------------------------------
    
    
    
    loc_315D62:					  ; ...
    
    		add.w	#$20,$12(a0)
    
    
    
    loc_315D68:					  ; ...
    
    		move.w	($FFFFEECC).w,d0
    
    		cmp.w	#$FF00,d0
    
    		beq.w	loc_315D88
    
    		add.w	#$10,d0
    
    		cmp.w	$C(a0),d0
    
    		ble.w	loc_315D88
    
    		asr	$10(a0)
    
    		asr	$14(a0)
    
    
    
    loc_315D88:					  ; ...
    		cmp.w	#$60,($FFFFEED8).w
    		beq.s	return_315D9A
    		bcc.s	loc_315D96
    		addq.w	#4,($FFFFEED8).w
    
    loc_315D96:					  ; ...
    		subq.w	#2,($FFFFEED8).w
    
    return_315D9A:					  ; ...
    		rts
    ; End of function Knuckles_GlideSpeedControl
    				rts

    If you can help me it would be great thanks! really i mean i'm stumped with this.
     
    Last edited by a moderator: May 11, 2009
  2. Tornado

    Tornado Active Member Member

    Joined:
    Dec 1, 2008
    Messages:
    30
    Location:
    Hydrocity - Angel Island
    "byte_315CC2 :".....


    This changes the animations of Knuckles Gliding ... maybe this can help you.
     
  3. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Not to be rude Tornado but don't you think i already know that?! i mean copying the code over and unserstanding it and all =P. So no thats nothing to do woth the sliding or falling code.
     
  4. Hanoch

    Hanoch Well-Known Member Member

    Joined:
    Aug 3, 2008
    Messages:
    312
    Location:
    Israel
    $1A is the frame number in the mapping file. So open sonmaped and load art and shit and check for the frame number and change in the code to the frame number you want. Also, there is a part for loading the dust, did you remove it?
     
  5. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Again hanoc this doesn't help. I know what frames are, and i have done the right frames and the animations are set, but no matter what frame or animation i change it to it always loads the gliding animation. In order for me to explain a bit more so people understand is that i think its something to do with the code. But obviously i don't what, because i checked with Hitaxes and his is practically the same.
     
  6. Alriightyman

    Alriightyman I'm back! Member

    Joined:
    Oct 3, 2007
    Messages:
    156
    Location:
    USA
    Did you Rip it from Sonic 2 & Knuckles UpMem Disassembly? And are you porting it to Sonic 1 or 2?
     
  7. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    This is from sonic2k.asm, and its for sonic 1.
     
  8. Alriightyman

    Alriightyman I'm back! Member

    Joined:
    Oct 3, 2007
    Messages:
    156
    Location:
    USA
    I'm not that familar with Sonic 1 but, but I do know that RAM addresses are different between it and Sonic 2. And based on your code, you are still using the adresses referenced in S2K. I would say it may be a RAM address used in Sonic 1 that your Knuckles code is using.


    EDIT: $FFFFF7AC is already being used by Sonic 1. It has something to with loops. You need to change that and probably the other addresses to something that is unused in Sonic 1. I think $FFB0 is available. I would search here and retro for unused RAM addresses. I know there is a thread for it. Good Luck. :p
     
    Last edited by a moderator: Apr 25, 2009
  9. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Well i was told this is not specifically for sonic 2 or 2k. In other words i could port this sonic 1 and it work. But i guess i will try your way, although i did try address before and it still didn't work. But perhaps the address i used are alread used. I don't know this is really enoying.
     
  10. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Please help! it still won't work!
     
  11. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    To be honest its pretty tricky figuring out if its a ram address issue or if its related to your actual code without your ASM file - I understand that you wont want to put it up here becasue of size or because of prying eyes so I would say make a list of all used ram and then cross referance your knuckles code with the list to make sure. Hope you figure it.
     
  12. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Well guys I think knuckles will be removed from my hack, seems I can't figure out the problem and no one who have replied knows what is worng. Its not a ram adress I'm sure, But I do know its something to do with the ani file. I took the one from s2k, to test and his falling worked but still not his sliding. And then I put it back to my code and it doesn't work again. So you might aswell trash this.....
     
Thread Status:
Not open for further replies.