devkitPro / 3ds-hbmenu

The 3DS Homebrew Menu (∩ ͡° ͜ʖ ͡°)⊃━☆゚
715 stars 75 forks source link

Increase New 3DS C-stick dead zone #94

Open vaguerant opened 7 months ago

vaguerant commented 7 months ago

Feature Request

What feature are you suggesting?

Overview:

Nature of Request:

Why would this feature be useful?

Reduces unintended input without heavily impacting intended input.

Pull request

I'm of course happy to PR this change if desired, but I figured it was worth opening a discussion before unilaterally deciding 10 is the "correct" dead zone value.

vaguerant commented 7 months ago

I've actually just noticed I can generate spurious C-stick inputs by manipulating the hinge. I'm guessing the movement of the magnet located on the top-half's right side, which triggers the sleep mode, is interfering with the C-stick. Great design on Nintendo's part.

Even with the dead zone at 10, I'm still able to do this. I can consistently cause this issue by booting the console with the hinge in one position, shifting the hinge position, then loading 3ds-hbmenu. Perhaps in addition to adjusting the dead zone, 3ds-hbmenu should also recalibrate where the zero position is on boot?

EDIT: For a pure dead zone approach, I can still cause this issue with a dead zone of 20, but am no longer able to trigger it accidentally with a dead zone of 25. What I'm calling "accidentally" is unforced hinge-movement, i.e. the wiggle room available within a locked position. Even when the hinge is locked, if you e.g. hold the 3DS above your head, gravity will cause some slight hinge movement without taking you out of the locked position. A dead zone of 25 seems to be sufficient to prevent interference.

I can still "force" the issue by manually adjusting the hinge beyond what gravity alone can do, but notably the issue stops again when I reach the next hinge "snap" position. Perhaps there's some software/hardware trickery going on where the console knows to correct the C-stick inputs relative to the magnetic interference from the three "locked" positions, but no specific handling for when you're in-between locked positions?

i.e. I don't think the 3DS is strictly aware of the hinge position in an electronic sense, but it may be able to tell "C-stick inputs are being skewed by an amount roughly equivalent to the known interference from the hinge being in this position, so correct them by that amount."

I'm sorry that this issue got a lot more complicated than it originally seemed.

EDIT2: Video of the behavior:

https://github.com/devkitPro/3ds-hbmenu/assets/5259025/67333479-b54c-45ce-824c-739d890074ef