Sonic 1 title cards bug when Time Over

Discussion in 'Discussion and Q&A Archive' started by Psycho RFG, Aug 6, 2012.

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

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Hi:


    I noticed a "little" bug here that I can't see what is causing it. When you die by Time Over (and lives still left, of course) when the fade out ends and the level is restarted, you can see the word ZONE in the middle of the screen for a little while, then it dissapear and the title cards appears as allways. Why the word ZONE appear there? any idea of how to fix it?


    Thanks!
     
  2. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    You really find the weirdest bugs in the most unexpected places, I'll probably ask you to help me debug my hack when it will near completion haha.


    Anyway, is that bug supposed to be visible in the original game? I tried in green hill and couldn't see it.


    That's when the first palette line fades in at the beginning of the level, right? Not when it fades out before the level restarts?


    From a theoretical standpoint, it's kind of easy: the coordinates of the objects aren't set properly when it's created. Now, the question is why. Since before the object's creation the object ram is cleared, it shouldn't be related to objects previously in ram, so you'll have to look at the title card's code for the "zone" object.


    Just in case though, you should try to find the address of the zone object's ram and check how its coordinates are changing at every step and at which primary/secondary routine counter.


    By the way, did you modify the object?
     
  3. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    It will be a pleasure, haha.

    I tried again and it's weird. I can see this bug in original Sonic 1 in Fusion and in Regen but only in the REV01 version so... can be related with the bg deformation? :S

    It's when the fade out of the TIME OVER screen ends, just when the screen is completely black and just before the title cards start to appear from the sides of the screen. The word ZONE appears for a little while near the middle of the screen and dissapear.

    I think not, at least for long time :p
     
    Last edited by a moderator: Aug 6, 2012
  4. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Hey, you're right:


    [​IMG]


    But it only happens in the Japan version. Can't seem to get it to appear in the Europe version. But you said it's there for a while, but with me, it was only there for a frame. It was bloody hard getting a screenshot of it, even with slo-motion =P


    One thing I did notice though, with both versions, is that if you're running out of time, the TIME will only flash red if you have no rings. If you have rings, it won't flash. But maybe people know that already; I don't hack Sonic 1 that I didn't notice 'til now.
     
  5. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    @RHS: That's an old bug, there was a guide to fix it long ago, but I can't find it right now. You have to add a check for the 9 minutes in "Obj21_Flash2" (that's in the old disassembly not sure it's the same name in the last ones) and modify d0 (which stores the number of the frame to display) accordingly.


    Now about that "zone" bug, in that revision there's a difference here (see the two parts with "Revision=0"):




    Level_MainLoop:


    bsr.w PauseGame


    move.b #8,(v_vbla_routine).w


    bsr.w WaitForVBla


    addq.w #1,(v_framecount).w ; add 1 to level timer


    bsr.w MoveSonicInDemo


    bsr.w LZWaterFeatures


    jsr ExecuteObjects


    if Revision=0


    else


    tst.w (f_restart).w


    bne GM_Level


    endc


    tst.w (v_debuguse).w ; is debug mode being used?


    bne.s Level_DoScroll ; if yes, branch


    cmpi.b #6,(v_player+obRoutine).w ; has Sonic just died?


    bhs.s Level_SkipScroll ; if yes, branch


    Level_DoScroll:


    bsr.w DeformLayers


    Level_SkipScroll:


    jsr BuildSprites


    jsr ObjPosLoad


    bsr.w PaletteCycle


    bsr.w RunPLC


    bsr.w OscillateNumDo


    bsr.w SynchroAnimate


    bsr.w SignpostArtLoad


    cmpi.b #id_Demo,(v_gamemode).w


    beq.s Level_ChkDemo ; if mode is 8 (demo), branch


    if Revision=0


    tst.w (f_restart).w ; is the level set to restart?


    bne.w GM_Level ; if yes, branch


    else


    endc


    cmpi.b #id_Level,(v_gamemode).w


    beq.w Level_MainLoop ; if mode is $C (level), branch


    rts



    So maybe you can try that.
     
    Last edited by a moderator: Aug 6, 2012
  6. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England

    Thought it would be well-known. I only just noticed it. Works fine in Sonic 2 so meh, I'm cool =P
     
  7. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Thank you guys. I already noticed the Time/Rings in red bug and it was fixed too long ago :p But thanks anyway. And yes, I said a little while... it can be only a frame. Thanks for checking and thanks for the screenshot.


    About the possible fix... well, SpirituInsanum, I'm using the REV00 dissassembly where that bug shouldn't be happening and it's happening to me and the only thing I added of REV01 is the deformation BG data (from the Sonic Retro guide)....
     
    Last edited by a moderator: Aug 6, 2012
  8. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Well, I tested what you said and you are right. Thanks SpirituInsanum.


    I remember I changed that lines to make better the change between levels. Without this change the level loads the next level deformation when the actual level is fading, and that was ugly. Why can this be affecting to the word ZONE from the title cards only when TIME OVER? any idea of how avoid this?
     
  9. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Keep the first one but not the second, it should be enough to fix both the background and that bug.


    I think it's because buildsprites is being used when it shouldn't, even though it's only one frame.
     
  10. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    That's how already is in my hack. I have the first check only and the second removed.
     
    Last edited by a moderator: Aug 7, 2012
  11. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Yup, I first noticed in 2008 :p
    This is how I fixed it: http://forums.sonicretro.org/index.php?showtopic=8815&view=findpost&p=464936 :)
     
  12. Kensou

    Kensou Well-Known Member Member

    Joined:
    Aug 19, 2010
    Messages:
    59
    That bug is in my hack too. Any of you fixed it?
     
  13. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Sorry, no, I still can't fix this bug... it's too weird. As I said it happens in original Sonic 1 REV01 or if you fixed level transitions in REV00... Any help to try to fix this issue would be much appreciated.
     
  14. KingofHarts

    KingofHarts Well-Known Member Member

    Joined:
    Sep 30, 2012
    Messages:
    53
    Location:
    Chi-Town
    I wanted to point this out that I haven't been able to fix it either. I ask though, what is the difference with fixing the level transitions? I tried reverting it back to the original method... of using the second check... I found NO issue myself, but perhaps I'm not noticing something.


    I DID notice another bug though, that is unrelated to this one but I found it while investigating this one. TIME OVER blinks when the words join together. This lasts for one frame, and also occurs with GAME OVER.


    EDIT: Tested and it also happens in the original. I have a fix if anyone cares to fix this SMALL unrelated bug. Go to _incObj/Game Over.asm and find this code.




    Over_Move: ; Routine 2


    moveq #$10,d1 ; set horizontal speed


    cmpi.w #$120,x_pos(a0) ; has item reached its target position?


    beq.s Over_SetWait ; if yes, branch


    bcs.s Over_UpdatePos


    neg.w d1


    Over_UpdatePos:


    add.w d1,x_pos(a0) ; change item position


    bra.w DisplaySprite


    ; ===========================================================================


    Over_SetWait:


    move.w #720,anim_frame_duration(a0) ; set time delay to 12 seconds


    addq.b #2,routine(a0)


    bra.w DisplaySprite ; KoH additional line to prevent blinking.<==========


    ; ===========================================================================


    Over_Wait: ; Routine 4


    move.b (v_jpadpress1).w,d0


    andi.b #btnABC,d0 ; is button A, B or C pressed?


    bne.s Over_ChgMode ; if yes, branch


    btst #0,mapping_frame(a0)


    bne.s Over_Display


    tst.w anim_frame_duration(a0) ; has time delay reached zero?


    beq.s Over_ChgMode ; if yes, branch


    subq.w #1,anim_frame_duration(a0) ; subtract 1 from time delay


    bra.w DisplaySprite



    You can easily see where I added the line to branch to DisplaySprite in the Over_SetWait: routine. It is the only one of the three without the branch, and without it, this causes the sprite to NOT appear for that frame, hence the flicker. It's that simple, but most might not even notice anyway.
     
    Last edited by a moderator: Oct 11, 2012
  15. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Well in any case, it's still worth knowing, thanks for bringing that up =)
     
  16. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Nice, it also happens in Sonic 2 and Sonic 3 and Knuckles. Never noticed it. Nice find.


    Being picky, but...


    As you may of guessed, that rts is now useless as it's never going to be read. So you might as well delete that "rts" and save space.
     
    Last edited by a moderator: Oct 10, 2012
  17. KingofHarts

    KingofHarts Well-Known Member Member

    Joined:
    Sep 30, 2012
    Messages:
    53
    Location:
    Chi-Town
    Didn't even notice that I put that rts in there. It's out now.
     
Thread Status:
Not open for further replies.