Results 1 to 6 of 6

Thread: Auto frameskip

  1. #1
    Boring person
    Join Date
    May 2006
    Posts
    194

    Auto frameskip

    I know a lot of people have done emulators here, so I was wondering if anyone has done auto-frameskip. I'd love to see some ideas for systems that work best.



    • Advertising

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

  2. #2
    A lowdown dirty shame blueshogun96's Avatar
    Join Date
    Aug 2005
    Location
    Puyallup, WA
    Posts
    196
    I've never done auto frameskip, but this is the most logical way that I can think to do it. I'm guessing it's all a matter of the percentage of the current framerate (i.e. actual_framerate/target_framerate). So let's say you are running at 30fps and you want 60fps, since 30 if 50% of 60, try rendering only half of the frames you render every second. Or if you are getting 15 fps out of 60, that's 25%, so try rendering 1 out of every four frames. I haven't actually tried this, but I hope it helps you understand the concept. Also, if I'm wrong, please feel free to correct me.
    This is me and my PC everyday

    Need a good tutorial on emu programming? Click here. (Link Updated)
    Dynarec article
    Misc emu programming tidbits

  3. #3
    Boring person
    Join Date
    May 2006
    Posts
    194
    I don't think that'll work well, because rendering the frames is not 100% of the computation time. However, I was thinking about it and this might work (I need to try it, should be easy):

    Keep two time records, "virtual" time and "real" time. The former would be computed by adding the amount of time that a frame should take every frame. The latter would be computed by measurement. If the latter gets too far behind the former, stop rendering frames until it catches up (or a threshold is reached). Thoughts?

  4. #4
    Moderator
    Join Date
    Nov 2001
    Location
    Oulu, Finland
    Posts
    3,271
    I'd say that if you notice you are running too slow, drop the fps, and check again if you are running too slow, readjust, etc.

    If you can somehow compute or estimate the amount of computation time drawing takes, you could calculate how many frames to drop for the optimal speed.



  5. #5
    Boring person
    Join Date
    May 2006
    Posts
    194
    There's a question of what to drop it to, but more importantly, you'd be constantly playing a game if seeing if you are running "just fast enough" - it's easy to drop too many frames and be fine.

    The problem with computing how long drawing a frame takes is that often a frame is not drawn all at once, but in scanlines interleaved with emulating the CPU code. You can add up the time for every scanling but then the timing overhead starts getting more serious and you need a lot of precision.

    I think that in the end it'll be better to have a method that agressively wants to render every frame and only drops them each on a one by one basis if it has to.

  6. #6
    EmuTalk Member Garstyciuks's Avatar
    Join Date
    Jan 2006
    Posts
    152
    I would make it to check if it is running too slow. If it is, then increase the frame skip by some amount. If it is still not good, increase more. If it is too fast, decrease the frame skip. I think that's the same that Slougi said.

Similar Threads

  1. Frameskip
    By xor in forum Plugins
    Replies: 9
    Last Post: August 11th, 2005, 21:06
  2. Frameskip?
    By ganondorfan in forum Chankast
    Replies: 2
    Last Post: February 25th, 2005, 13:58
  3. Grand Theft Auto Bad!
    By Doomulation in forum Talk of the Town
    Replies: 57
    Last Post: February 24th, 2005, 23:59
  4. (And alternative for) auto frame skip!!!
    By mightyrocket in forum 1964
    Replies: 0
    Last Post: March 2nd, 2003, 11:39

Posting Permissions

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