ASM to Sega Genesis Platform

All about assembly programming in the Sega Genesis console.


    How to Fix the Frame Counter Bug

    Share

    OuricoDoido
    Admin

    Mensagens : 46
    Data de inscrição : 2011-01-09
    Current Project : Sonic Open Source Project

    How to Fix the Frame Counter Bug

    Post  OuricoDoido on Thu Jun 02, 2011 12:51 pm

    If you noticed, the frame counter start before than level start. The frame counter start, pass 4 frames, stop to load pallet, and after continue again. These 4 frames are 4 lost frames in counter, and can change the final time of the act.

    To fix the Frame Counter Bug, first open the sonic1.asm.

    Go to loc_39E8 subroutine, find and delete or comment this line:
    Code:
          move.b   #1,($FFFFFE1E).w ; update time counter

    Now go to Level_StartGame subroutine, and add this line:
    Code:
          move.b   #1,($FFFFFE1E).w   ; update time counter


    To have not problems when start from a lamppost, go to LevSz_ChkLamp and between these lines:
    Code:
          move.w   ($FFFFD00C).w,d0
          bra.s   loc_60D0
    Add this code:
    Code:
    ;---------------------
    ; Fix the Frame Counter Bug  //  when start by a Lamppost not have this bug,
                      ; but after correct the main bug, you see zeros in place of the numbers
          movem.l  d0-a6,-(sp)
          move.l  #$5E400003,d0
          moveq  #0,d1
          move.b  ($FFFFFE23).w,d1 ; load  minutes
          jsr  Hud_Mins
          move.l  #$5EC00003,d0
          moveq  #0,d1
          move.b  ($FFFFFE24).w,d1 ; load  seconds
          jsr  Hud_Secs
          movem.l  (sp)+,d0-a6
    ;---------------------


    Last edited by OuricoDoido on Tue Jun 07, 2011 6:06 pm; edited 1 time in total

    OuricoDoido
    Admin

    Mensagens : 46
    Data de inscrição : 2011-01-09
    Current Project : Sonic Open Source Project

    Re: How to Fix the Frame Counter Bug

    Post  OuricoDoido on Mon Jun 06, 2011 9:55 pm

    Added the code to FIX the lamppost bug after apply this guide.

    When start by a lamppost not have this bug, but after correct the main bug, you see zeros in place of the time.

    OuricoDoido
    Admin

    Mensagens : 46
    Data de inscrição : 2011-01-09
    Current Project : Sonic Open Source Project

    Re: How to Fix the Frame Counter Bug

    Post  OuricoDoido on Tue Jun 07, 2011 6:53 pm

    This tutorial is now fixed, changed the place to put the code about the lamppost.
    avatar
    Green Snake

    Mensagens : 2094
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Re: How to Fix the Frame Counter Bug

    Post  Green Snake on Sun May 19, 2013 11:49 am


    Sponsored content

    Re: How to Fix the Frame Counter Bug

    Post  Sponsored content


      Current date/time is Sun Dec 10, 2017 8:57 pm