Repository navigation
Mac: split a Joy-Con pair into two sideways controllers (#740) - #745
Conversation
30a51a9 to
e152cb7
Compare
e152cb7 to
ac02cc0
Compare
v0lumehi
left a comment
There was a problem hiding this comment.
I read the whole diff, including the engine patch. This is good work and I would merge it after the points below.
What I like:
- The switch is opt-in and off by default, so nothing changes for anyone who does not turn it on.
- The decoder checks the report id and the length, reads only up to byte 11 and stays inside the 128 byte buffer. The stick is calibrated once and then scaled with a dead zone and clamped.
- The new checks in
t_pad_hid.cuse real samples captured on macOS, and the Swift tests cover the driver and the environment variable. - All CI checks are green, the before and after screenshots are there and the patch is forwarded as seedds/nxnative#1322.
Before it merges:
- The patch header says
Upstream-Status: pending. It should sayforwarded seedds/nxnative#1322(patches/README.md). - #740 and this PR are in v1.1.1, but rc1 is tagged and @LNPANDY is still testing it. Please move both to v1.1.2.
- Please try it once with two real Joy-Cons on a Mac and report the result here. I mean connect and disconnect, the player order, and Home on the right half. The samples are real, but I did not see a game played with the split pair.
Smaller points, none of them blocks the merge:
IOHIDManagerOpenneeds the Input Monitoring permission on macOS. The description of the switch should say so.- A split Joy-Con has no rumble, no motion and no battery level in the launcher, because it does not go through GameController. Please write that in the docs.
- A single Joy-Con half now counts as a gamepad and not as a pair, also without the switch. That looks right to me, but it is a behaviour change.
- The Qt front end has no switch. This is fine, there is no macOS HID on Windows.
ac02cc0 to
cdfc01b
Compare
Add DM_JOYCON_SPLIT=1 so macOS skips GameController's combined Joy-Con input and reads Joy-Con (L) (0x057e:0x2006) and Joy-Con (R) (0x057e:0x2007) directly over IOHIDManager 0x30 reports as Player 1 and Player 2 sideways controllers with a 90-degree stick and 6-axis IMU rotation, SL/SR mapped to L/R, and per-handle Core Haptics rumble (GCHapticsLocalityLeftHandle and GCHapticsLocalityRightHandle). Keep the setting in the Controllers sheet (shared by Console Mode and Desktop Mode Settings -> Controls -> Controllers -> Open...) and localize its label across all 6 languages.
cdfc01b to
fc56ca3
Compare
|
Additional details and reproduction results I tested the split Joy-Con functionality with two physical Joy-Con controllers in Super Mario Party Jamboree. Here are the issues I observed:
When only one Joy-Con is connected (either Left or Right), NX2Apple does not recognize it independently. Both controllers seem to be required for detection.
When I click the identify button for either the Left or Right Joy-Con in the controller identification interface, both Joy-Cons vibrate simultaneously. I would expect only the selected Joy-Con to vibrate.
With split Joy-Con mode enabled:
However, when entering motion-controlled minigames in Super Mario Party Jamboree, the game displays a prompt asking me to switch to a single Joy-Con controller. This suggests that although basic input handling is successfully separated, the game may still not recognize each controller as an independent single Joy-Con, particularly regarding controller type and motion-sensing capabilities. Could you please investigate whether the split controllers are being exposed with the correct device identity, controller type, and motion-sensing capabilities? Also, could the independent connection and vibration behavior be checked? Thanks for your work on this feature! |
Version: 1.2.2 |
Closes #740
Forwarded upstream: seedds/nxnative#1322
Summary
DM_JOYCON_SPLIT=1so macOS skipsGameController's combined Joy-Con input and readsJoy-Con (L)(0x057e:0x2006) andJoy-Con (R)(0x057e:0x2007) directly overIOHIDManager0x30reports as Player 1 and Player 2 sideways controllers.SL/SRmapped toL/R, sideways 6-axis IMU motion (correcting the Right Joy-Con's inverted raw Y/Z sensor axes before the 90-degree rotation), and per-handle Core Haptics rumble (GCHapticsLocalityLeftHandlefor Player 1 andGCHapticsLocalityRightHandlefor Player 2).Settings -> Controls -> Controllers -> Open...) and localize the label (Split Joy-Con into two controllers/将 Joy-Con 拆分为两个手柄) across all 6 languages (zh,en,de,fr,it,sv).Screenshots
Verification
dm/host/tests/t_pad_hid: 52 checks passed (including Left/Right Joy-Con0x30button/stick and 6-axis sideways IMU rotation tests).dm/host/tests/t_haptics_apple: passed (including splitGCHapticsLocalityLeftHandleandGCHapticsLocalityRightHandlerouting across Player 1 and Player 2).python3 dm/ios/tests/compile_check.py: 265 files, 0 failed.python3 tools/engine.py check: 42 patches apply cleanly.swift test --filter "ConsoleLiveTests|ConsolePadTests|LocalizationTests": 57 tests passed.