ckosmic / sm64ex-ios

iOS/tvOS port of https://github.com/sm64pc/sm64ex/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frame-pacing issues

ckosmic opened this issue · comments

On iOS, SDL_GL_SetSwapInterval is not supported, so the app defaults to timer-based frame-pacing rather than vsync. This ultimately leads to the game sometimes appearing at a lower framerate. This is very noticeable without the 60 fps patch, but is virtually a non-issue with the 60 fps patch applied.

Vsync has been partially fixed in 812669b by rendering frames using CADisplayLink. This syncs SDL rendering with the screen's refresh rate, but is sometimes inconsistent, visually dropping frames, which eventually catch up. Sadly this is a limitation of CADisplayLink, however, it is a lot better than the previous timer-based frame pacing.

This is not needed for the 60fps patch as frame pacing seems to be a non-issue there, so the patch has been updated to revert to timer-based rendering.

A bonus side effect of this change allows the touch joystick to be updated frame-independent from the game, updating it at a smooth 60fps.