[Sonic 1 Github] How to make work the Giant Rings during a level instead of at the end

Discussion in 'Tutorials' started by Alegamer700, Jun 12, 2023.

  1. Alegamer700

    Alegamer700 Newcomer Member

    Joined:
    Jun 14, 2021
    Messages:
    18
    Location:
    Somewhere in South America
    Well, I'm new, but I think this can be useful for some people, so, here we go

    I see other rom hacks like Sonic AGX which puts the giant rings during the levels instead of after.

    Well, here's my own code because i canĀ“t found the giant ring code in the sonic 3 code

    It should work in Hivebrain. Just search the equivalent routines or address

    1) New flag

    Before this, you need a unused address for make this work. For example $F601. that's the address i'm going to use (if you already use that address, search other unused address in https://info.sonicretro.org/SCHG:Sonic_the_Hedgehog_(16-bit)/RAM_Editing )
    Anyways, at the end of Variables.asm you should write something like this

    Code:
    f_specials      = $FFFFF601    ; Special Stage flag
    Now the game will know that f_specials is $FFFFF601

    If you use Hivebrain, like theres no variables, change all the f_specials with your used address

    2) Modify the code of the giant ring

    go to _incObj/4B Giant Ring.asm and put this over GRing_Okay

    Code:
    GRing_Confirm:
                    tst.b    (f_specials).w    ; did you already enter one to the special stage?
                    beq.s    GRing_Okay    ; if not, branch
                    rts
    This looks useless, but i'll explain it later.

    Oh, and also. do you see the "bne.s GRing_Okay" which should be at the very end of GRing_Main? Change it with

    Code:
                    bne.s    GRing_Confirm    ; if yes, branch
    And copy this from GRing_PlaySnd (include it) until before GRing_Delete

    Code:
    GRing_Enter:
                    addi.b  #$01, (f_bigring).w
            move.w    #sfx_GiantRing,d0
            jsr    (PlaySound_Special).l    ; play giant ring sound
    
    GRing_ChkSS:
            tst.b    (f_bigring).w    ; has Sonic jumped into    a giant    ring?
            beq.s    GRing_Restart    ; if not, branch
                    move.b    #id_Special,(v_gamemode).w ; set game mode to Special Stage (10)
                    add.b  #01, (f_specials).w
            bra.w    GRing_Animate
    GRing_Restart:
                    rts
    And remplace all GRing_PlaySnd with GRing_Enter

    3) 1 special stage by act

    It works but you can go to the giant ring just once in the whole game. So lets change it

    Go to _incObj/0D Signpost (Edit: Also in Level_ClrVars 3 in the main Sonic.asm file) and put this after the label GotThroughAct

    Code:
                    clr.b   (f_specials).w
    Did you remember this?

    Well, that will let you go to the special stages once per act.

    Conclusion

    I think that's it. That's how i make work the giant rings during the act instead of after.

    If you have some suggetion, say me and i will edit the tutorial
     
    Last edited: Jun 13, 2023
    Dark Shamil Khan, Matt and Nik Pi like this.