-
Notifications
You must be signed in to change notification settings - Fork 0
Fix libretro option visibility and menu refresh crashes #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes critical issues with libretro core option visibility and menu refresh crashes. The root cause was twofold: FC/FDS config files had locked visibility toggle options (preventing users from accessing advanced options), and the menu system would crash when libretro cores dynamically changed option visibility during menu navigation.
Key changes:
- Implements a dirty flag system for deferred menu rebuilds when option visibility changes
- Adds Menu_refreshItems() to safely update menu state after visibility changes mid-session
- Tracks selected option by key (not index) to preserve user selection across rebuilds
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| workspace/all/player/player_options.h | Adds dirty flag to PlayerOptionList to track when visibility changes require rebuild |
| workspace/all/player/player_menu_types.h | Adds dirty flag to MenuList to signal that items array needs reloading |
| workspace/all/player/player.c | Implements deferred rebuild logic, Menu_refreshItems helper, and key-based selection tracking |
| workspace/all/paks/Emus/configs/base/FC/default.cfg | Removes locked status from visibility options; changes sound quality setting |
| workspace/all/paks/Emus/configs/base/FDS/default.cfg | Removes locked status from visibility options; changes sound quality setting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolves issues where core options would not appear or cause crashes when option visibility changed during menu navigation. The root cause was twofold: FC/FDS config files locked visibility toggle options (preventing users from seeing advanced options), and the menu system would crash when libretro cores changed option visibility mid-session. Changes: - Remove locked status from fceumm_show_adv_* options in FC/FDS configs - Add dirty flag system to PlayerOptionList and MenuList for deferred rebuilds - Implement Menu_refreshItems() to safely update menu after visibility changes - Track selected option by key (not index) to preserve selection across rebuilds - Call update_visibility_callback after option changes, rebuild immediately if dirty - Add NULL safety checks when accessing current_key
9d04d0a to
0d2a442
Compare
When changing an option triggered visibility updates, the on_change callback was calling OptionsMenu_buildAndShow() which recursively entered Menu_options(), creating a nested menu with fresh state. Split OptionsMenu_buildAndShow into OptionsMenu_rebuild (build-only) and OptionsMenu_buildAndShow (build + show). The callback now uses OptionsMenu_rebuild, allowing the existing menu loop to handle the refresh via Menu_refreshItems which preserves selection by key.
Resolves issues where core options would not appear or cause crashes when option visibility changed during menu navigation. The root cause was twofold: FC/FDS config files locked visibility toggle options (preventing users from seeing advanced options), and the menu system would crash when libretro cores changed option visibility mid-session.
Changes: