the missing spindust???

Discussion in 'Discussion and Q&A Archive' started by warr1or2, Apr 29, 2011.

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

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    0:34-0:35 the spindust is missing in my hack. i had it on there but must've messed something up when trying to make a basic peelout
    the code



    Code:
    if _SPINDASH_
    
    Sonic_SpinDash:
    
    		tst.b	$39(a0)		&#59; already Spin Dashing?
    
    		bne.s	SpinDash_Process&#59; if yes, branch
    
    		cmpi.b	#8,$1C(a0)	&#59; is animation Duck?
    
    		bne.s	Sonic_SpinDash_Rts&#59; if not, branch
    
    		tpress	A,(SonicControl)&#59; is A, B or C pressed?
    
    		beq.w	Sonic_SpinDash_Rts&#59; if not, branch
    
    				move.b	#$1F,$1C(a0)	&#59; use Spin Dash animation
    
    		move.w	#$FD1,d0
    
    		jsr	(PlaySound_Special).l
    
    		addq.l	#4,sp		&#59; avoid Sonic_Jump call
    
    		move.b	#1,$39(a0)	&#59; set Spin Dash flag
    
    		move.w	#0,$3A(a0)
    
    		bsr.w	Sonic_LevelBound
    
    		bsr.w	Sonic_AnglePos
    
     
    
    Sonic_SpinDash_Rts:
    
    		rts	
    
    ; ---------------------------------------------------------------------------
    
     
    
    SpinDash_Process:
    
    				move.b	#$1F,$1C(a0)	&#59; use Spin Dash animation
    
    		move.b	(SonicControl|Held),d0&#59; load held buttons bitfield to d0
    
    		btst	#iDown,d0	&#59; is Down held?
    
    		bne.w	SpinDash_Charge	&#59; if yes, branch
    
    		
    
    SpinDash_Release:
    
    		move.b	#$E,$16(a0)	&#59; decrease Sonic's height
    
    		move.b	#7,$17(a0)
    
    		move.b	#2,$1C(a0)	&#59; use rolling animation
    
    		addq.w	#5,$C(a0)	&#59; add 5 to Y coordinate
    
    		move.b	#0,$39(a0)	&#59; clear Spin Dash flag
    
    		moveq	#0,d0
    
    		move.b	$3A(a0),d0
    
    		add.w	d0,d0
    
    		move.w	DashSpeeds(pc,d0.w),$14(a0)&#59; get Spin Dash speed
    
    		btst	#0,$22(a0)	&#59; is Sonic facing right?
    
    		beq.s	SpinDash_ReleaseSound&#59; if yes, branch
    
    		neg.w	$14(a0)		&#59; negate inertia
    
    
    
    SpinDash_ReleaseSound:
    
    		bset	#2,$22(a0)
    
    		move.w	#$BC,d0
    
    		jsr	(PlaySound_Special).l
    
    		bra.s	loc2_1AD78
    
    
    
    ; ---------------------------------------------------------------------------
    
    DashSpeeds:	dc.w  $800	&#59; 0
    
    		dc.w  $880	&#59; 1
    
    		dc.w  $900	&#59; 2
    
    		dc.w  $980	&#59; 3
    
    		dc.w  $A00	&#59; 4
    
    		dc.w  $A80	&#59; 5
    
    		dc.w  $B00	&#59; 6
    
    		dc.w  $B80	&#59; 7
    
    		dc.w  $C00	&#59; 8
    
    ; ---------------------------------------------------------------------------
    
    
    
    SpinDash_Charge:
    
    		tst.w	$3A(a0)	&#59; test charge counter
    
    		beq.s	loc2_1AD48&#59; if it's zero, branch
    
    		move.w	$3A(a0),d0&#59; move it to d0
    
    		lsr.w	#5,d0	&#59; divide by 32
    
    		sub.w	d0,$3A(a0)
    
    		bcc.s	loc2_1AD48
    
    		move.w	#0,$3A(a0)
    
     
    
    loc2_1AD48:
    
    		tpress	A+B+C,(SonicControl)
    
    		beq.w	loc2_1AD78
    
    		move.w	#$1F00,$1C(a0)
    
    		move.w	#$D1,d0
    
    		jsr	(PlaySound_Special).l
    
    		addi.w	#$200,$3A(a0)
    
    		cmpi.w	#$800,$3A(a0)
    
    		bcs.s	loc2_1AD78
    
    		move.w	#$800,$3A(a0)
    
     
    
    loc2_1AD78:
    
    		addq.l	#4,sp	&#59; avoid Sonic_Jump call
    
    		cmpi.w	#$60,($FFFFEED8).w
    
    		beq.s	loc2_1AD8C
    
    		bcc.s	loc2_1AD88
    
    		addq.w	#4,($FFFFEED8).w
    
     
    
    loc2_1AD88:
    
    		subq.w	#2,($FFFFEED8).w
    
     
    
    loc2_1AD8C:
    
    		bsr.w	Sonic_LevelBound
    
    		bsr.w	Sonic_AnglePos
    
    		move.w	#$60,($FFFFF73E).w&#59; reset looking up/down
    
    		rts					 
    
    		endc
    
    ; End of subroutine Sonic_Spin_Dash
    i've tried everytning
     
    Last edited by a moderator: Apr 29, 2011
  2. Crash

    Crash Well-Known Member Member

    Joined:
    Jul 15, 2010
    Messages:
    302
    Location:
    Australia
    You need to set the spindash dust object's animation to #2 to make it appear.
     
  3. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    Code:
    Obj05:
    
    	if _SPINDASH_=0
    
    		rts
    
    	else
    
    		moveq	#0,d0
    
    		move.b	$24(a0),d0
    
    		move.w	Obj05_Index(pc,d0.w),d1
    
    		jmp	Obj05_Index(pc,d1.w)
    
    
    
    ; ===========================================================================
    
    Obj05_Index:	dc.w Obj05_Main-Obj05_Index&#59; 0
    
    		dc.w Obj05_Dust-Obj05_Index&#59; 2
    
    
    
    ; ===========================================================================
    
    Obj05_Main:
    
    		addq.b	#2,$24(a0)
    
    		move.l	#Map_Obj05,4(a0)
    
    		move.b	#4,1(a0)
    
    		move.b	#1,$18(a0)
    
    		move.b	#$10,$19(a0)
    
    		move.w	#$7A0,2(a0)
    
    		move.w	#$F400,$3C(a0)&#59; VRAM destination for DMA
    
    
    
    ; ===========================================================================
    
    Obj05_Dust:
    
    		lea	($FFFFD000).w,a2; load Sonic object
    
    		cmpi.b	#6,$24(a2)&#59; is Sonic dying?
    
    		bcc.s   Obj05_Rts&#59; if yes, branch
    
    		tst.b	$39(a2)	&#59; is Sonic Spin Dashing?
    
    		beq.s	Obj05_Rts&#59; if not, branch
    
    		move.b	1(a2),1(a0)
    
    		move.w	8(a2),8(a0)
    
    		move.w	$C(a2),$C(a0)
    
    		move.b	$22(a2),$22(a0)
    
    		andi.b	#1,$22(a0)
    
    
    
    Obj05_Display:
    
    		lea	(Ani_Obj05).l,a1
    
    		jsr	AnimateSprite
    
    		bsr.s	Load_SpinDust_DPLC
    
    		bra.w	DisplaySprite
    
    
    
    Obj05_Rts:
    
    		rts
    
    ; ===========================================================================
    
    
    
    Load_SpinDust_DPLC:
    
    		moveq	#0,d0
    
    		move.b	$1A(a0),d0
    
    		cmp.b	$30(a0),d0
    
    		beq.w	locret_1DF36
    
    		move.b	d0,$30(a0)
    
    		lea	(off_1E074).l,a2
    
    		add	d0,d0
    
    		add	(a2,d0.w),a2
    
    		move	(a2)+,d5
    
    		subq	#1,d5
    
    		bmi.w	locret_1DF36
    
    		move.w	$3C(a0),d4&#59; load VRAM destination
    
     
    
    loc_1DF0A:
    
    		moveq	#0,d1
    
    		move.w	(a2)+,d1
    
    		move.w	d1,d3
    
    		lsr.w	#8,d3
    
    		andi.w	#$F0,d3
    
    		addi.w	#$10,d3
    
    		andi.w	#$FFF,d1
    
    		lsl.l	#5,d1
    
    		add.l	#Art_Dust,d1
    
    		move	d4,d2
    
    		add	d3,d4
    
    		add	d3,d4
    
    		jsr	(QueueDMATransfer).l
    
    		dbf	d5,loc_1DF0A
    
    		rts
    
     
    
    locret_1DF36:
    
    		rts	
    
    
    
    ; ===========================================================================
    
    Ani_Obj05:	dc.w byte_1DF4F-Ani_Obj05
    
    byte_1DF4F:	dc.b 1, $A, $B, $C, $D, $E, $F, $10, $FF
    
    		even
    
    
    
    ; -------------------------------------------------------------------------------
    
    ; Sprite Mappings - Spin Dust
    
    ; -------------------------------------------------------------------------------
    
    Map_Obj05:
    
    	dc.w word_1DF8A-Map_Obj05; 0
    
    	dc.w word_1DF8C-Map_Obj05; 1
    
    	dc.w word_1DF96-Map_Obj05; 2
    
    	dc.w word_1DFA0-Map_Obj05; 3
    
    	dc.w word_1DFAA-Map_Obj05; 4
    
    	dc.w word_1DFB4-Map_Obj05; 5
    
    	dc.w word_1DFBE-Map_Obj05; 6
    
    	dc.w word_1DFC8-Map_Obj05; 7
    
    	dc.w word_1DFD2-Map_Obj05; 8
    
    	dc.w word_1DFDC-Map_Obj05; 9
    
    	dc.w word_1DFE6-Map_Obj05; 10
    
    	dc.w word_1DFF0-Map_Obj05; 11
    
    	dc.w word_1DFFA-Map_Obj05; 12
    
    	dc.w word_1E004-Map_Obj05; 13
    
    	dc.w word_1E016-Map_Obj05; 14
    
    	dc.w word_1E028-Map_Obj05; 15
    
    	dc.w word_1E03A-Map_Obj05; 16
    
    	dc.w word_1E04C-Map_Obj05; 17
    
    	dc.w word_1E056-Map_Obj05; 18
    
    	dc.w word_1E060-Map_Obj05; 19
    
    	dc.w word_1E06A-Map_Obj05; 20
    
    	dc.w word_1DF8A-Map_Obj05; 21
    
    word_1DF8A:	dc.b 0
    
    word_1DF8C:	dc.b 1
    
    		dc.b $F2, $0D, $0, 0,$F0; 0
    
    word_1DF96:	dc.b 1
    
    		dc.b $E2, $0F, $0, 0,$F0; 0
    
    word_1DFA0:	dc.b 1
    
    		dc.b $E2, $0F, $0, 0,$F0; 0
    
    word_1DFAA:	dc.b 1
    
    		dc.b $E2, $0F, $0, 0,$F0; 0
    
    word_1DFB4:	dc.b 1
    
    		dc.b $E2, $0F, $0, 0,$F0; 0
    
    word_1DFBE:	dc.b 1
    
    		dc.b $E2, $0F, $0, 0,$F0; 0
    
    word_1DFC8:	dc.b 1
    
    		dc.b $F2, $0D, $0, 0,$F0; 0
    
    word_1DFD2:	dc.b 1
    
    		dc.b $F2, $0D, $0, 0,$F0; 0
    
    word_1DFDC:	dc.b 1
    
    		dc.b $F2, $0D, $0, 0,$F0; 0
    
    word_1DFE6:	dc.b 1
    
    		dc.b $4, $0D, $0, 0,$E0; 0
    
    word_1DFF0:	dc.b 1
    
    		dc.b $4, $0D, $0, 0,$E0; 0
    
    word_1DFFA:	dc.b 1
    
    		dc.b $4, $0D, $0, 0,$E0; 0
    
    word_1E004:	dc.b 2
    
    		dc.b $F4, $01, $0, 0,$E8; 0
    
    		dc.b $4, $0D, $0, 2,$E0; 4
    
    word_1E016:	dc.b 2
    
    		dc.b $F4, $05, $0, 0,$E8; 0
    
    		dc.b $4, $0D, $0, 4,$E0; 4
    
    word_1E028:	dc.b 2
    
    		dc.b $F4, $09, $0, 0,$E0; 0
    
    		dc.b $4, $0D, $0, 6,$E0; 4
    
    word_1E03A:	dc.b 2
    
    		dc.b $F4, $09, $0, 0,$E0; 0
    
    		dc.b $4, $0D, $0, 6,$E0; 4
    
    word_1E04C:	dc.b 1
    
    		dc.b $F8, $05, $0, 0,$F8; 0
    
    word_1E056:	dc.b 1
    
    		dc.b $F8, $05, $0, 4,$F8; 0
    
    word_1E060:	dc.b 1
    
    		dc.b $F8, $05, $0, 8,$F8; 0
    
    word_1E06A:	dc.b 1
    
    		dc.b $F8, $05, $0, $C,$F8; 0
    
    		dc.b 0
    
     
    
    ; -------------------------------------------------------------------------------
    
    ; Dynamic Pattern Load Cues - Spin Dust
    
    ; -------------------------------------------------------------------------------
    
    
    
    off_1E074:	dc word_1E0A0-off_1E074; 0
    
    	dc word_1E0A2-off_1E074; 1
    
    	dc word_1E0A6-off_1E074; 2
    
    	dc word_1E0AA-off_1E074; 3
    
    	dc word_1E0AE-off_1E074; 4
    
    	dc word_1E0B2-off_1E074; 5
    
    	dc word_1E0B6-off_1E074; 6
    
    	dc word_1E0BA-off_1E074; 7
    
    	dc word_1E0BE-off_1E074; 8
    
    	dc word_1E0C2-off_1E074; 9
    
    	dc word_1E0C6-off_1E074; 10
    
    	dc word_1E0CA-off_1E074; 11
    
    	dc word_1E0CE-off_1E074; 12
    
    	dc word_1E0D2-off_1E074; 13
    
    	dc word_1E0D8-off_1E074; 14
    
    	dc word_1E0DE-off_1E074; 15
    
    	dc word_1E0E4-off_1E074; 16
    
    	dc word_1E0EA-off_1E074; 17
    
    	dc word_1E0EA-off_1E074; 18
    
    	dc word_1E0EA-off_1E074; 19
    
    	dc word_1E0EA-off_1E074; 20
    
    	dc word_1E0EC-off_1E074; 21
    
    word_1E0A0:	dc 0
    
    word_1E0A2:	dc 1
    
    	dc $7000
    
    word_1E0A6:	dc 1
    
    	dc $F008
    
    word_1E0AA:	dc 1
    
    	dc $F018
    
    word_1E0AE:	dc 1
    
    	dc $F028
    
    word_1E0B2:	dc 1
    
    	dc $F038
    
    word_1E0B6:	dc 1
    
    	dc $F048
    
    word_1E0BA:	dc 1
    
    	dc $7058
    
    word_1E0BE:	dc 1
    
    	dc $7060
    
    word_1E0C2:	dc 1
    
    	dc $7068
    
    word_1E0C6:	dc 1
    
    	dc $7070
    
    word_1E0CA:	dc 1
    
    	dc $7078
    
    word_1E0CE:	dc 1
    
    	dc $7080
    
    word_1E0D2:	dc 2
    
    	dc $1088
    
    	dc $708A
    
    word_1E0D8:	dc 2
    
    	dc $3092
    
    	dc $7096
    
    word_1E0DE:	dc 2
    
    	dc $509E
    
    	dc $70A4
    
    word_1E0E4:	dc 2
    
    	dc $50AC
    
    	dc $70B2
    
    word_1E0EA:	dc 0
    
    word_1E0EC:	dc 1
    
    	dc $F0BA
    
    	even
    
    		endc
    here is the animation for spindust


    this was untouched, but i know for a fact that the spindash"s was changed when i tried to make a basic peelout out of it. Bad idea and now i screwed it up
     
  4. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    A few things I could note are:

    • Removing the "if _SPINDASH_=0" and "else", or at least making sure that "_SPINDASH_" (whatever it is, assuming it's an assembler instruction) is set to 1 (or rather a non 0 value)
    • Making sure the object is infact loaded and that nothing overwrites it (check the level starting routine for details).
    • I'm not sure about the animation script "byte_1DF4F:" using only mappings from A to 10 (not sure if it was like that in the original version though, please disregard if so).


    As for your hack, it doesn't look very pleasing to be honest, it looks quite dull and very hackish, I recommend looking into making something more unique.
     
    Last edited by a moderator: May 3, 2011
  5. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    no can do on that, due to using sonic 1 hacking studio 2 (not in english but i easily found my way) the "if" tags go straicht to the config.asm to turn it on or off.


    i'm still working out all the bugs at the moment. the springjump is complete and i will make a perfect use for it. on another note i took off the "IF" tag on one and it killed it.
     
    Last edited by a moderator: May 4, 2011
Thread Status:
Not open for further replies.