Skip to content

DM_PAD_LAYOUT=name: a controller's face buttons by their letters, and a docs tip on swapping them (issue #2170) - #2196

Closed
Atomsk-debug wants to merge 1 commit into
seedds:mainfrom
Atomsk-debug:pad-layout
Closed

Atomsk-debug wants to merge 1 commit into
seedds:mainfrom
Atomsk-debug:pad-layout

Conversation

@Atomsk-debug

Copy link
Copy Markdown
Contributor

Issue #2170: with an Xbox pad the game's A sits on the button marked B, because face buttons map by position. This adds the two things the issue proposes.

  • DM_PAD_LAYOUT=name in a game's env.txt maps every controller's face buttons name for name, as a Nintendo pad's already are. The default (by position) is unchanged, and any other value is by position.
  • docs/playing.md gets a Face buttons paragraph: the default, the switch, and that macOS's own controller settings can swap the buttons for every app.

The change is in dm_pad_face (dm/host/pad_apple.h), which the Mac front end and the iOS gamepad share, so the switch works on both. The switch is read once. The Home hold prompt is not changed: it reads GameController's names either way, and the docs say so.

Tested

  • t_pad_apple, extended: by name for Xbox, DualSense and Pro Controller pads, and the switch itself. The Makefile runs it unset and with DM_PAD_LAYOUT=name; I also ran DM_PAD_LAYOUT=position. All pass.
  • dmhost builds (GAME=0100152000022000).
  • python3 dm/tools/env_switches.py --check and dm/tools/tests/test_docs.py pass.

Not tested

  • A physical Xbox pad in a game: I have none connected. The mapping is covered by the fake pads in t_pad_apple only.
  • iOS: not built here.

🤖 Generated with Claude Code

…: the button marked A on an Xbox pad is the game's A, in that game only, and the docs say macOS's own controller settings can swap them too (issue seedds#2170)

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) docs Documentation labels Nov 10, 2026
Ayymeric pushed a commit to Ayymeric/nxnative that referenced this pull request Nov 17, 2026
An Xbox or PlayStation pad maps by position by default, as Switch emulators do: the right button is A. DM_PAD_MAP=label (launcher: Face buttons, By label) maps GameController's buttonA, the bottom button an Xbox pad marks A, to the Switch's A, buttonB to B, X to X and Y to Y, as PC games read an Xbox pad, so the letters the game asks for are the pad's. Nintendo pads map name for name either way; raw HID pads keep DM_HID_MAP. On the Mac and iOS (pad_apple.h). The host also tells a build's stubs (frame step state +0xb0), for prompts that follow the layout.

Other pull requests propose the same mapping under other names (seedds#1481 DM_PAD_LABELS, seedds#2196 DM_PAD_LAYOUT); seedds#386 uses the name DM_PAD_MAP for a remap. The name here can follow whichever is taken.

Front-ends: new: DM_PAD_MAP (Face buttons: position, label), in launcher.json for every game

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@seedds

seedds commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thanks for covering Xbox, DualSense and Pro Controller mappings and for documenting the macOS controller remap. I’m closing this in favor of #3018, which proposes the same four-button mapping as a launcher setting and covers it in the shared pad tests. The default on main is still positional. The macOS remap tip is useful while the setting is under review.

@seedds seedds closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants