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

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

  1. AleDrawer2008

    AleDrawer2008 Active Member Member

    Joined:
    Jun 14, 2021
    Messages:
    44
    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
  2. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    191
    Location:
    Mysterious Marble Zone, Bird Hill Island
    so I have 2 suggestions, 1 can you make it so you go back to the big ring after the special stage and 2, this code only makes it so you go to one special stage per act and if you remove
    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
    The big ring you just entered still exists although the other bigs rings still exsts but I want you to be able to collect 2 or more big rings per stage.
     
    Last edited: Apr 9, 2025