Skip to content

Improve controller port identity matching - #305

Merged
patchzyy merged 2 commits into
mainfrom
fix/issue-240-gc-adapter-ports
Oct 18, 2026
Merged

patchzyy merged 2 commits into
mainfrom
fix/issue-240-gc-adapter-ports

Conversation

@patchzyy

@patchzyy patchzyy commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Improve controller port identity matching fix #240

Summary by CodeRabbit

  • Bug Fixes
    • Controller port preferences now retain additional device details, improving controller recognition and port assignment when multiple controllers are connected.
    • Newly discovered controller details are saved for future matching.
  • User Interface
    • The controller-assignment menu now shows the assigned port number beside controllers that already have one.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 054f3d69-d1ec-4364-82be-262878422db3
📥 Commits

Reviewing files that changed from the base of the PR and between 9058913 and 04ad20a.

📒 Files selected for processing: 3
  • aurora-main/lib/input.cpp
  • aurora-main/lib/input.hpp
  • runtime/src/settings_overlay.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Walkthrough

Controller preferences now store each controller’s path and player slot, and the reader supports preference versions 2 and 3. Port assignment uses scored identity matches, and the controller menu shows the assigned port for connected controllers.

Changes: Controller port assignment

Layer / File(s) Summary
Controller identity preferences
aurora-main/lib/input.hpp, aurora-main/lib/input.cpp
Controller identities now include device path and player slot. Preference version 3 stores these fields, while the reader continues to accept version 2.
Connection metadata capture
aurora-main/lib/input.cpp
Startup captures SDL player indices for connected gamepads. Controller discovery stores the captured slot and device path, and removal clears pending captured slot data.
Scored port assignment
aurora-main/lib/input.cpp, runtime/src/settings_overlay.cpp
Port assignment sorts candidate matches by score, port, and instance, then assigns each port and controller at most once. GUID matches can update saved path and slot values. Assigned controllers display their port number in the menu.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: darthmdev, galaxisbeast

Merge Risk: ⚪ Minimal · up to 04ad2

The port-identity change appears ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: improved controller port identity matching.
Linked Issues check Passed Issue #240 requires more than one GameCube controller to be configurable. The change stores each controller path and SDL slot, scores these identity fields, and assigns each matched controller and por…
Out of Scope Changes check Passed The changed files stay within issue #240. Persistence updates, identity scoring, startup slot capture, one-to-one port assignment, and controller-menu labels all support controller port identity and m…
Full details: Linked Issues check

Explanation

Issue #240 requires more than one GameCube controller to be configurable. The change stores each controller path and SDL slot, scores these identity fields, and assigns each matched controller and port at most once. It also preserves version 2 preferences and distinguishes already assigned controllers in the configuration menu. These changes address the reported identical-port matching behavior. Issue #240 defines no separate automated-test requirement.

Full details: Out of Scope Changes check

Explanation

The changed files stay within issue #240. Persistence updates, identity scoring, startup slot capture, one-to-one port assignment, and controller-menu labels all support controller port identity and multi-controller configuration. No unrelated feature change is demonstrated.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@patchzyy

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@patchzyy
patchzyy merged commit 8676d1a into main Oct 18, 2026
7 checks passed
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.

[Bug] WiiComped registers all 4 GameCube Controller Adapter ports to the Controller on the highest priority port number

1 participant