SorayutSirisakhon/samp-android-stable-fps-unlock
Stable FPS unlock for SA-MP Android 2.10 / GTA SA Android with real refresh-rate clamp and frame pacing fixes.
Este repositório não tem arquivo de licença. Ele é público para leitura, mas isso sozinho não dá permissão para reutilizar.
README.md
SA-MP Android Stable FPS Unlock
Small FPS unlock snippets for SA-MP Android / GTA SA Android ports, including SA-MP Android 2.10 style projects.
This package only includes the FPS unlock and frame-pacing related lines. It does not include full project files, game assets, private launcher code, or any proprietary source.
What It Does
- Disables GTA SA Android's original 20/30 FPS cap writes.
- Applies a custom FPS cap from your client setting.
- Clamps the cap to the device display refresh rate to avoid uneven pacing.
- Keeps the cap in a safe 30-120 FPS range by default.
- Includes an optional stutter fix for projects that repeatedly call
sched_setaffinity.
Files
snippets/01-patches-cpp-stable-fps.cpp- Add this to the native patch file that owns
ApplyFPSPatch().
- Add this to the native patch file that owns
snippets/02-main-cpp-jni-bridge.cpp- Add this to the native JNI registration file.
snippets/03-samp-java-refresh-rate.java- Add this to your Android activity before native initialization.
snippets/04-settings-cpp-fps-clamp.cpp- Use this if your settings currently force FPS back to
120every load/save.
- Use this if your settings currently force FPS back to
snippets/05-optional-affinity-stutter-fix.cpp- Optional. Use only if your project has a worker that reapplies thread affinity every second.
Install
- Add the C++ includes and helper functions from
01-patches-cpp-stable-fps.cpp. - Replace your old
ApplyFPSPatch()FPS value withResolveFPSLimit(). - Add the JNI bridge from
02-main-cpp-jni-bridge.cpp. - Add the Java refresh-rate detection and native call from
03-samp-java-refresh-rate.java. - Keep your user FPS setting within
30..120, or apply04-settings-cpp-fps-clamp.cpp.
Notes
- Offsets are build-specific. Verify the offsets against your
libGTASA.so. - Built around SA-MP Android 2.10 style code paths, but the idea can be adapted to other GTA SA Android builds.
- On 60 Hz phones, the cap resolves to 60 even if the setting is 120.
- On 90 Hz phones, the cap resolves to 90.
- On 120 Hz phones, the cap resolves to 120.
- This avoids asking EGL/vsync to pace frames above the actual display refresh rate, which is a common cause of unstable unlocked FPS.
Suggested GitHub Topics
sa-mp, samp, samp-android, samp-mobile, samp-android-2-10, gta-sa, gtasa-android, android, fps-unlock, fps-unlocker, frame-pacing, refresh-rate, renderware, libgtasa
Optional Stutter Fix
If your project has a thread that calls sched_setaffinity every 1000 ms, remove that loop or change it to apply affinity once per new thread. Reapplying affinity periodically can cause short scheduler interruptions that look like regular stutter.
androidfps-unlockfps-unlock-androidfps-unlockerframe-pacinggta-sagta-sa-androidgtasa-androidlibgtasarefresh-raterenderwaresa-mpsampsamp-2-10samp-210samp-androidsamp-android-2-10samp-mobile
Esta página é montada com o que o GitHub publica sobre o repositório. O samp.directory não hospeda o código. Avisar de um problema com esta página