Weird bug when drowning... in Sonic 1

Discussion in 'Discussion and Q&A Archive' started by Psycho RFG, Jan 18, 2013.

Thread Status:
Not open for further replies.
  1. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Hi,

    I have tried to find the reason of this bug but I couldn't find nothing... it seems it something related with the small bobbles, but who knows where this come from...

    The bug appear when Sonic drown and the water top is on the screen... when Sonic is falling with drowning animation, some garbled graphics can be seen and parts of the countdown numbers... any idea of what can be causing this or what should I look?

    Thanks


    Some shots of the bug:


    [​IMG]
     ​
    [​IMG]
     ​
     ​
     
  2. DiscoTheBat

    DiscoTheBat Newcomer Exiled

    Joined:
    Jan 17, 2013
    Messages:
    15
    Well, I'd the same bug in my hack but I managed to fix it by replacing this code:


    Obj0A_ChkWater: ; XREF: Obj0A_Index
    move.w ($FFFFF646).w,d0
    cmp.w $C(a0),d0 ; has bubble reached the water surface?
    bcs.s Obj0A_Wobble ; if not, branch
    move.b #6,$24(a0)
    addq.b #7,$1C(a0)
    cmpi.b #$D,$1C(a0)
    beq.s Obj0A_Display
    bra.s Obj0A_Display

    With this one:


    Obj0A_ChkWater: ; XREF: Obj0A_Index
    move.w ($FFFFF646).w,d0
    cmp.w $C(a0),d0 ; has bubble reached the water surface?
    bcs.s Obj0A_Wobble ; if not, branch
    move.b #6,$24(a0)
    addq.b #7,$1C(a0)
    cmpi.b #$D,$1C(a0)
    beq.s Obj0A_Display
    bcs.s Obj0A_Display ;Fix the bubble bug
    move.b #$D,$1C(a0) ;/
    bra.s Obj0A_Display

    I believe that the game wasn't designed to handle multiples bubbles on the screen, so when Sonic drowns, the wrong "anim" data is read, and that's why this glitch happens.
     
  3. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Thanks! You are completely right and your fix works fine, nice found.

    Thanks a lot for the help with this great first post here and welcome to SSRG.
     
Thread Status:
Not open for further replies.