Skip to content

Apply saved player assignments without the Mac launch window - #1268

Draft
Gonzalo-Bruna wants to merge 2 commits into
seedds:mainfrom
Gonzalo-Bruna:mac-saved-player-routing
Draft

Gonzalo-Bruna wants to merge 2 commits into
seedds:mainfrom
Gonzalo-Bruna:mac-saved-player-routing

Conversation

@Gonzalo-Bruna

@Gonzalo-Bruna Gonzalo-Bruna commented Nov 5, 2026 •

Copy link
Copy Markdown

What and why

When a game starts without the nxnative window, controller discovery order decides which player gets each controller. I am building a separate launcher where players can choose that order across games; right now, they may need to disconnect and reconnect controllers to get the desired order in each game.

This adds a way for a front end to pass its choices to the same player assignment logic introduced in #1127. With DM_PLAYER_SETUP=1 and no confirmed window setup, the host reads the app's saved assignments and uses them for that session.

An unsandboxed front end can:

  1. Check that the app's Info.plist contains DMPlayerPrefs=players.controllers.v1.
  2. Write the typed players.controllers.v1 layouts and launcher.DM_PLAYER_SETUP="1" to the app's preferences domain.
  3. Start the game with --no-launcher. The full format, keyboard settings and limitations are documented in docs/frontends.md.

Configured slots remain reserved across disconnects, and a uniquely matched controller can return to its slot. A controller without a saved profile takes an unused session slot; existing players are not renumbered. Ambiguous saved profiles stay unassigned. Missing or malformed layouts fall back to automatic routing, while a valid empty array starts a session with no configured models. This mode does not write preferences back.

The native window's behavior stays the same. For example, when Finder opens the window, controllers that have not been assigned there remain off. The packer advertises DMPlayerPrefs only when the packaged host supports this handoff.

Dependency: this PR is based on #1127 at 2e7df03 and targets main. The implementation is ready for review; I am keeping this PR in draft until #1127 is integrated. Until then, both its commit and this contribution will appear here; please review our commit. Refs #878.

Checked

  • Native player and host-input tests passed, including runs with AddressSanitizer and UndefinedBehaviorSanitizer.
  • 105 Python tests passed for Mac app packaging, launcher settings and documentation; Python lint reported no new findings over the feat(mac): add persistent launch-window player setup #1127 base locally. The documentation tests were rerun after the final reference update. GitHub's lint currently reports the same two findings in unchanged files as the main branch run: dm/games/settings.py and dm/tools/tests/test_split_linkdata.py.
  • On an Apple M5 with macOS 27.2, Super Mario Party Jamboree (0100965017338000, game version and duration not recorded in the test report) was tested with an 8BitDo Ultimate 2, an Xbox One controller and a keyboard. The checks covered player order, reconnects, automatic mode, an unlisted controller, a separate keyboard player and the native window.

Not checked

Front ends

Front-ends: new: DMPlayerPrefs identifies Mac apps that accept saved player assignments without a confirmed window.

Docs

Updated the front-end handoff, settings, environment switches and service reference; regenerated the symptom index.

  • The finding is in its subsystem reference and python3 dm/tools/docs_symptoms.py was run.
  • No game files, keys or data extracted from a game in the change or attachments.

seedds and others added 2 commits November 4, 2026 16:25
Embed player assignment in the existing launcher, retain controllers through gameplay, persist confirmed routes and support standalone Joy-Cons. Include the host validation and packaging corrections verified by the CI regression tests.

Front-ends: player setup is opt-in through DM_PLAYER_SETUP with the paired same-process host library; native entry points and saved-choice behavior are documented in docs/frontends.md.
A front end that bypasses the launch window cannot apply the player
assignments saved by that window, so controller discovery order decides
the players instead.

Use the existing player setup to restore valid per-app assignments for
the session when setup is enabled and no window setup was confirmed.
Reserve session slots across disconnects and advertise the capability
only when the packaged host supports it.

Checked with native player and input tests, including sanitizer runs,
Python packaging and documentation tests, and Mario Party Jamboree
with an 8BitDo, Xbox controller and keyboard.

Front-ends: new: DMPlayerPrefs identifies Mac apps that accept saved player assignments without a confirmed window.
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) vulkan Vulkan on Metal (dm/gfx/vk) opengl NVIDIA's desktop OpenGL on Metal (dm/gfx/gl) packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m) tools Tools and scripts (dm/tools, scripts) docs Documentation game: 0100152000022000 Mario Kart 8 Deluxe labels Nov 5, 2026
@Gonzalo-Bruna Gonzalo-Bruna changed the title Apply saved player assignments when starting without the Mac window Apply saved player assignments without the Mac launch window Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0100152000022000 Mario Kart 8 Deluxe host The Horizon host: SVCs, services, threads, memory (dm/host) ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m) nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) opengl NVIDIA's desktop OpenGL on Metal (dm/gfx/gl) packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers tools Tools and scripts (dm/tools, scripts) vulkan Vulkan on Metal (dm/gfx/vk)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants