don't click here

Sonic 2 Bug w/ Super Sonic (time related)

Discussion in 'Engineering & Reverse Engineering' started by saxman, Jul 13, 2009.

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

    saxman

    Oldbie Tech Member
    I found this sorta interesting:

    Code (Text):
    1. Sonic_Super:
    2.     tst.b    (Super_Sonic_flag).w; Ignore all this code if not Super Sonic
    3.     beq.w    return_1AC3C
    4.     tst.b    (Update_HUD_timer).w
    5.     beq.s    Sonic_RevertToNormal; ?
    6.     subq.w    #1,(Super_Sonic_frame_count).w
    7.     bpl.w    return_1AC3C
    8.     move.w    #60,(Super_Sonic_frame_count).w; Reset frame counter to 60
    9.     tst.w    (Ring_count).w
    10.     beq.s    Sonic_RevertToNormal
    11.     ori.b    #1,(Update_HUD_rings).w
    12.     cmpi.w    #1,(Ring_count).w
    13.     beq.s    +
    14.     cmpi.w    #10,(Ring_count).w
    15.     beq.s    +
    16.     cmpi.w    #100,(Ring_count).w
    17.     bne.s    ++
    18. +
    19.     ori.b    #$80,(Update_HUD_rings).w
    20. +
    21.     subq.w    #1,(Ring_count).w
    22.     bne.s    return_1AC3C
    Look at that closely. It's saying that as long as Super_Sonic_frame_count is greater OR EQUAL to zero, the ring count remains unchanged. Otherwise, it will reset Super_Sonic_frame_count to 60. The problem is that the ring count decreases ever 61 frames instead of every 60.

    Nothing overly special, and it's hardly noticeable. Still, I thought perhaps someone would be interested in fixing that and have the counter reset to 59 instead of 60. Just a small little mistake. So for every 60 seconds, you get an extra second for free ^_^



    EDIT: It's this way in Sonic 3 and 3K too.
     
  2. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Whoever fixes this bug should be shot :argh:

    Also the fix would be replacing bpl with bhi, I guess.
    EDIT: or just using bne instead...
     
  3. saxman

    saxman

    Oldbie Tech Member
    I just changed 60 to 59. But you're fix would do it too.
     
  4. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Considering how the code is written, I think that it was the intention. Or to put 59... Dammit, looks like somebody got things mixed up XD
     
  5. Glisp

    Glisp

    That one weird guy that does stuff. Member
    1,278
    1
    16
    Bloomington, IN
    None at the moment I'm afraid.
    Wait a second. Is this that annoying Super Sonic bug where if you jump at a Goal post with 50 or more Rings you'll transform and if you aren't off screen you'll need to reset the game?
     
  6. nineko

    nineko

    I am the Holy Cat Tech Member
    6,309
    486
    63
    italy
    No. This is a glitch which causes Super Sonic to last longer than you expect. Most people here think that Super Sonic drains one ring per second, but it's slightly slower. One second is made up of 60 frames, but Super Sonic needs 61 frames to get one ring drained.
    As a result, 60 rings take 61 seconds to get to 0. Each ring lasts for 61/60th of second, or 1.0166666666666666 seconds.

    There, I tried to reword it in the simplest way I could :)
     
  7. JoseTB

    JoseTB

    Tech Member
    716
    59
    28
    How do we know they intended the rings to last exactly one second? =P </spikebugmode>

    Jokes aside, nice find, despite I've seen the code hundreds of times I never actually noticed that detail.
     
  8. Glisp

    Glisp

    That one weird guy that does stuff. Member
    1,278
    1
    16
    Bloomington, IN
    None at the moment I'm afraid.

    I understood it perfectly. =P
     
  9. aliialii

    aliialii

    La la laaaaa~ Member

    Someone should make a hack which triples the amount of seconds in super mode.
    *shot*
    Forget what I said just then. Maybe SEGA slipped on that part. They always make a mistake. Remember the spike bug, and ALL YOUR BASE ARE BELONG TO US, etc.
    And I understood that paragraph perfectly. :)

    Fix'd for the lolz.
     
Thread Status:
Not open for further replies.