ASM to Sega Genesis Platform

All about assembly programming in the Sega Genesis console.


    How to add the 'S' box from Sonic 3 to Sonic 2

    Share
    avatar
    Karate Cat

    Mensagens : 83
    Data de inscrição : 2011-04-22

    How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Karate Cat on Sat Jul 09, 2011 12:00 pm

    Alright, adding this box into Sonic 2 isn't the hardest thing to do, but I figured I would make this guide to walk you through the process.

    First, we should examine the Super Sonic routine so go to this routine.

    Code:
    Sonic_CheckGoSuper:

    The whole code should look a bit like this.

    Code:
    Sonic_CheckGoSuper:
        tst.b    (Super_Sonic_flag).w; is Sonic already Super?
        bne.w    return_1ABA4;return_1ABA4; if yes, branch
            cmpi.b    #7,(Emerald_count).w; does Sonic have exactly 7 emeralds?
        bne.s    return_1ABA4; if not, branch
        cmpi.w    #50,(Ring_count).w; does Sonic have at least 50 rings?
        bcs.s    return_1ABA4; if not, branch
        move.b    #1,(Super_Sonic_palette).w
        move.b    #$F,(Palette_frame_count).w
        move.b    #1,(Super_Sonic_flag).w
        move.b    #$81,obj_control(a0)
        move.b    #$1F,anim(a0); use transformation animation
        bset #4,status(a0); set doublejump flag
        move.b    #$7E,(Object_RAM+$2040).w; load Obj7E (super sonic stars object) at $FFFFD040
        move.w    #$A00,(Sonic_top_speed).w
        move.w    #$30,(Sonic_acceleration).w
        move.w    #$100,(Sonic_deceleration).w
        move.w    #0,invincibility_time(a0)
        bset    #1,status_secondary(a0); make Sonic invincible
        move.w    #$5F+$80,d0
        jsr    (PlaySound).l; Play transformation sound effect.
        move.w    #$16+$80,d0
        jmp    (PlayMusic).l; load the Super Sonic song and return

    As we can see, the code checks for three things before letting sonic go to his super form.

    1. It checks for if Sonic is already Super, and branches to an RTS if he is.

    2. It checks If Sonic has 7 emeralds, and if he does not, it branches to the RTS.

    3. It also checks if Sonic has 50 rings, and if he doesn't, it branches to the RTS.

    Code:
    tst.b    (Super_Sonic_flag).w; is Sonic already Super?
        bne.w    return_1ABA4;return_1ABA4; if yes, branch
            cmpi.b    #7,(Emerald_count).w; does Sonic have exactly 7 emeralds?
        bne.s    return_1ABA4; if not, branch
        cmpi.w    #50,(Ring_count).w; does Sonic have at least 50 rings?
        bcs.s    return_1ABA4; if not, branch

    For the item box, those lines are not needed, copy and paste the entire Sonic_CheckGoSuper code into a text editor, and remove those lines.

    Now, we need to make sure this box will not affect Tails, So in your text editor, the code should look like this.

    Code:
    addq.w    #1,(a2)
        cmpi.w    #2,(Player_mode).w; is player Tails?
            bls    +; if not, branch
            rts

    +

            move.b    #1,(Super_Sonic_palette).w; set the super form palette
        move.b    #$F,(Palette_frame_count).w
        move.b    #1,(Super_Sonic_flag).w; switch on the super sonic flag
        move.b    #$81,obj_control(a0)
        move.b    #$1F,anim(a0); use roll/transformation animation;1F for transform slot
        move.b    #$7E,(Object_RAM+$2040).w; load Obj7E (super sonic stars object) at $FFFFD040
        move.w    #$A00,(Tails_top_speed).w
        move.w    #$30,(Tails_acceleration).w
        move.w    #$100,(Tails_deceleration).w
        move.w    #$A00,(Sonic_top_speed).w
        move.w    #$30,(Sonic_acceleration).w
        move.w    #$100,(Sonic_deceleration).w
        move.w    #0,invincibility_time(a0)
        bset    #1,status_secondary(a0); make Sonic invincible
        move.w    #$5F+$80,d0
        jsr    (PlaySound).l; Play transformation sound effect.
        move.w    #$16+$80,d0
        jsr    (PlayMusic).l; load the Super Sonic song and return

    Next, we need to make it so that the box will GIVE Sonic 50 rings, so he can transform when he breaks the monitor. So add...

    You will need to add a LEA to (Ring_Count).

    As well as this...

    Code:
    addi.w    #$32,(a2)

    Right under the Ring_Count as well.

    The code should now look like.

    Code:
    addq.w    #1,(a2)
        cmpi.w    #2,(Player_mode).w; is player Tails?
            bls    +; if not, branch
            rts

    +
        lea    (Ring_count).w,a2
        addi.w    #$32,(a2)

        move.b    #1,(Super_Sonic_palette).w; set the super form palette
        move.b    #$F,(Palette_frame_count).w
        move.b    #1,(Super_Sonic_flag).w; switch on the super sonic flag
        move.b    #$81,obj_control(a0)
        move.b    #$1F,anim(a0); use roll/transformation animation;1F for transform slot
        move.b    #$7E,(Object_RAM+$2040).w; load Obj7E (super sonic stars object) at $FFFFD040
        move.w    #$A00,(Sonic_top_speed).w
        move.w    #$30,(Sonic_acceleration).w
        move.w    #$100,(Sonic_deceleration).w
        move.w    #0,invincibility_time(a0)
        bset    #1,status_secondary(a0); make Sonic invincible
        move.w    #$5F+$80,d0
        jsr    (PlaySound).l; Play transformation sound effect.
        move.w    #$16+$80,d0
        jsr    (PlayMusic).l; load the Super Sonic song and return

    So far, so good. BUT now you need to make it so that the counter will update so add this line just under the code that adds 50 rings.

    Code:
    ori.b    #$80,(Update_HUD_rings).w

    The code should now look like.

    Code:
    addq.w    #1,(a2)
        cmpi.w    #2,(Player_mode).w; is player Tails?
            bls    +; if not, branch
            rts

    +
        lea    (Ring_count).w,a2
        addi.w    #$32,(a2)
        ori.b    #$80,(Update_HUD_rings).w
        move.b    #1,(Super_Sonic_palette).w; set the super form palette
        move.b    #$F,(Palette_frame_count).w
        move.b    #1,(Super_Sonic_flag).w; switch on the super sonic flag
        move.b    #$81,obj_control(a0)
        move.b    #$1F,anim(a0); use roll/transformation animation;1F for transform slot
        move.b    #$7E,(Object_RAM+$2040).w; load Obj7E (super sonic stars object) at $FFFFD040
        move.w    #$A00,(Sonic_top_speed).w
        move.w    #$30,(Sonic_acceleration).w
        move.w    #$100,(Sonic_deceleration).w
        move.w    #0,invincibility_time(a0)
        bset    #1,status_secondary(a0); make Sonic invincible
        move.w    #$5F+$80,d0
        jsr    (PlaySound).l; Play transformation sound effect.
        move.w    #$16+$80,d0
        jsr    (PlayMusic).l; load the Super Sonic song and return

    This should work perfectly now, so it is time to insert it into the ASM.

    Go to off_12924 and replace the first line with this.

    Code:
    dc.w super_monitor-off_12924; 0 - Super/ Turns character to their super form

    Then paste the code after the code for robotnik_monitor like this.

    Code:
    ; ============== END RELATIVE POINTER LIST ==================================
    ; badnik_monitor:
    robotnik_monitor:
        addq.w    #1,(a2)
        jmp    Touch_ChkHurt2
    ; ===========================================================================

    Super_Monitor:
        addq.w    #1,(a2)
        cmpi.w    #2,(Player_mode).w; is player Tails?
        bls    +; if not, branch
        rts

    +
        lea    (Ring_count).w,a2
        addq.w    #32,($FFFFFE20).w; add 50 to rings
        ori.b    #$80,(Update_HUD_rings).w

        move.b    #1,(Super_Sonic_palette).w; set the super form palette
        move.b    #$F,(Palette_frame_count).w
        move.b    #1,(Super_Sonic_flag).w; switch on the super sonic flag
        move.b    #$81,obj_control(a0)
        move.b    #$1F,anim(a0); use roll/transformation animation;1F for transform slot
        move.b    #$7E,(Object_RAM+$2040).w; load Obj7E (super sonic stars object) at $FFFFD040
        move.w    #$A00,(Sonic_top_speed).w
        move.w    #$30,(Sonic_acceleration).w
        move.w    #$100,(Sonic_deceleration).w
        move.w    #0,invincibility_time(a0)
        bset    #1,status_secondary(a0); make Sonic invincible
        move.w    #$5F+$80,d0
        jsr    (PlaySound).l; Play transformation sound effect.
        move.w    #$16+$80,d0
        jsr    (PlayMusic).l; load the Super Sonic song and return
    ; ============================================================================

    Now, save, build, jack off. Then set in your level of choice and test it out.

    Keep in mind, the code will make use of the blank/static monitor. You will have to add new art and mappings if you want otherwise.

    Credits:

    Original guide from SMPS Archive (RIP).
    Guide written by Hitaxas Icaria.
    Mispelled mistakes in guide fixed by me (Karate Cat).
    avatar
    calebjhuhlu

    Mensagens : 55
    Data de inscrição : 2011-06-16

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  calebjhuhlu on Mon Jul 11, 2011 6:33 am

    Awesome! Thank you i was looking for this.
    avatar
    Green Snake

    Mensagens : 2094
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Green Snake on Sun Apr 08, 2012 5:43 am

    Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1
    avatar
    Green Snake

    Mensagens : 2094
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Green Snake on Fri Oct 19, 2012 1:09 pm

    Green Snake wrote:Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1

    Darn, stupid I was...

    Ezequiel Matias

    Mensagens : 2505
    Data de inscrição : 2013-01-03

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Ezequiel Matias on Sun Jun 09, 2013 2:27 pm

    Green Snake wrote:
    Green Snake wrote:Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1

    Darn, stupid I was...

    Yes you actually are a stupid.
    avatar
    hacker___

    Mensagens : 1967
    Data de inscrição : 2013-05-06
    Localização : Antarctica
    Current Project : Sonic Random Hax

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  hacker___ on Sun Jun 09, 2013 2:32 pm

    Ezequiel Matias wrote:
    Green Snake wrote:
    Green Snake wrote:Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1

    Darn, stupid I was...

    I am an stupid who likes stolen kontent.

    Bad
    avatar
    Green Snake

    Mensagens : 2094
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Green Snake on Sun Jun 09, 2013 2:35 pm

    Ezequiel Matias wrote:
    Green Snake wrote:
    Green Snake wrote:Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1

    Darn, stupid I was...

    Yes I actually are a stupid.
    Yes, we all know how dumb you are

    Ezequiel Matias

    Mensagens : 2505
    Data de inscrição : 2013-01-03

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Ezequiel Matias on Sun Jun 09, 2013 2:37 pm

    [quote="hacker___"]
    Ezequiel Matias wrote:
    Green Snake wrote:
    Green Snake wrote:Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1

    Darn, stupid I was...

    hacker__ wrote:I am an stupid who likes stolen kontent.

    Bad


    Ezequiel Matias

    Mensagens : 2505
    Data de inscrição : 2013-01-03

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Ezequiel Matias on Sun Jun 09, 2013 2:41 pm

    [quote="Green Snake"]
    Ezequiel Matias wrote:
    Green Snake wrote:
    Green Snake wrote:Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1

    Darn, stupid I was...

    Green Snake wrote:Yes I actually are a stupid.
    Yes, we all know how dumb you are

    avatar
    hacker___

    Mensagens : 1967
    Data de inscrição : 2013-05-06
    Localização : Antarctica
    Current Project : Sonic Random Hax

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  hacker___ on Sun Jun 09, 2013 2:42 pm

    [quote="Ezequiel Matias"]
    Green Snake wrote:
    Ezequiel Matias wrote:
    Green Snake wrote:
    Green Snake wrote:Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1

    Darn, stupid I was...

    ezequielmatias wrote:Yes I actually are a stupid.
    Yes, we all know how dumb I are


    BAD
    avatar
    Green Snake

    Mensagens : 2094
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Green Snake on Sun Jun 09, 2013 2:42 pm

    [quote="Green Snake"]
    Ezequiel Matias wrote:
    Ezequiel Matias wrote:
    Green Snake wrote:
    Green Snake wrote:Could you somehow make this same quide to work on hivebrain 2005 dissassembly for sonic 1

    Darn, stupid I was...

    Green Snake wrote:Yes I actually are a stupid.
    Yes, we all know how dumb you are.

    Your getting wrecked kid Smile

    Ezequiel Matias

    Mensagens : 2505
    Data de inscrição : 2013-01-03

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Ezequiel Matias on Sun Jun 09, 2013 2:46 pm

    Fail.
    avatar
    hacker___

    Mensagens : 1967
    Data de inscrição : 2013-05-06
    Localização : Antarctica
    Current Project : Sonic Random Hax

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  hacker___ on Sun Jun 09, 2013 2:47 pm

    Ezequiel Matias wrote:I Fail.

    Ezequiel Matias

    Mensagens : 2505
    Data de inscrição : 2013-01-03

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Ezequiel Matias on Sun Jun 09, 2013 2:50 pm

    hacker___ wrote:
    hacker____ wrote:I Fail.
    avatar
    Green Snake

    Mensagens : 2094
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Green Snake on Sun Jun 09, 2013 2:50 pm

    Ezequiel Matias wrote:Fail.
    Yeah your getting pretty wrecked here

    Ezequiel Matias

    Mensagens : 2505
    Data de inscrição : 2013-01-03

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Ezequiel Matias on Sun Jun 09, 2013 2:53 pm

    Green Snake wrote:
    Ezequiel Matias wrote:Fail.
    Yeah your getting pretty wrecked here

    Faggot.
    avatar
    hacker___

    Mensagens : 1967
    Data de inscrição : 2013-05-06
    Localização : Antarctica
    Current Project : Sonic Random Hax

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  hacker___ on Sun Jun 09, 2013 2:54 pm

    Ezequiel Matias wrote:
    Green Snake wrote:
    Ezequiel Matias wrote:Fail.
    Yeah your getting pretty wrecked here

    I am a Faggot.

    You like penis?
    avatar
    Green Snake

    Mensagens : 2094
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Green Snake on Sun Jun 09, 2013 2:56 pm

    Ezequiel Matias wrote:
    Green Snake wrote:
    Ezequiel Matias wrote:Fail.
    Yeah your getting pretty wrecked here

    Faggot.
    The fact that you are gay doesn't mean I am gay

    Sponsored content

    Re: How to add the 'S' box from Sonic 3 to Sonic 2

    Post  Sponsored content


      Current date/time is Mon Dec 11, 2017 2:32 am