[Need Help] Using giant ring as end of zone

Discussion in 'Discussion and Q&A Archive' started by Ziro_, Sep 18, 2016.

Tags:
  1. Ziro_

    Ziro_ Mentally Skewed Member

    Joined:
    Aug 1, 2016
    Messages:
    59
    Location:
    What are you a cop
    I have been trying for months to make the giant ring take sonic to the next level. Can someone point me in the right direction thanks.
     
  2. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    There is a lot of information required. What game with Giant Rings are you trying to hack, Sonic 1 or Sonic 3? What version of the disassembly?

    Hint: If you happen to hack Sonic 1, know that triggering a load for next level works by calling GotThroughAct. Then it should be pretty straightforward.
     
  3. Ziro_

    Ziro_ Mentally Skewed Member

    Joined:
    Aug 1, 2016
    Messages:
    59
    Location:
    What are you a cop
    Oh sorry I was in a hurry. I was using the sonic 1 2005 hivebrain disasm. I tried adding jsr GoTHroughAct to the end of the Obj7C_Collect: and when I get into the ring it boots back to the title screen.
     
    Last edited: Sep 19, 2016
    FireRat likes this.
  4. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    You should try figuring out why you get the results you do and use the knowledge from that to figure out how you can make it work correctly. It may require you to study Sonic 1's code to see how things work.
     
    Pacca and Soldaten like this.
  5. Ziro_

    Ziro_ Mentally Skewed Member

    Joined:
    Aug 1, 2016
    Messages:
    59
    Location:
    What are you a cop
    I have been and am getting different results but I still can't figure out how it happens. If you can try to see what I am doing wrong because I am clueless.
     
  6. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    267
    ...posting the entire rom code is not helpful. No one is going to dig through thousands of lines to find your problem. Simply pastebin your routine or place it in a code tag.
     
    Last edited: Sep 19, 2016
    Clownacy and Misinko like this.
  7. Joshwoakes

    Joshwoakes Active Sonic Hacker Member

    Joined:
    Jun 22, 2013
    Messages:
    131
    Location:
    UK, Birmingham, Moseley
    @ZiroGX2
    okay since i have already done this before in one of my hacks. i'll give you a quick helping hand.

    Although posting the entire rom code in a text file wasn't the best idea but I did manage to locate the code you were having trouble with, thanks to notepad's "find" feature

    Now, by looking at your "Obj7C_Collect" code, I noticed that your problem is possibly caused by your "End Act" code lines being in the wrong place or below a conditional branch that may prevent the game running those lines of code if the condition that lt's checking for is matched.

    So instead of:
    Code:
    Obj7C_Collect:                ; XREF: Obj7C_ChkDel
            subq.b    #1,$1E(a0)
            bpl.s    locret_9F76
            move.b    #1,$1E(a0)
            addq.b    #1,$1A(a0)
            cmpi.b    #8,$1A(a0)    ; has animation    finished?
            bcc.s    Obj7C_End    ; if yes, branch
            cmpi.b    #3,$1A(a0)    ; is 3rd frame displayed?
            bne.s    locret_9F76    ; if not, branch
            movea.l    $3C(a0),a1
            move.b    #6,$24(a1)    ; delete giant ring object (Obj4B)
            move.b    #$1C,($FFFFD01C).w ; make Sonic    invisible
            move.b    #1,($FFFFF7CD).w ; stop    Sonic getting bonuses
            clr.b    ($FFFFFE2D).w    ; remove invincibility
            clr.b    ($FFFFFE2C).w    ; remove shield
            move.w    ($FFFFD008).w,d0
            sub.w    8(a0),d0
            bcs.s    locret_9F76
            move.w    #$CF,d0
            jsr    (PlaySound).l    ; play signpost    sound
            clr.b    ($FFFFFE1E).w    ; stop time counter
            move.w    ($FFFFF72A).w,($FFFFF728).w ; lock screen position
            addq.b    #2,$24(a0)
    
            jsr        GotThroughAct
    
    locret_9F76:
            rts
    ; ===========================================================================
    
    Obj7C_End:                ; XREF: Obj7C_Collect
            addq.b    #2,$24(a0)
            move.w    #0,($FFFFD000).w ; remove Sonic    object
            addq.l    #4,sp
            rts
    ; End of function Obj7C_Collect
    
    Try this:
    Code:
    Obj7C_Collect:                ; XREF: Obj7C_ChkDel
            subq.b    #1,$1E(a0)
            bpl.s    locret_9F76
            move.b    #1,$1E(a0)
            addq.b    #1,$1A(a0)
            cmpi.b    #8,$1A(a0)    ; has animation    finished?
            bcc.s    Obj7C_End    ; if yes, branch
            cmpi.b    #3,$1A(a0)    ; is 3rd frame displayed?
            bne.s    locret_9F76    ; if not, branch
            movea.l    $3C(a0),a1
            move.b    #6,$24(a1)    ; delete giant ring object (Obj4B)
            move.b    #1,($FFFFF7CD).w ; stop    Sonic getting bonuses
            clr.b    ($FFFFFE2D).w    ; remove invincibility
            clr.b    ($FFFFFE2C).w    ; remove shield
    
    locret_9F76:
            rts
    ; ===========================================================================
    
    Obj7C_End:                ; XREF: Obj7C_Collect
            addq.b    #2,$24(a0)
            addq.l    #4,sp
            move.b    #1,($FFFFF7CC).w ; lock    controls
            move.w    #$800,($FFFFF602).w ; make Sonic run to    the right
            clr.b    ($FFFFFE1E).w    ; stop time counter
            move.w    ($FFFFF72A).w,($FFFFF728).w ; lock screen position
    
            jmp        GotThroughAct
    If all goes correctly, something like this should be your result:
    [​IMG]

    If the code i provided works for you but isn't the way you wanted it, then you can just simply edit the code to the way you want it.

    Edit: fixed grammar mistakes\errors
    [​IMG]
    [​IMG]
     
    Last edited: Sep 19, 2016