Bubble Shield problem...

Discussion in 'Discussion and Q&A Archive' started by Tornado, Apr 8, 2009.

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

    Tornado Active Member Member

    Joined:
    Dec 1, 2008
    Messages:
    30
    Location:
    Hydrocity - Angel Island
    Hello, everyone, I am asking for help, because I tried several times, but do not want to work. I am trying to import only the bubble shield from Sonic 3, has fixed the flags (I do not know if everything is correct) .. The problem is not working .. the art or at least appears .. here is the code of the object:


    Edit: The code is for sonic 2



    Code:
    ; ===========================================================================
    
    
    
    ;Obj_Bubble_Shield:
    
    Obj17:
    
    		move.l	#Map_BubbleShield,mappings(a0)
    
    		move.l	#DPLC_BubbleShield,stick_to_convex(a0)
    
    		move.l	#ArtUnc_BubbleShield,$38(a0)
    
    		move.b	#4,render_flags(a0)
    
    		move.w	#$80,priority(a0)
    
    		move.b	#$18,width_pixels(a0)
    
    		move.w	#$79C,art_tile(a0)
    
    		move.w	#$F380,Jumping(a0)
    
    		btst	#7,($FFFFB00A).w
    
    		beq.s	loc_19908
    
    		bset	#7,art_tile(a0)
    
    
    
    loc_19908:
    
    		move.w	#1,anim(a0)
    
    		move.b	#-1,invulnerable_time(a0)
    
    		movea.w	parent(a0),a1
    
    		bsr.w	ResumeMusic
    
    		move.l	#loc_19922,(a0)
    
    
    
    loc_19922:
    
    		movea.w	parent(a0),a2
    
    		btst	#1,status_secondary(a2)
    
    		bne.s	locret_1998A
    
    		cmpi.b	#$1C,anim(a2)
    
    		beq.s	locret_1998A
    
    		btst	#0,status_secondary(a2)
    
    		beq.s	loc_1998C
    
    		move.w	x_pos(a2),x_pos(a0)
    
    		move.w	y_pos(a2),y_pos(a0)
    
    		move.b	Status(a2),Status(a0)
    
    		andi.b	#1,Status(a0)
    
    		tst.b	($FFFFF7C6).w
    
    		beq.s	loc_19962
    
    		ori.b	#2,Status(a0)
    
    
    
    loc_19962:
    
    		andi.w	#$7FFF,art_tile(a0)
    
    		tst.w	art_tile(a2)
    
    		bpl.s	loc_19974
    
    		ori.w	#$8000,art_tile(a0)
    
    
    
    loc_19974:
    
    		lea	(Ani_BubbleShield).l,a1
    
    		jsr	AnimateSprite
    
    		bsr.w	PLCLoad_Shields
    
    		jmp	DisplaySprite
    
    ; ===========================================================================
    
    
    
    locret_1998A:
    
    		rts	
    
    ; ===========================================================================
    
    
    
    loc_1998C:
    
    		andi.b	#$8E,status_secondary(a2)
    
    		;move.l	#Obj_Insta_Shield,(a0)
    
    		rts	
    
    
    
    ; ||||||||||||||| S U B	R O U T	I N E |||||||||||||||||||||||||||||||||||||||
    
    
    
    
    
    PLCLoad_Shields:
    
    		moveq	#0,d0
    
    		move.b	mapping_frame(a0),d0
    
    		cmp.b	invulnerable_time(a0),d0
    
    		beq.s	locret_199E8
    
    		move.b	d0,invulnerable_time(a0)
    
    		movea.l	stick_to_convex(a0),a2
    
    		add.w	d0,d0
    
    		adda.w	(a2,d0.w),a2
    
    		move.w	(a2)+,d5
    
    		subq.w	#1,d5
    
    		bmi.s	locret_199E8
    
    		move.w	Jumping(a0),d4
    
    
    
    loc_199BE:
    
    		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	$38(a0),d1
    		move.w	d4,d2
    		add.w	d3,d4
    		add.w	d3,d4
    		jsr	(QueueDMATransfer).l
    		dbf	d5,loc_199BE
    
    locret_199E8:
    		rts	
    ; End of function PLCLoad_Shields

    Well, any help is welcome...Thanks. ;)
     
  2. Alriightyman

    Alriightyman I'm back! Member

    Joined:
    Oct 3, 2007
    Messages:
    156
    Location:
    USA
    Hello, everyone, I am asking for help, because I tried several times, but do not want to work. I am trying to import only the bubble shield from Sonic 3, has fixed the flags (I do not know if everything is correct) .. The problem is not working .. the art or at least appears .. here is the code of the object:

    Edit: The code is for sonic 2

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



    ;Obj_Bubble_Shield:

    Obj17:

    move.l #Map_BubbleShield,mappings(a0)

    move.l #DPLC_BubbleShield,stick_to_convex(a0)

    move.l #ArtUnc_BubbleShield,$38(a0)

    move.b #4,render_flags(a0)

    move.w #$80,priority(a0)

    move.b #$18,width_pixels(a0)

    move.w #$79C,art_tile(a0)

    move.w #$F380,Jumping(a0)

    btst #7,($FFFFB00A).w

    beq.s loc_19908

    bset #7,art_tile(a0)



    loc_19908:

    move.w #1,anim(a0)

    move.b #-1,invulnerable_time(a0)

    movea.w parent(a0),a1

    bsr.w ResumeMusic

    move.l #loc_19922,(a0)



    loc_19922:

    movea.w parent(a0),a2

    btst #1,status_secondary(a2)

    bne.s locret_1998A

    cmpi.b #$1C,anim(a2)

    beq.s locret_1998A

    btst #0,status_secondary(a2)

    beq.s loc_1998C

    move.w x_pos(a2),x_pos(a0)

    move.w y_pos(a2),y_pos(a0)

    move.b Status(a2),Status(a0)

    andi.b #1,Status(a0)

    tst.b ($FFFFF7C6).w

    beq.s loc_19962

    ori.b #2,Status(a0)



    loc_19962:

    andi.w #$7FFF,art_tile(a0)

    tst.w art_tile(a2)

    bpl.s loc_19974

    ori.w #$8000,art_tile(a0)



    loc_19974:

    lea (Ani_BubbleShield).l,a1

    jsr AnimateSprite

    bsr.w PLCLoad_Shields

    jmp DisplaySprite

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



    locret_1998A:

    rts

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



    loc_1998C:

    andi.b #$8E,status_secondary(a2)

    ;move.l #Obj_Insta_Shield,(a0)

    rts



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





    PLCLoad_Shields:

    moveq #0,d0

    move.b mapping_frame(a0),d0

    cmp.b invulnerable_time(a0),d0

    beq.s locret_199E8

    move.b d0,invulnerable_time(a0)

    movea.l stick_to_convex(a0),a2

    add.w d0,d0

    adda.w (a2,d0.w),a2

    move.w (a2)+,d5

    subq.w #1,d5

    bmi.s locret_199E8

    move.w Jumping(a0),d4



    loc_199BE:

    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 $38(a0),d1

    move.w d4,d2

    add.w d3,d4

    add.w d3,d4

    jsr (QueueDMATransfer).l

    dbf d5,loc_199BE



    locret_199E8:

    rts

    ; End of function PLCLoad_Shields[/codebox]



    Well, any help is welcome...Thanks. ;)[/quote]

    Some of your code is still not converted correctly. For example,
    Code:
    		btst	#7,($FFFFB00A).w
    That line is testing if bit 7 is set in art tile for Sonic. However in Sonic 2 Art_tile is not $A. Also,
    Code:
    		move.w	#$F380,Jumping(a0) is not correct either.  jumping is a Sonic Specifc variable.  You can use it, but i would use say, objoff_3C instead.  This line, 		move.l	#loc_19922,(a0) doesn't work in Sonic 2.  You will have to find another way of doing that operation.  S3K is not easy to convert if you don't understand how objects work.   Hopefully these few hints will help you.  Also, look at how objects work in Sonic 2 and try to find the same object in the S&k Disassembly and look at the main differences. The monitor object is a good start.
     
    Last edited by a moderator: Apr 8, 2009
  3. Tornado

    Tornado Active Member Member

    Joined:
    Dec 1, 2008
    Messages:
    30
    Location:
    Hydrocity - Angel Island
    In the S3K Disassembly, I removed the following line:



    Code:
    move.w	#$F380,Jumping(a0)


    Compiled S3K and the result was that the shield continues running smoothly.

    But if you remove it:



    Code:
    move.l    #loc_19922,(a0)


    He does not appear, only the works that is the Bubble Shield Bounce. It either say that this is the line that separates the bubble shield me ...

    As I understand it, I have to give a way to change this line to work correctly that is not in sonic 2? I will try ... Thanks for the tip Alriightyman
     
Thread Status:
Not open for further replies.