mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
Add the HD vibration row to the Controls tab and describe HD rumble in the controls guide.
The row switches rumble_hd and is greyed out, with a note of what it needs, while the gamepad in use is not a Switch Pro Controller or Joy-Con. Its texts are in all four menu languages. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -136,6 +136,19 @@ The stick direction bits (`StickLLeft` to `StickRDown`) are derived from the sti
|
||||
|
||||
Keys tilt a stick all the way, so on the keyboard alone Link always runs. `NX2NAVI_WALK_KEY` (`walk_key`, the *Walk key* row under *Analog sticks* on the Controls tab) names a key that, while held, scales the stick values the keys give (movement and camera keys) to `NX2NAVI_WALK_SCALE` of full (`walk_scale`, the *Walk scale* row; 0.2 to 0.9, default 0.51), so Link walks. The value is a key name of the `bind_` lines, or `none` (the default: off). The row offers Shift, Alt, Ctrl, Tab and Caps Lock and names the button a chosen key also presses: with the default bindings Shift is A, Ctrl is B and Tab is Plus, while Alt and Caps Lock are free. The gamepad's sticks and the mouse camera are not scaled. The default is just above half because half of a key's full value falls one short of the 50% the direction bits need. Both settings apply at once while the game runs.
|
||||
|
||||
## HD rumble on Switch controllers
|
||||
|
||||
The game makes its vibration for linear actuators: per side a low and a high band, each with a frequency and an amplitude. On most gamepads that is reduced to two motor strengths. With `rumble_hd = 1` in `nx2navi.ini` (`NX2NAVI_RUMBLE_HD`, the *HD vibration (Switch)* row on the Controls tab, live, off by default) a Switch controller gets the values as the game makes them, in the controller's own rumble report (`runtime/rumble_hd.c`, `runtime/input.c` "HD rumble"):
|
||||
|
||||
| Gamepad the game reads | Reports go | Connection |
|
||||
|---|---|---|
|
||||
| Switch Pro Controller (`057e:2009`) | through SDL (`SDL_SendGamepadEffect`) | USB and Bluetooth |
|
||||
| One Joy-Con | through SDL; the stronger side's value, as it has one actuator | Bluetooth, or the USB charging grip |
|
||||
| A left and a right Joy-Con as one gamepad | to the two Joy-Con's HID devices directly (`runtime/input_hd_pair.c`), as SDL takes no rumble data for the combined gamepad | Bluetooth |
|
||||
| Anything else, the Switch 2 controllers included | the motors, as with `rumble_hd = 0` | |
|
||||
|
||||
The log says which it is when a gamepad is taken: `input: HD rumble available for this gamepad: a Pro Controller, through SDL (rumble_hd = 1)`, or `not available` with the reason; the row on the Controls tab is greyed out for a gamepad that cannot take it. With `rumble_hd = 0` nothing is written to the controller and the line says that its driver is asked once the setting is on. The first report a gamepad gets is logged with its bytes (`input: HD rumble: first report written (left ..., right ...)`); a report the controller or its driver refuses is logged too, and the gamepad then rumbles through its motors again. Frequencies are clamped to what the actuators take (41 to 626 Hz in the low band, 82 to 1253 Hz in the high band) and amplitudes to 0..1, the actuators' safe maximum. `rumble_strength` scales the amplitude (100 is the game's own; the default 130 is louder), `rumble_curve` does not apply, and `rumble = 0` silences this path too. A report is written at most every 15 ms (`rumble_hd_ms`, 5 to 50: raise it if a Bluetooth controller stutters or disconnects with HD rumble on), with the newest value only; a value that holds is written again every 30 ms, and the neutral value goes out when the game stops sending for 250 ms, when another gamepad takes over, when the setting is turned off and when the game exits. While HD rumble is on the game makes no dual-motor rumble call for that gamepad. A DualShock 3 on the direct reader keeps its motors either way.
|
||||
|
||||
## Nintendo Switch 2 controllers
|
||||
|
||||
Windows does not present the Switch 2 Pro Controller as a gamepad SDL can open (the log says `input: no gamepad`), so it needs a bridge program that wakes it and creates a virtual gamepad, for example one that emulates a DualSense: that gives buttons, rumble, gyro and accelerometer. The log then shows `input: gamepad "DualSense Wireless Controller" ... (rumble, gyro and accelerometer, ...)` and `input: motion sensors on`. Bridges that output a DualShock 4 whose gyro and accelerometer never change give buttons and rumble but no motion. Run one bridge at a time; Steam Input can also claim the controller, so close Steam if the bridge does not find it. With several virtual and real gamepads connected the game follows whichever one is pressed.
|
||||
|
||||
@@ -1612,6 +1612,10 @@ static void tab_controls(float scale) {
|
||||
opt_slider("NX2NAVI_RUMBLE_STRENGTH", UI_MENU_RUMBLE_STRENGTH, 0, 300, UI_MENU_RUMBLE_STRENGTH_DESC, 10, "%.0f %%");
|
||||
opt_slider("NX2NAVI_RUMBLE_CURVE", UI_MENU_RUMBLE_CURVE, 0.2f, 1.5f, UI_MENU_RUMBLE_CURVE_DESC, 0.05f, "%.2f");
|
||||
opt_toggle("NX2NAVI_RUMBLE_TRIGGERS", UI_MENU_RUMBLE_TRIGGERS, UI_MENU_RUMBLE_TRIGGERS_DESC);
|
||||
// HD rumble can be switched only while the gamepad in use is one whose actuators take the game's values (a Switch
|
||||
// Pro Controller or Joy-Con, input.c hd_probe); with any other the row is greyed out and says what it needs.
|
||||
if (!input_rumble_hd_available()) opt_disable_next(UI_MENU_RUMBLE_HD_NEEDS);
|
||||
opt_toggle("NX2NAVI_RUMBLE_HD", UI_MENU_RUMBLE_HD, UI_MENU_RUMBLE_HD_DESC);
|
||||
opt_group(UI_MENU_GROUP_STICKS);
|
||||
double now[2];
|
||||
bool pad = input_pad_stick_percent(now) != 0;
|
||||
|
||||
@@ -322,6 +322,10 @@ static const char *const text_en[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_RUMBLE_CURVE_DESC] = "Lower values make light vibration stronger.",
|
||||
[UI_MENU_RUMBLE_TRIGGERS] = "Trigger vibration (Xbox)",
|
||||
[UI_MENU_RUMBLE_TRIGGERS_DESC] = "Also vibrates the triggers on Xbox controllers.",
|
||||
[UI_MENU_RUMBLE_HD] = "HD vibration (Switch)",
|
||||
[UI_MENU_RUMBLE_HD_DESC] = "Sends the game's detailed vibration to a Switch Pro Controller or Joy-Con as it is. "
|
||||
"The vibration strength still applies: 100 % is the game's own.",
|
||||
[UI_MENU_RUMBLE_HD_NEEDS] = "Needs a Switch Pro Controller or Joy-Con",
|
||||
[UI_MENU_PAD_LAYOUT] = "Button layout",
|
||||
[UI_MENU_PAD_LAYOUT_DESC] = "Sets which button acts as A. Nintendo: by position, A right, B bottom, X top, Y "
|
||||
"left. Xbox and PlayStation: by label, A bottom, B right, X left, Y top (on a "
|
||||
@@ -1021,6 +1025,10 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_RUMBLE_CURVE_DESC] = "Чем ниже, тем сильнее слабая вибрация.",
|
||||
[UI_MENU_RUMBLE_TRIGGERS] = "Вибрация триггеров (Xbox)",
|
||||
[UI_MENU_RUMBLE_TRIGGERS_DESC] = "Вибрация также на курках контроллера Xbox.",
|
||||
[UI_MENU_RUMBLE_HD] = "HD-вибрация (Switch)",
|
||||
[UI_MENU_RUMBLE_HD_DESC] = "Передаёт детальную вибрацию игры на Switch Pro Controller или Joy-Con без изменений. "
|
||||
"Сила вибрации по-прежнему действует: 100 % — как в игре.",
|
||||
[UI_MENU_RUMBLE_HD_NEEDS] = "Нужен Switch Pro Controller или Joy-Con",
|
||||
[UI_MENU_PAD_LAYOUT] = "Раскладка кнопок",
|
||||
[UI_MENU_PAD_LAYOUT_DESC] = "Какая кнопка работает как A. Nintendo: по положению, A справа, B снизу, X сверху, "
|
||||
"Y слева. Xbox и PlayStation: по подписи, A снизу, B справа, X слева, Y сверху (на "
|
||||
@@ -1597,6 +1605,10 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_RUMBLE_CURVE_DESC] = "Valores menores reforçam a vibração fraca.",
|
||||
[UI_MENU_RUMBLE_TRIGGERS] = "Vibração dos gatilhos (Xbox)",
|
||||
[UI_MENU_RUMBLE_TRIGGERS_DESC] = "Também vibra os gatilhos do controle Xbox.",
|
||||
[UI_MENU_RUMBLE_HD] = "Vibração HD (Switch)",
|
||||
[UI_MENU_RUMBLE_HD_DESC] = "Envia a vibração detalhada do jogo a um Pro Controller do Switch ou Joy-Con como ela "
|
||||
"é. A intensidade da vibração continua valendo: 100 % é a do jogo.",
|
||||
[UI_MENU_RUMBLE_HD_NEEDS] = "Requer um Pro Controller do Switch ou Joy-Con",
|
||||
[UI_MENU_PAD_LAYOUT] = "Layout dos botões",
|
||||
[UI_MENU_PAD_LAYOUT_DESC] = "Define qual botão funciona como A. Nintendo: pela posição, A à direita, B embaixo, "
|
||||
"X em cima, Y à esquerda. Xbox e PlayStation: pela letra, A embaixo, B à direita, X à "
|
||||
@@ -2324,6 +2336,9 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_RUMBLE_CURVE_DESC] = "数值越低,轻微震动越强。",
|
||||
[UI_MENU_RUMBLE_TRIGGERS] = "扳机振动(Xbox)",
|
||||
[UI_MENU_RUMBLE_TRIGGERS_DESC] = "同时震动 Xbox 手柄的扳机。",
|
||||
[UI_MENU_RUMBLE_HD] = "HD 振动(Switch)",
|
||||
[UI_MENU_RUMBLE_HD_DESC] = "将游戏的细腻振动原样发送到 Switch Pro 手柄或 Joy-Con。振动强度仍然有效:100% 即游戏原本的强度。",
|
||||
[UI_MENU_RUMBLE_HD_NEEDS] = "需要 Switch Pro 手柄或 Joy-Con",
|
||||
[UI_MENU_PAD_LAYOUT] = "按键布局",
|
||||
[UI_MENU_PAD_LAYOUT_DESC] = "设置哪个按键作为 A 键。Nintendo:按位置,A 在右、B 在下、X 在上、Y 在左。Xbox 和 PlayStation:"
|
||||
"按标注,A 在下、B 在右、X 在左、Y 在上(PlayStation 手柄上为叉、圆圈、方块和三角)。自动:"
|
||||
|
||||
@@ -103,6 +103,8 @@ typedef enum {
|
||||
UI_MENU_RUMBLE_STRENGTH, UI_MENU_RUMBLE_STRENGTH_DESC,
|
||||
UI_MENU_RUMBLE_CURVE, UI_MENU_RUMBLE_CURVE_DESC,
|
||||
UI_MENU_RUMBLE_TRIGGERS, UI_MENU_RUMBLE_TRIGGERS_DESC,
|
||||
// HD rumble, and the note on its row while the gamepad in use cannot take it (input.h input_rumble_hd_available)
|
||||
UI_MENU_RUMBLE_HD, UI_MENU_RUMBLE_HD_DESC, UI_MENU_RUMBLE_HD_NEEDS,
|
||||
UI_MENU_PAD_LAYOUT, UI_MENU_PAD_LAYOUT_DESC, UI_MENU_PAD_LAYOUT_AUTO, UI_MENU_PAD_LAYOUT_NINTENDO,
|
||||
UI_MENU_PAD_LAYOUT_XBOX, UI_MENU_PAD_LAYOUT_PLAYSTATION, UI_MENU_PAD_LAYOUT_IN_USE,
|
||||
UI_MENU_PROMPTS, UI_MENU_PROMPTS_DESC, UI_MENU_PROMPTS_NINTENDO, UI_MENU_PROMPTS_XBOX, UI_MENU_PROMPTS_PLAYSTATION,
|
||||
|
||||
Reference in New Issue
Block a user