Skip to content

feat(debug): add flag names, descriptions and multi-bank search to F8… - #166

Open
alfonsoalvarohervas-sudo wants to merge 11 commits into
999sian:masterfrom
alfonsoalvarohervas-sudo:feature/flag-names
Open

feat(debug): add flag names, descriptions and multi-bank search to F8…#166
alfonsoalvarohervas-sudo wants to merge 11 commits into
999sian:masterfrom
alfonsoalvarohervas-sudo:feature/flag-names

Conversation

@alfonsoalvarohervas-sudo

Copy link
Copy Markdown
  • Flag Name & Description Database: Added a generated C++ lookup database (port/port_flag_names.cpp) that provides flag names and documentation strings.
  • F8 Menu UI Improvements:
    • Replaced raw flag numbers in the checkbox labels with their corresponding enum names (e.g., START, MACHI_SET_1).
    • Added hover tooltips displaying the flag description/comment.
    • Added a search filter bar at the top of the raw flags tab that matches queries case-insensitively against both the name and description across all flag banks (prefixed by the bank name).
  • Input Focus Bug Fix: Modified port/port_bios.c to prevent the GBA menu keyboard navigator from intercepting keystrokes when ImGui inputs are active (Port_ImGui_WantsTextInput()). This fixes an issue where pressing Backspace (to edit search text) or Escape would inadvertently trigger a menu exit/close.

@alfonsoalvarohervas-sudo

Copy link
Copy Markdown
Author

The information for some flags isn't correct. I'm developing a debugging tool to get the mapping right.

@999sian

999sian commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Thanks — the F8 flag-name/search work is genuinely useful and the code is scoped and low-risk. Two things before merge:

  1. Rebase needed. It conflicts with master in port/port_runtime_config.cpp — just a concurrent kBoolCfg[] addition (your debug_flag_notifications vs master's rando_dungeon_items). Trivial: keep both entries and take master's wider kIntCfg block. I resolved it locally and it builds + boots clean.
  2. Flag data. You already noted some flag names/descriptions are wrong and you're building a tool to fix the mapping. Let's hold the merge until that pass lands so we don't ship incorrect data — the UI itself is ready.

Note: master CI was red for an unrelated reason (missing EGL/GLES dev packages on the Linux runners); that's now fixed on master, so once you rebase the checks should reflect your code.

Alfonso added 4 commits July 11, 2026 16:16
…Flags tab

- Add optional flag notification system: when enabled, every flag set by
  the engine is printed to the terminal and shown as an on-screen toast.
  Hook lives in src/flags.c (SetLocalFlagByBank) → Port_Debug_OnFlagSet.
  Toggle is a session-only checkbox in the Flags tab, off by default.
- Add "Show only active" checkbox to the Flags tab: filters the list to
  only show flags currently set to 1, compatible with the search filter.
- Added `"debug_flag_notifications"` to persistent configurations (`config.json`), defaulting to false on first launch.
- Updated `Port_Config_SetDebugFlagNotifications` to write to config JSON and auto-save.
- Enabled Virtual Terminal Processing (`ENABLE_VIRTUAL_TERMINAL_PROCESSING`) on Windows startup in `port_main.c` to support ANSI color escape sequences.
- Updated flag change print statements in `port_debug_actions.c` to output in yellow text (`\033[33m`).
@alfonsoalvarohervas-sudo

Copy link
Copy Markdown
Author

Thanks! I have successfully rebased the branch onto master and resolved the conflict in port/port_runtime_config.cpp (preserving both debug_flag_notifications and rando_dungeon_items, and keeping the updated kIntCfg block).

Regarding the flag data, the mapping is already resolved (all flag names and descriptions should be right). Everything builds and boots clean on my end. The PR is ready for review.

Alfonso and others added 6 commits July 11, 2026 23:27
The Android build job was intermittently aborting with a 'double free or corruption (out)' error during parallel shader compilation, which is a known issue in xmake v3.0.9. Although the workflow pins the xmake version to v3.0.8, the setup-xmake action was restoring the in-use cached v3.0.9 version because the cache key remained 'android-apk'. Changing the cache keys to 'android-apk-v3' invalidates the stale cache, forcing a clean install of xmake v3.0.8.
@alfonsoalvarohervas-sudo

Copy link
Copy Markdown
Author

This PR is now ready for review.

Although there are still some undocumented flags, documenting them properly will take time as I need to figure out which ones get triggered while playing through the game. I’ll keep working on this gradually, and once I have enough documented, I’ll open a new PR.

Whenever you have a moment, please take a look and let me know if anything needs to be changed. Hopefully, combined with the level editor, this feature will allow for much more freedom to explore the game and debug the port.

Let me know if you need anything else!

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.

2 participants