Skip to content

nn::hid::EnableUnintendedHomeButtonInputProtection is answered by the host and logged: Drag x Drive no longer crashes at sdk+0x63ce10 as player 1's Joy-Con 2 joins - #1921

Closed
FifteenPen wants to merge 2 commits into
seedds:mainfrom
FifteenPen:pr/home-protection

Conversation

@FifteenPen

Copy link
Copy Markdown
Contributor

What and why

Drag x Drive (040041601D83A000, v196608, SDK 20) crashes about 43 s in, as player 1's Joy-Con 2 pair joins:

[RED] sf: the game connects to service hid itself, which the host does not serve
CRASH sig=11 addr=0 pc=sdk+0x63ce10 lr=sdk+0x63ce10

The game calls nn::hid::EnableUnintendedHomeButtonInputProtection(const NpadIdType&, bool) for the controller (main+0x2c80c4): a Switch 2 SDK guard against a Home press made by accident on it. The SDK's own implementation sets the flag through the hid service, which the host does not serve, and calls through the null session at sdk+0x63ce10. The function returns nothing.

The change answers it in hle_hid.c (HLE_FORCE) and logs the npad and the setting (hid: EnableUnintendedHomeButtonInputProtection npad 0 on). The host handles the Home button itself (home_quit.h), so nothing else changes. Only a game that imports the function binds it.

Docs: a reference entry, Home button protection on a Switch 2 controller, and its line in the symptom index. Drag x Drive's profile and note are a pull request of their own, to follow.

Checked

  • Tests, on this branch (main e82888e + this change), Apple silicon:
    • make -C dm/host/tests GAME=010015100B514000 run: passes.
    • python3 -m unittest dm/tools/tests/test_docs.py dm/tools/tests/test_env_switches.py, python3 dm/tools/docs_symptoms.py.
    • dm/tools/lint_c.py tidy (LLVM 23.1.4) on dm/host/hle_hid.c: 0 file/check pairs above the baseline.
  • Games run: Drag x Drive (040041601D83A000, v196608), a Mac app from a provisional profile (the NSP script's survey), with a left and a right Joy-Con 2 over Bluetooth LE. That tree was main db206a4 with the Joy-Con 2 work since landed on main (36e6e4a, 413e880, a342d64, 8c436e3), host/input: keyboard, mouse and trackpad on the iPad, Mac mouse camera #1490 and NVN: account for four-byte direct indexed draws using control memory #1609:
    • without this change: the crash above, 43 s in, as the Joy-Cons joined;
    • with it: the game logged the protection on and off as the Joy-Cons joined and played for 27 minutes at its own 30 fps (frame time p50 33.33 ms, GPU p50 6–11 ms), no red line.
  • Devices and OS: Apple M4 Pro (20-core GPU, 24 GB), macOS 27.2.
  • regress.py impact: no game with a usage manifest reaches the change (Breath of the Wild, Pokémon Scarlet, Tears of the Kingdom and Hades: not affected); it binds only where a game imports the function, so regress.py check was not run.
  • Not checked: iOS; other Switch 2 games that call it.

Docs

  • The finding is in its game note or its docs/reference/<subsystem>.md entry, and python3 dm/tools/docs_symptoms.py was run (the symptom index)
  • A chain tool changed: not applicable (host only)
  • No game files, keys or data extracted from a game in the change or the attachments

… host and logged: Drag x Drive no longer crashes at sdk+0x63ce10 as player 1's Joy-Con 2 joins

The SDK's own sets a flag through the hid service, which the host does not serve, and called through the null session. The guard keeps a Home press made by accident on that controller from leaving the game; the host handles Home itself (home_quit.h). Docs: services.md, Home button protection on a Switch 2 controller.
…e game set per npad, off by default: Nintendo Switch Sports Resort asks it at boot
@FifteenPen

Copy link
Copy Markdown
Contributor Author

Added a second commit: IsUnintendedHomeButtonInputProtectionEnabled answers what the game set per npad (No 1-8, Other, Handheld), off by default, and EnableUnintendedHomeButtonInputProtection now records the setting as well as logging it. Nintendo Switch Sports Resort (04008E001F098000, v65536) asks the question at boot, and the SDK's own aborted on the service error (Result 0x58cca at sdk+0x6ca40c). t_hid has 4 new checks (209, all pass); the reference entry says so.

seedds added a commit that referenced this pull request Nov 10, 2026
…e no longer crashes at sdk+0x63ce10 as player 1's Joy-Con 2 joins, and Nintendo Switch Sports Resort no longer aborts at boot (PR #1921)

EnableUnintendedHomeButtonInputProtection records the setting per npad (in id_bit's bits) and logs it; IsUnintendedHomeButtonInputProtectionEnabled answers what the game set, off by default. The SDK's own implementations go through the hid service, which the host does not serve: the setter called through the null session, the question aborted on Result 0x58cca (sdk+0x6ca40c). The host handles Home itself (home_quit.h), so the setting changes nothing else. Docs: services.md, Home button protection on a Switch 2 controller; t_hid checks the setting per npad.

Co-authored-by: FifteenPen <354289956+FifteenPen@users.noreply.github.com>
@seedds

seedds commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Landed on main as 30c9b16 (with you as co-author), thank you. One change: the setting is stored in id_bit's bits (hle_hid.c already had that npad-to-bit helper; Handheld and Other were the other way round in home_protect_bit), in a uint32_t, and the comment says it is recorded as well as logged. t_hid passes (209 checks), docs tests and lint_c.py tidy are clean. Drag x Drive's and Switch Sports Resort's profiles are welcome as their own PRs.

@seedds seedds closed this Nov 10, 2026
@FifteenPen

Copy link
Copy Markdown
Contributor Author

Landed on main as 30c9b16 (with you as co-author), thank you. One change: the setting is stored in id_bit's bits (hle_hid.c already had that npad-to-bit helper; Handheld and Other were the other way round in home_protect_bit), in a uint32_t, and the comment says it is recorded as well as logged. t_hid passes (209 checks), docs tests and lint_c.py tidy are clean. Drag x Drive's and Switch Sports Resort's profiles are welcome as their own PRs.

Thank you - I submitted both!

FifteenPen added a commit to FifteenPen/nxnative that referenced this pull request Nov 10, 2026
… it), seedds#1921 on main as 30c9b16, seedds#1561 explained (aborts after the safety screen without it), its six refused shaders built by seedds#2264
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