libretro compliance improvements#87
Merged
Merged
Conversation
Performance interface (GET_PERF_INTERFACE 28): - Add CPU feature detection for ARM (NEON, VFP, ASIMD, CMOV) - Use compile-time detection via predefined macros - Implement timing and profiling callbacks Core options visibility: - Add visible field to PlayerOption struct - Implement SET_CORE_OPTIONS_DISPLAY (55) handler - Implement SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK (69) - Invoke visibility callback on menu open and option changes - Add OptionsMenu_invalidateList() for menu rebuild Additional environment callbacks: - GET_LANGUAGE (39) - returns RETRO_LANGUAGE_ENGLISH - SET_MESSAGE_EXT (60) - extended message logging - GET_PREFERRED_HW_RENDER (56) - returns RETRO_HW_CONTEXT_NONE Bug fixes: - Fix SET_VARIABLE (70) incorrect NULL pointer handling Add libretro compliance documentation with implementation status and recommendations for future work.
Add two new environment callbacks matching RetroArch implementation: - GET_MESSAGE_INTERFACE_VERSION (59): Returns version 1 - SET_MINIMUM_AUDIO_LATENCY (63): Dynamic audio buffer sizing with 512ms cap and default floor behavior Fix fast-forward broken by vsync/audio rewrite: - Vsync loop: Run core multiple times per vsync (2x-5x speeds) - Audioclock loop: Throttle vsync to 30ms during FF - Frame time callback: Prevent timing discontinuity when FF ends - Audio buffer status: Report inactive during FF - GET_THROTTLE_STATE: Report FPS (e.g., 300fps) instead of multiplier Update libretro-compliance.md with comprehensive RetroArch comparison covering video, audio, input callbacks, environment commands, and architectural differences.
There was a problem hiding this comment.
Pull request overview
This PR significantly improves LessUI's libretro API compliance by implementing several missing environment callbacks and fixing fast-forward behavior. It brings the player closer to RetroArch's reference implementation while maintaining the minimal, focused design philosophy for handheld devices.
Key Changes:
- Implements new libretro environment callbacks (performance interface, extended messages, language, hardware render rejection, audio latency control, option visibility)
- Fixes fast-forward speed calculations to properly report FPS-based rates instead of multipliers
- Adds dynamic option visibility support for cores that hide/show options based on other settings
- Includes comprehensive 536-line compliance documentation
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| workspace/all/player/player_options.h | Adds visible field to PlayerOption struct for dynamic option hiding |
| workspace/all/player/player_internal.h | Adds update_visibility_callback field to Core struct |
| workspace/all/player/player_env.h | Adds core_fps field to PlayerThrottleInfo for accurate rate reporting |
| workspace/all/player/player_env.c | Fixes throttle state rate calculation to use FPS-based values |
| workspace/all/player/player.c | Implements 8+ new environment callbacks, performance interface, option visibility handling, and menu invalidation |
| workspace/all/player/player_loop_vsync.inc | Refactors fast-forward to run core multiple times per vsync with proper audio/timing handling |
| workspace/all/player/player_loop_audioclock.inc | Adds fast-forward flip throttling and consistent audio buffer status reporting |
| workspace/all/common/api.h | Declares SND_setMinLatency function for audio buffer adjustment |
| workspace/all/common/api.c | Implements dynamic audio latency adjustment with proper locking and bounds checking |
| tests/unit/all/player/test_player_env.c | Updates throttle state tests to expect FPS-based rates instead of multipliers |
| docs/libretro-compliance.md | Comprehensive 536-line compliance analysis comparing with libretro spec and RetroArch |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR significantly improves LessUI's libretro API compliance by implementing several missing environment callbacks and fixing fast-forward behavior. It brings the player closer to RetroArch's reference implementation while maintaining the minimal, focused design philosophy for handheld devices.