libretro / libretro/RetroArch

[Feature Request] leveraging/improving frameskip support

Open
#10,133 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

Damn, i was pretty sure i did this one a long time ago, but it seems i forgot.

So, in emulation, skipping a frame generally means updating the state of the machine while not drawing anything. It's useful for lowering the charge, it dramatically improves playability for emulated systems with complex rendering on lower-end devices, not sure there are other use cases (maybe for emulating content with higher framerate than the host device is capable of ?)

There are 2 ways to achieve this :

  • The one currently feasible with RA : skip a fixed number of X frames over Y frames, it's annoying for the user because it requires setting X/Y values, and skipping at a fixed rate is not optimal (some part of the running content won't increase the charge that much)
  • The one currently problematic with RA : skip automatically, generally based on mecanisms to detect if the emulation is falling behind (time-based ?), i don't think it's possible with RA at the core level because RA would screw with time-based mecanism by using features (fastforward, rewind, ...) or even by simply opening the menu, ending up with the core trying to catch up after this.
Expected behavior

For a given frame, the frontend decide if rendering is necessary, based on settings and computing, and will tell the core to actually render it or not, could be either an arg added to retro_run, or an environment callback, i guess the second one would be prefered to avoid breaking the api.

Actual behavior

The frontend doesn't compute this information, so the core can't be aware either, and is limited to using core options for setting fixed frameskip.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the libretro API's retro_run path and environment-callback handling described in the issue. Determine how the frontend can communicate a per-frame render decision without breaking the API, then verify that the behavior supports automatic frameskip while preserving timing and existing fast-forward, rewind, and menu behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.