Results 1 to 10 of 10

Thread: Odd FPS counter

  1. #1
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310

    Odd FPS counter

    Hi!

    I have a question to ask:

    I'm having trouble with the fps counter in Glide64. Since Glide64 must be run in fullscreen, the pj64 fps counter is not an option to look at. On my fps counter, I get 30 fps when Mario is running full speed, and 20 fps when Zelda is running full speed. This is obviously not correct since Zelda is NOT running at 20 fps... This is when I'm updating the frame count every time the buffer is swapped.

    The FPS counter seems to show 60 / number of UpdateScreen()s per ProcessDList(). When I place the frame counter at the beginning of UpdateScreen() instead of where the buffer is swapped, I get values that seem correct; 60 consistently. But this SHOULDN'T be correct, it is adding 2+ frames to the counter per buffer swap!

    Here's the FPS code, but I'm pretty sure it's correct.



    if (fullscreen)
    {
    LOG ("BUFFER SWAPPED\n");
    grBufferSwap (0);

    #ifdef FPS
    // Check frames per second
    fps_count ++;
    if (fps_count >= 30)
    {
    LARGE_INTEGER difference;
    QueryPerformanceCounter (&fps_next);

    difference.QuadPart = fps_next.QuadPart - fps_last.QuadPart;
    fps = 30.0f / (float)((double)difference.QuadPart / (double)perf_freq.QuadPart);
    fps_last = fps_next;
    fps_count = 0;
    }
    #endif
    }

    this means that on every 30th frame, calculate the FPS.

    Any clue to why this might happen?

    Btw, these are the functions that are being called:

    Mario (30 fps):
    ProcessDList ()
    UpdateScreen () <- BUFFER SWAPPED HERE
    UpdateScreen ()
    ... repeated & repeated

    Zelda (20 fps):
    ProcessDList ()
    UpdateScreen () <- BUFFER SWAPPED HERE
    UpdateScreen ()
    UpdateScreen ()
    ...

    Zelda (part that runs at 60 fps):
    ProcessDList ()
    UpdateScreen () <- BUFFER SWAPPED HERE
    ...

    Obviously it somehow is depending on the number of UpdateScreens, but WHY? ???
    Last edited by Dave2001; June 26th, 2002 at 01:52.


    • Advertising

      advertising
      EmuTalk.net
      has no influence
      on the ads that
      are displayed
        
       

  2. #2
    *poke* LD.'s Avatar
    Join Date
    May 2002
    Location
    UK
    Posts
    268
    I think it's because Mario actually DOES run at around 30 frames per second. The PJ64 fps counter measures something different as far as I recall. At least, that's what I read in another thread somewhere on this forum.

    You seem to be getting the 'true' fps when you put the code at a buffer swap, and PJ64's fps when you put the code at every UpdateScreen.

    I think you need to find someone who can see both the PJ64 fps counter and the Glide64 fps counter at the same time (having a Voodoo2 and two monitors for example) so you can check what's happening as you debug. It might also be a good idea to test it on games / machines that don't run at a constant 60fps so you can check how exact it is


    [EDIT: I'm trying so hard not to make it sound like I'm begging here, but if you can't find anyone else better I'd be happy to help. Damnit, I feel like such a dirty n00b now...]
    Last edited by LD.; June 26th, 2002 at 02:36.

  3. #3
    ????????????????????????? Doomulation's Avatar
    Join Date
    Nov 2001
    Location
    ????????????????
    Posts
    8,780
    Dave,
    using the beta-tester eVoodoo version, you can actually see the pj-fps bar flashing in full screen. This has been confirmed by mcleod that it is for debugging purposes.

    Perhaps you could use it to investigate your problem.
    Atashi wa juu-yon-sai no onna no ko! Atashi no namae wa Miizuki. Yurushiku ne!
    Nani? Atashi o shinjirimasen desu ka? Baka!
    "You're all doomed! Doomed, I say! Hehe... are we approaching the end of the world?"

    shikata ga kaite aru - "the instructions are written above"
    Need to download GoodN64 or instructions to use it? Need to check if it's a good or bad rom?
    Download: Glide64 | Hacktarux's wrapper

  4. #4
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    While using eVoodoo, i can see both fps counters...

    The problem is... using the "real" fps, when the buffers are swapped, mine gets 7 when pj64 gets 20

    when I use the every UpdateScreen method, they are almost exactly the same.
    Last edited by Dave2001; June 26th, 2002 at 04:03.

  5. #5
    Superman Azimer's Avatar
    Join Date
    Nov 2001
    Location
    USA
    Posts
    837
    PJ64 counts the virtual FPS (when the N64 console is refreshing on the TV). A buffer swap doesn't always occur here. A dlist is Vsync dependant and will not run when an update is in mid-scan. Zelda renders fewer frames then Mario. That is the bottom line. The renderer is designed to drop frames when the game is going faster then output. Not an issue on a console, but as far as I have seen, all games seem to have their own "maximum" dlists/sec setting.
    -Azimer

    "I am not a teacher: only a fellow traveler of whom you asked the way.
    I pointed ahead -- ahead of myself as well as of you." (George Bernard Shaw)

  6. #6
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    I actually figured this out before your post, Azimer. Thanks much though!

    All of the sudden, when in a huge conversation, everything hit me at once!

    The NTSC TV updates at 60hz. UpdateScreen() is actually a VERTICAL INTERRUPT! That is why it is called twice per ProcessDList() for mario. Mario is really only running at 30 frames per second, and the TV is updating at 60 hz. This makes my previous counter a VI/s counter and not a frames per second counter.

    This also explains why when I used UpdateScreen(), i got the percentage of speed * 60.



    thx everybody, I'll include options for both FPS counter and VI/s counter since one is the real FPS and one is a consistent comparison of speed.
    Last edited by Dave2001; June 26th, 2002 at 05:28.

  7. #7
    ????????????????????????? Doomulation's Avatar
    Join Date
    Nov 2001
    Location
    ????????????????
    Posts
    8,780
    Glad you finally figured it out, Dave.
    Good work.
    Atashi wa juu-yon-sai no onna no ko! Atashi no namae wa Miizuki. Yurushiku ne!
    Nani? Atashi o shinjirimasen desu ka? Baka!
    "You're all doomed! Doomed, I say! Hehe... are we approaching the end of the world?"

    shikata ga kaite aru - "the instructions are written above"
    Need to download GoodN64 or instructions to use it? Need to check if it's a good or bad rom?
    Download: Glide64 | Hacktarux's wrapper

  8. #8
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    Lots of new toys to play with
    Attached Thumbnails Attached Thumbnails ss33.jpg  

  9. #9
    Emutalk Member linker's Avatar
    Join Date
    Nov 2001
    Location
    157772039
    Posts
    516
    Finally
    <B>My Mk4 Combos:</B> <a href="http://zelda.hit.bg/sonya.avi">Sonya</a> | <a href="http://zelda.hit.bg/reiko.avi">Reiko</a> | <a href="http://zelda.hit.bg/reptile.avi">Reptile</a>

  10. #10
    Emu64 Staff DuDe's Avatar
    Join Date
    Nov 2001
    Location
    Tel-Aviv, Israel
    Posts
    1,854
    Neat
    In the land of the impotent, the man with the one working bollock is king.
    <a href=http://www.stylefone.com><img src=http://www.stylefone.com/signature.php></img></a>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •