Skip to content

Mac: one Pro Controller is one pad again, so it keeps its gyro (#971) - #972

Merged
v0lumehi merged 3 commits into
LNPANDY:mainfrom
Haseenesss:fix/971-pro-controller-twice
Nov 9, 2026
Merged

v0lumehi merged 3 commits into
LNPANDY:mainfrom
Haseenesss:fix/971-pro-controller-twice

Conversation

@Haseenesss

@Haseenesss Haseenesss commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Fix or feature

  • Fix
  • Feature

What and why

Fixes the Mac part of #971: one Pro Controller was read as two players, and its gyro did not reach the game.

Symptom. The log in #971 (Breath of the Wild, v1.3.0, one Pro Controller over USB) shows the same pad taken twice at the same USB location, then the controller applet over and over (360 times in 30 s):

[hid] 'Pro Controller' (057e:2009) at USB location 0x69b29174: GameController lists 1 of 2 pads of this model: read here, from its report 0x30
controller 'Pro Controller': player 1
[hid] 'Pro Controller' (057e:2009) at USB location 0x69b29174: GameController lists 1 of 2 pads of this model: read here, from its report 0x30
controller 'Pro Controller': player 2
hid controller applet: 0 to 4 players wanted, 2 connected

Cause. The identical-pads reader (pad_hid_mac.h, new in the v1.3.0 pin) matches the Pro Controller's vendor and product besides the gamepad usages. IOHIDManager reports a device once per matching dictionary it meets, each time under a new IOHIDDeviceRef, and hidpad_found compared references only. So one pad counted as two of its model against GameController's one, both references were read as twins (players 1 and 2), and GameController's controller, the one with motion, was left unread. v1.2.3 did not have this reader.

Change. Upstream fixed the same bug on 2026-11-08 in seedds/nxnative a00f03b (from seedds/nxnative#1722, found on Ocarina of Time). This PR first carried it as a backport. Since main moved the pin to c78d7375, which contains a00f03b, the backport is gone and the fix itself comes with the pin. What remains:

The iOS part of #971 is a separate cause (a controller with no gyroscope that iOS lists with one, which kept the phone's gyro out) and is in #975.

Checked

  • Tests: python3 tools/engine.py check (65 patches apply cleanly to c78d7375). t_controllers_mac, t_motion_pro_mac, t_pad_hid, t_hid, t_pad_pro pass on an engine rebuilt from the series.
  • Test for a fix: test_hid_same_device_twice in t_controllers_mac.m reports a generic pad and a Pro Controller twice each, under two references to one registry entry: one pad and one player for the first, no twins for the second (GameController keeps reading it). It fails without a00f03b and passes with it.
  • Cause confirmed on this Mac (macOS 27.2): a small IOHIDManager probe with two matching dictionaries that both meet one device gets two callbacks with two different IOHIDDeviceRefs for the same registry entry, on a plain and on an independent manager.
  • Run on a device or Mac: not run with a Pro Controller, there is none here. Not checked on iOS.

Screenshots

None, no visible change.

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch says forwarded seedds/nxnative#..., or pending until that PR is open (upstream already has the fix, a00f03b, in the pin; the test is fork-only with patch 0081)
  • A change to a launcher view has before and after screenshots above
  • No keys, game files or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

…DY#971)

IOHIDManager reports a device once for each matching dictionary it meets, each
time under a new IOHIDDeviceRef. pad_hid_mac.h matches the Pro Controller's vendor
and product besides the gamepad usages, and told devices apart by reference only,
so one Pro Controller counted as two of its model against GameController's one.
Both were read as twins, players 1 and 2, and GameController's controller, with
its motion, was left unread. Breath of the Wild opened the controller applet every
few frames and saw no gyro.

Patch 0097 backports seedds/nxnative a00f03b, which knows a pad by its registry
entry. Patch 0098 adds the regression test in t_controllers_mac.m.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main moved the pin to c78d7375, which contains seedds/nxnative a00f03b. The
backport patch is dropped; the regression test in t_controllers_mac.m stays as
patch 0099, after main's 0097 and 0098.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Haseenesss added a commit to Haseenesss/NX2Apple that referenced this pull request Nov 8, 2026
…d 0101

main moved the pin to c78d7375 and added patches 0097 and 0098; LNPANDY#972 takes 0099.
Both patches here apply unchanged on the new pin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renumber patch to 0100, next free on main
@v0lumehi
v0lumehi merged commit 6a592d8 into LNPANDY:main Nov 9, 2026
17 checks passed
@Haseenesss
Haseenesss deleted the fix/971-pro-controller-twice branch November 13, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch-queue Changes the patch queue or the upstream pin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants