Skip to content

hid: report non-zero sensor ranges in the six-axis IC information - #296

Merged
Takoroka merged 1 commit into
Eglantine-Community:nx2-experimentalfrom
rdenno:fix/hid-sixaxis-ic-info
Nov 2, 2026
Merged

Takoroka merged 1 commit into
Eglantine-Community:nx2-experimentalfrom
rdenno:fix/hid-sixaxis-ic-info

Conversation

@rdenno

@rdenno rdenno commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Nintendo Switch Sports aborted with 2162-0001 when starting a match, right after the "Play with a Single Controller" screen. It now gets into the match.

  • Cause: GetSixAxisSensorIcInformation returned a zeroed structure, because nothing ever fills it. The game starts sensor fusion when the match begins, and nn::imu hands these ranges to nerd::gyro_pointing::GyroPointingStateDetector, which checks that the accelerometer and gyroscope ranges are above 0 (m_accelerometer_range > 0 * SI::mps2) and aborts otherwise.
  • Fix: default the IC information to the ranges of the Joy-Con and Pro Controller sensors, 2000 dps and 8 g. The other fields stay 0, as before.

Reproduce: Switch Sports, Tennis > Match > One Player, go through the settings and press A on "Play with a Single Controller".

  • Before: SetTerminateResult 0x2a2 (2162-0001) and a userspace panic; the backtrace goes nn::hid::UpdateSensorFusion > nn::imu::FullSensorState::Initialize > nerd::gyro_pointing::GyroPointing > nerd::OnVerifyFailed.
  • After: the match intro plays and the match starts.

Limitations:

  • The ranges are typical values, not read from the controller. The other IC fields (their meaning isn't documented) are still 0.
  • Only tested with keyboard input, so motion controls during the match weren't checked.

Tested on Windows with an RTX 5060 Ti.

Assisted by: Claude Opus 5.5

GetSixAxisSensorIcInformation returned a zeroed structure, as the
information is never read from a controller. Nintendo Switch Sports
starts sensor fusion when a match begins, and nn::imu passes these
ranges to nerd::gyro_pointing, whose GyroPointingStateDetector checks
that the accelerometer and gyroscope ranges are above 0 and aborts
otherwise (2162-0001, right after "Play with a Single Controller").

Report the ranges of the Joy-Con and Pro Controller sensors, 2000 dps
and 8 g, until the data comes from the controller.

Assisted-by: Claude Opus 5.5 (diagnosis, fix and testing)
@Takoroka
Takoroka merged commit 8c63450 into Eglantine-Community:nx2-experimental Nov 2, 2026
rdenno added a commit to rdenno/Eglantine that referenced this pull request Nov 4, 2026
The game list (Eglantine-Community#245), Switch Sports six-axis (Eglantine-Community#296), Mii BuildRandom (Eglantine-Community#297), Pokopia UISETP accumulate (Eglantine-Community#145) and Yoshi IMNMX changes have their own pull requests or are already in nx2-experimental: their files are as in nx2 here. They stay on this fork's nx2-merged.

Assisted-by: Claude Opus 5.5 (branch preparation)
jojo-chaechae added a commit that referenced this pull request Nov 4, 2026
Bring rdenno's six-axis and Mii fixes (#296, #297) to nx2
adamhahnHU pushed a commit to adamhahnHU/EglantineAMD that referenced this pull request Nov 8, 2026
… fork) (Eglantine-Community#296)

* texture_cache: scan new ASTC data where it is instead of copying it first

The opacity scan copied the whole guest range into astc_scan_buffer and the
upload then read it again. GpuGuestMemory hands out the guest memory directly
when the range is in one piece and falls back to the scratch buffer when it is
split, so the scan no longer copies in the common case.

Assisted-by: Claude Sonnet 5.5 (implementation)
(cherry picked from commit 87da314)

* astc_decoder: compute the weight scale and partition hash once per block

The per-texel weight scale and the partition hash setup only depend on the
block, so they are computed once per block instead of once per texel, and the
colour range search (which had a TODO to try bisection) is a bisection now: the
bit length never decreases with the encoding index. The output is bit-identical
to the previous decoder on millions of random blocks of every footprint, which
was compared on a GPU.

Assisted-by: Claude Sonnet 5.5 (implementation and bit-exact comparison harness)
(cherry picked from commit ab2fd96)

---------

Co-authored-by: SmileyTatsu <[email protected]>
(cherry picked from commit d590d51)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PJNfzVjvfnqqaEjKL3CyAB
rdodoa pushed a commit to rdodoa/Eglantine that referenced this pull request Nov 8, 2026
… fork) (Eglantine-Community#296)

* texture_cache: scan new ASTC data where it is instead of copying it first

The opacity scan copied the whole guest range into astc_scan_buffer and the
upload then read it again. GpuGuestMemory hands out the guest memory directly
when the range is in one piece and falls back to the scratch buffer when it is
split, so the scan no longer copies in the common case.

Assisted-by: Claude Sonnet 5.5 (implementation)
(cherry picked from commit 87da314)

* astc_decoder: compute the weight scale and partition hash once per block

The per-texel weight scale and the partition hash setup only depend on the
block, so they are computed once per block instead of once per texel, and the
colour range search (which had a TODO to try bisection) is a bisection now: the
bit length never decreases with the encoding index. The output is bit-identical
to the previous decoder on millions of random blocks of every footprint, which
was compared on a GPU.

Assisted-by: Claude Sonnet 5.5 (implementation and bit-exact comparison harness)
(cherry picked from commit ab2fd96)

---------

Co-authored-by: SmileyTatsu <[email protected]>
kyabetsu4 pushed a commit to kyabetsu4/Eglantine that referenced this pull request Nov 10, 2026
… fork) (Eglantine-Community#296)

* texture_cache: scan new ASTC data where it is instead of copying it first

The opacity scan copied the whole guest range into astc_scan_buffer and the
upload then read it again. GpuGuestMemory hands out the guest memory directly
when the range is in one piece and falls back to the scratch buffer when it is
split, so the scan no longer copies in the common case.

Assisted-by: Claude Sonnet 5.5 (implementation)
(cherry picked from commit 87da314)

* astc_decoder: compute the weight scale and partition hash once per block

The per-texel weight scale and the partition hash setup only depend on the
block, so they are computed once per block instead of once per texel, and the
colour range search (which had a TODO to try bisection) is a bisection now: the
bit length never decreases with the encoding index. The output is bit-identical
to the previous decoder on millions of random blocks of every footprint, which
was compared on a GPU.

Assisted-by: Claude Sonnet 5.5 (implementation and bit-exact comparison harness)
(cherry picked from commit ab2fd96)

---------

Co-authored-by: SmileyTatsu <[email protected]>
(cherry picked from commit d590d51)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants