Repository navigation
Conversation
subyoung
force-pushed
the
ios-joycon-sideways
branch
from
October 29, 2026 22:40
0bc0631 to
574950f
Compare
With each controller a player of its own on iOS (fdea829), a pair of Joy-Con still could not be held sideways as two players, as on a Switch: iPadOS hands the pair over as one combined controller ("Joy-Con (L/R)") and does not offer the halves separately. There was also no way to see or change which controller is which player before the game starts. Held sideways, the pair now becomes two players: the left half on the controller's own player, the right half on the next free one (a second slot in pad_slots.h, freed with the controller). Each half's stick is turned a quarter and its four buttons are read by their new positions. GameController names a Joy-Con's face buttons by their printed labels (pad_apple.h, PR seedds#650) and does not turn them with the pair: a button log on the iPad gave buttonY, buttonX, buttonA and buttonB for the right half's top, right, bottom and left. So its X, A, Y and B are its right, bottom, top and left buttons. SL and SR are not in the combined profile, so each half's own shoulder buttons stand in: L or R is L, ZL or ZR is R. The pair's gyro goes to the left half's player. The launcher's new Players section (LauncherControllers.swift) lists the players as the game will get them. It lets the player hold each pair upright or sideways (players.joyconSideways.<pair>) and change the order (players.order); DmGamepad.m takes the controllers in that order. After a run it greys out the controllers past what the game takes: hle_hid.c's new dm_pad_players_accepted counts that from SetSupportedNpadIdType, and the app keeps it as players.max. DM_JOYCON_SIDEWAYS=0|1 in the environment overrides the hold. A pair held upright maps its face buttons through dm_pad_face (pad_apple.h), as any other Nintendo pad. Checked: make -C dm/host/tests run (t_hid gains t_accepted, 123 checks), dm/tools/tests test_docs and test_env_switches, DmGamepad.m with -Wall -Wextra -Werror and the launcher's Swift files for iOS. On an iPad Air 13-inch (M3), iPadOS 27.2, with Super Mario Bros. Wonder 1.2.1: one Joy-Con pair held sideways as players 1 and 2.
subyoung
force-pushed
the
ios-joycon-sideways
branch
from
October 30, 2026 02:13
574950f to
20747de
Compare
2 of 3 tasks
3 tasks done
3 tasks done
seedds
added a commit
that referenced
this pull request
Nov 9, 2026
…sor per Joy-Con, splits when the game asks, and the Switch 2 Joy-Cons choose by a three-second hold (3 of 3, issue #1267) A front end that reads Joy-Cons one by one reports them to the npad layer (dm_input.h: dm_joy_attach, dm_joy_set, dm_motion_set_joy, dm_motion_clear_joy; no controller-specific names, so Switch 1 Joy-Cons and #585 / #878 can feed it later). Nothing changes until one does. hle_hid.c then shows the game what it asks for, from the styles it supports (SetSupportedNpadStyleSet, recorded before and never consulted): docked, a pad holding both Joy-Cons is one JoyDual npad (both Joy-Cons' buttons, rail buttons included, which fill no longer masks away for these styles; each stick on its side; a six-axis handle per Joy-Con); on single assignment (SetNpadJoyAssignmentModeSingle and its forms, SetNpadJoyAssignmentModeDual, GetNpadJoyAssignment) the left Joy-Con stays on the npad, or the one the game named, and the other takes the lowest free supported npad; one Joy-Con alone is JoyLeft or JoyRight. The controller applet splits a pair when the game wants more players than there are controllers. A game that supports no Joy-Con style reads the pad as a full-key controller, as before. Vibration handles exist for the Joy-Con styles (types 5, 6 and 7) and reach the motor of their Joy-Con on whichever npad it is; a full-key handle the game got before the Joy-Cons connected still reaches them (Super Mario Odyssey keeps sending to its full-key handles after asking for the JoyDual ones). Handheld mode: player 1's Joy-Cons count as attached to the console (the Handheld npad) and are never split. The Switch 2 transport (pad_switch2_apple.m) reports each Joy-Con's own buttons, stick and sensor (not while the game has no input: the front end's new blocked callback), keeps a left and a right one that connect together as a pair, and lets the player choose on the controllers, as a Switch's Change Grip/Order screen does, without its screen: SL + SR held three seconds on a Joy-Con of a pair gives it a player of its own; L on a left one alone and R on a right one alone, held together three seconds, pairs them (switch2_proto.h s2_gesture, s2_hold_update). The player lights show the result. DM_PAD_MERGE keeps every pad full-key. Checked on an M1 Pro, macOS 27.2, with a left and a right Joy-Con 2: Super Mario Odyssey 1.3.0 (a JoyDual npad: the two-handed up and spin throws; two-player mode splits the pair through the applet; rumble on both; the split and join holds), Super Mario Bros. Wonder 1.2.1 (choosing two players splits the pair), Super Smash Bros. Ultimate 13.0.5 (the SL + SR hold makes two sideways players; a 1v1 with a Joy-Con each, rail buttons as shoulders, rumble on each). t_hid: 175 checks (t_joycons: inert until a Joy-Con is reported, JoyDual with rail buttons, the unsupported-style fallback, single assignment and the other half's npad, the applet split, vibration handles per style, handheld); t_switch2: 80 checks (the Joy-Con buttons, the gestures and their timing). Not checked: more than two Joy-Cons, the Pro Controller 2. Front-ends: new: dm_joy_attach / dm_joy_set / dm_motion_set_joy / dm_motion_clear_joy (dm_input.h) let a front end report Joy-Cons one by one; until it does, nothing changes Front-ends: interface: dm_switch2_front has a blocked callback (NULL: never blocked) PR #1363 Co-authored-by: JakePre <[email protected]>
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
…sor per Joy-Con, splits when the game asks, and the Switch 2 Joy-Cons choose by a three-second hold (3 of 3, issue seedds#1267) A front end that reads Joy-Cons one by one reports them to the npad layer (dm_input.h: dm_joy_attach, dm_joy_set, dm_motion_set_joy, dm_motion_clear_joy; no controller-specific names, so Switch 1 Joy-Cons and seedds#585 / seedds#878 can feed it later). Nothing changes until one does. hle_hid.c then shows the game what it asks for, from the styles it supports (SetSupportedNpadStyleSet, recorded before and never consulted): docked, a pad holding both Joy-Cons is one JoyDual npad (both Joy-Cons' buttons, rail buttons included, which fill no longer masks away for these styles; each stick on its side; a six-axis handle per Joy-Con); on single assignment (SetNpadJoyAssignmentModeSingle and its forms, SetNpadJoyAssignmentModeDual, GetNpadJoyAssignment) the left Joy-Con stays on the npad, or the one the game named, and the other takes the lowest free supported npad; one Joy-Con alone is JoyLeft or JoyRight. The controller applet splits a pair when the game wants more players than there are controllers. A game that supports no Joy-Con style reads the pad as a full-key controller, as before. Vibration handles exist for the Joy-Con styles (types 5, 6 and 7) and reach the motor of their Joy-Con on whichever npad it is; a full-key handle the game got before the Joy-Cons connected still reaches them (Super Mario Odyssey keeps sending to its full-key handles after asking for the JoyDual ones). Handheld mode: player 1's Joy-Cons count as attached to the console (the Handheld npad) and are never split. The Switch 2 transport (pad_switch2_apple.m) reports each Joy-Con's own buttons, stick and sensor (not while the game has no input: the front end's new blocked callback), keeps a left and a right one that connect together as a pair, and lets the player choose on the controllers, as a Switch's Change Grip/Order screen does, without its screen: SL + SR held three seconds on a Joy-Con of a pair gives it a player of its own; L on a left one alone and R on a right one alone, held together three seconds, pairs them (switch2_proto.h s2_gesture, s2_hold_update). The player lights show the result. DM_PAD_MERGE keeps every pad full-key. Checked on an M1 Pro, macOS 27.2, with a left and a right Joy-Con 2: Super Mario Odyssey 1.3.0 (a JoyDual npad: the two-handed up and spin throws; two-player mode splits the pair through the applet; rumble on both; the split and join holds), Super Mario Bros. Wonder 1.2.1 (choosing two players splits the pair), Super Smash Bros. Ultimate 13.0.5 (the SL + SR hold makes two sideways players; a 1v1 with a Joy-Con each, rail buttons as shoulders, rumble on each). t_hid: 175 checks (t_joycons: inert until a Joy-Con is reported, JoyDual with rail buttons, the unsupported-style fallback, single assignment and the other half's npad, the applet split, vibration handles per style, handheld); t_switch2: 80 checks (the Joy-Con buttons, the gestures and their timing). Not checked: more than two Joy-Cons, the Pro Controller 2. Front-ends: new: dm_joy_attach / dm_joy_set / dm_motion_set_joy / dm_motion_clear_joy (dm_input.h) let a front end report Joy-Cons one by one; until it does, nothing changes Front-ends: interface: dm_switch2_front has a blocked callback (NULL: never blocked) PR seedds#1363 Co-authored-by: JakePre <[email protected]>
Owner
|
Closing as superseded: 36e6e4a on main makes Joy-Cons dual or single npads as the game asks (a pair is a JoyDual npad with a sensor per Joy-Con, and it splits when the game requests it), instead of manual splitting. The button-map observations here remain useful; please open an issue if any button is still wrong on main. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Builds on fdea829 (each controller a player of its own on iOS, #504). That commit still leaves two gaps.
A pair of Joy-Con cannot be held sideways as two players, as on a Switch. iPadOS hands the pair over as one combined controller ("Joy-Con (L/R)") and does not offer the halves separately: Settings shows them, but GameController exposes only the combined one. There is also no way to see or change which controller is which player before the game starts.
DmGamepad.m):pad_slots.h, freed with the controller).pad_apple.h, Map Nintendo controller buttons by label on Mac and iOS #650), and does not turn them with the pair. So the right half's X, A, Y and B are its right, bottom, top and left buttons.buttonY,buttonX,buttonA,buttonB.LauncherControllers.swift, below Reset to tested defaults):players.joyconSideways.<pair>).players.order);DmGamepad.mtakes the controllers in that order.dm_pad_players_acceptedinhle_hid.ccounts that fromSetSupportedNpadIdType, and the app keeps it asplayers.max.DM_JOYCON_SIDEWAYS=0|1in the environment overrides the hold.A pair held upright, and every other controller, maps its face buttons through
dm_pad_face(pad_apple.h, #650); this change does not touch it.This also answers part of the open question in
pad_apple.h("if GameController keeps its labels there instead of turning them with the controller"): for a pair held sideways it keeps them. The button log on the iPad gavebuttonY,buttonX,buttonA,buttonBfor the right half's top, right, bottom and left. A single Joy-Con (iPadOS offers the pair only) is still untried.Checked
make -C dm/host/tests GAME=010015100B514000 run: all pass.t_hidgainst_accepted, 147 checks;t_pad_applepasses.dm/tools/tests/test_docs.pyandtest_env_switches.py: pass.DmGamepad.mbuilt with-Wall -Wextra -Werrorfor iOS, and the launcher's Swift files type-checked for iOS.010015100B514000, v1.2.1), local play, from an IPA built from this branch.Docs
docs/playing.md: a Players paragraph.docs/development.md: the Input row.docs/env_switches.tsv:DM_JOYCON_SIDEWAYS.Screenshots