Skip to content

Configurable fast-forward rate, toggle, and frame skip - #7

Open
weavermonkey wants to merge 3 commits into
OpenEmu:masterfrom
weavermonkey:fast-forward-toggle-speed
Open

weavermonkey wants to merge 3 commits into
OpenEmu:masterfrom
weavermonkey:fast-forward-toggle-speed

Conversation

@weavermonkey

@weavermonkey weavermonkey commented Oct 25, 2026 •

Copy link
Copy Markdown

Note: This change was written with assistance from Claude (Anthropic's AI coding assistant, via Claude Code). I reviewed and tested it, but please review it with that in mind.

Companion PRs: OpenEmu/OpenEmu-SDK#40, OpenEmu/OpenEmu#5155. Part of OpenEmu/OpenEmu#4886.

Changes

  • OEGameCoreHelper.setGameplayRate(_:fastForwardRate:): same signature as the one proposed in Add configurable gameplay rates #5, so the two can be reconciled easily. Defaults stay 1× / 5×.
  • setFastForwardEnabled(_:): lets the host turn fast-forward on/off (used by a menu item).
  • setFastForwardButtonToggles(_:): when true, the existing hold-to-fast-forward button toggles on press and ignores release. Off by default.
  • Handles the SDK's new toggleFastForwardGameplay: event.
  • The helper tracks fast-forward state, applies the configured rate once emulation has started, and restores it after unpausing. Display sync stays off whenever the rate is above 1× (macOS 13.0 Ventura upgrade stops fast-forward from working OpenEmu#4780).
  • Frame skip while fast-forwarding: at most 120 frames per second are presented while the rate is above 1×. Without this, presenting every emulated frame holds emulation near the display rate, so 10× and Unlimited ran no faster than 5×. VBA-M does the same ("speed-up frame skip").

Testing

Built in GitHub Actions (macos-15, Xcode 16.4, x86_64 Release) and run on macOS 15.3 (Apple Silicon, Rosetta) with mGBA and Pokémon Emerald. Measured emulation speed with temporary logging (not included):

Setting Measured
1× 1.0×
10× 10.0×
20× 20.0× (steady)
30× 22–27× (machine limit for this x86_64 build under Rosetta)

Toggle via menu, via the new Toggle Fast Forward binding, and via Space with "key toggles" on; hold behaviour with it off.

🤖 Generated with Claude Code

Varun Vembar and others added 3 commits October 25, 2026 21:13
- Add setGameplayRate(_:fastForwardRate:) to OEGameCoreHelper, matching
  the API proposed in OpenEmu#5. Defaults stay 1x and 5x.
- Add setFastForwardEnabled(_:) so the host can turn fast-forward on or
  off from a menu.
- Handle the SDK's new toggleFastForwardGameplay: global event.
- Track fast-forward state in the helper, apply the configured rate once
  emulation has started, and restore it after unpausing.
- Keep display sync disabled whenever the rate is faster than 1x
  (OpenEmu/OpenEmu#4780).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Presenting every emulated frame waits on the layer for a drawable, which
holds emulation near the display's frame rate, so 10x and Unlimited ran
no faster than 5x. While the rate is above 1x, present at most 120 frames
per second (similar to VBA-M's speed-up frame skip).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setFastForwardButtonToggles(_:) makes the existing hold-to-fast-forward
button toggle fast-forward on press and ignore release. Off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant