Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e70b21d
Key bindings: moving a menu button no longer drags its game actions a…
Fayberr Nov 9, 2026
3b774b3
Key bindings: actions only, no more raw-button swapping; menu rows no…
Fayberr Nov 9, 2026
04aa642
Bug-fix PRs of 2026-11-12: water, vibration, folder picker, pipeline …
Revivedx Nov 12, 2026
73ef7c2
Vulkan: less CPU per draw (PRs #762, #763)
Revivedx Nov 13, 2026
d980132
Fixes of 2026-11-13: intro walk at high frame rates (#364), particles…
Revivedx Nov 13, 2026
086bc68
Controls and 1366x768 (PRs #642, #802)
Revivedx Nov 13, 2026
e0842cd
FSR 3 / TAA rework, shadows follow the upscaler, frame generation pacing
Revivedx Nov 13, 2026
ceef1ef
AMD FSR 3 and FSR 4 upscaling offered again
Revivedx Nov 13, 2026
da6a9cb
Ultrawide start and loading screens (#805)
Revivedx Nov 14, 2026
b81a3b1
Merge upstream/test into feature/actions-only
Fayberr Nov 14, 2026
a348e53
Pause menu on ultrawide: cut at the 16:9 screen's sides (#805)
Revivedx Nov 14, 2026
fbbdb17
Vulkan: stop the particle fix from copying a whole region after a fas…
Revivedx Nov 15, 2026
7bc8008
CI: triage the crash reports RecompLauncher opens by itself
Revivedx Nov 15, 2026
62c9333
Issues: reports missing the log close after 24 hours, not 7 days
Revivedx Nov 15, 2026
4c908ab
Pipelines: a bigger seed from a tour of every region and graphics set…
Revivedx Nov 15, 2026
88486ce
Pipelines: problem reports carry the pipeline list, a tool adds it to…
Revivedx Nov 15, 2026
6124019
Vulkan: log what linking a pipeline on the render thread costs (#818)
Revivedx Nov 15, 2026
ce5f1c9
Alpha 6 PRs: fixes, performance and features from the community
Revivedx Nov 15, 2026
9b0b5e8
Upscaler mode Native from #820 instead of #852's Native and Dynamic
Revivedx Nov 15, 2026
db65f14
Merge upstream/test into feature/actions-only
Fayberr Nov 15, 2026
68dbdc5
Merge upstream/test into feature/actions-only
Fayberr Nov 16, 2026
70a2307
Merge upstream/test into feature/actions-only
Fayberr Nov 18, 2026
75b6e83
Merge remote-tracking branch 'upstream/test' into feature/actions-only
Fayberr Nov 19, 2026
ebc9aa8
Merge upstream/test into feature/actions-only
Fayberr Nov 22, 2026
1626f16
Merge upstream/test into feature/actions-only
Fayberr Nov 26, 2026
93ee57d
Merge upstream/test into feature/actions-only
Fayberr Nov 28, 2026
242ce14
Merge upstream/test into feature/actions-only
Fayberr Nov 29, 2026
3085b48
Merge upstream/test into feature/actions-only
Fayberr Dec 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions docs/ACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ seven gyro slots accept both devices; their new controller sides default to unbo
left stick to 40%. Tilt holds the mouse clutch and enables the existing sensorless controller stick tilt path. Gyro
buttons and keys combine per direction, only while `gyro_keys_live()`; simultaneous opposite directions cancel.
Walk, Tilt, gyro and game action bindings allow shared inputs on both devices. Assigning one never changes another
slot, including raw Switch menu buttons; rebinding a raw slot also leaves these shared bindings intact. Legacy
host slots still swap among themselves on the same device, including the raw Switch buttons (0 to 15). An action on
the page whose Switch input is not a face button (L, R, ZL, ZR, a stick press, the D-pad) answers from its own bindings
once that raw input differs from its defaults: in play the game reads those raw inputs for factory-default actions, so
without this Call horse moved with Magnesis: pull closer and Aim rune with Menu: previous tab. The face buttons need
none of it (in play `act_gameplay_buttons` builds them from the actions); hidden actions, with no row of their own,
go on following the raw input.
slot, including raw Switch menu buttons; rebinding a raw slot also leaves these shared bindings intact. Raw Switch
slots (0 to 15) no longer swap either: a host input already on another slot is simply shared (result kind 2 is unused).

In play, the raw A / B / X / Y / L / R / ZL / ZR / stick-press bits the game reads are built only from actions still at
their factory binding (`act_play_keys` / `act_play_pads`), never from the "Menu: ..." rows. So a key given to
"Menu: sort / sensor" cannot press Attack, rebinding Jump leaves Space on the raw X bit for the other X actions, and the
new key does not set it. D-pad, Plus and Minus stay on their rows (quick menu, pause, map). The menus and the title keep
using the rows. This only switches on once the game has asked about an action (`act_play_active()`); before that, and on
game versions without the hook, the rows drive every button as before.
An action on the page whose Switch input is not a face button (L, R, ZL, ZR, a stick press, the D-pad) also answers from
its own bindings once that raw input differs from its defaults, so Call horse does not move with Magnesis: pull closer,
nor Aim rune with Menu: previous tab; hidden actions, with no row of their own, go on following the raw input. Shops
and dialogues use the menu rows like the other menus.

The game's title, pause and map menus still use the raw Switch layer, including legacy raw-button rebinds. The runtime
overlay and launcher keep their fixed navigation shortcuts. The separate UI update can use `bind_input_name`,
Expand Down Expand Up @@ -180,7 +186,7 @@ synthetic rows (needs no game files).

`make test-actions` (no game files): the answers to the hold / pressed queries, menus falling back, two actions on one
key, factory-default fallthrough, customization on either device, legacy migration in either order, one-time schema
migration and reload idempotence, shared action/Walk/Tilt/gyro captures on both devices, preserved raw Switch swaps,
migration and reload idempotence, shared action/Walk/Tilt/gyro captures on both devices, raw Switch slots sharing instead of swapping, menu rows not reaching the play bits,
reset and ini round trips
(`tools/test_actions.c`), and the generated hook (`tools/test_act_site.py`).
`make test-pc-controls` also checks Walk scaling, shared key/pad Tilt, mouse routing, sensorless dual-stick eligibility,
Expand Down
84 changes: 37 additions & 47 deletions runtime/hle/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void bind_set2(int dev, int slot, int host) {
act_refresh();
}

// Bind `host` to `slot`; only legacy host slots swap. Actions, Walk, Tilt and gyro allow shared inputs.
// Bind `host` to `slot`. Every input may share its key or button with any other: nothing swaps and nothing else moves.
static void assign(int dev, int slot, int host) {
if (cap_alt) {
if (bind_slot_is_action(slot)) {
Expand All @@ -358,26 +358,18 @@ static void assign(int dev, int slot, int host) {
result(1, dev, slot, -1);
return;
}
if (bind_slot_is_action(slot)) { // an action may share its key with any other: nothing swaps
if (bind_slot_is_action(slot)) {
act_set(dev, slot - BIND_ACTION, host);
LOG("[input] %s action %d -> %s\n", dev == BIND_DEV_PAD ? "controller" : "keyboard", slot - BIND_ACTION,
dev == BIND_DEV_PAD ? k_pad_ini[host] : bind_key_label(host));
result(1, dev, slot, -1);
return;
}
int16_t *t = dev == BIND_DEV_PAD ? g_bind_pad : g_bind_key;
int other = -1;
for (int i = 0; i < BIND_KEY_COUNT; i++)
if (i != slot && (dev == BIND_DEV_KEY ? bind_key_same_context(i, slot) : (bind_pad_slot(i) && bind_key_same_context(i, slot))) && t[i] == host) {
other = i;
t[i] = t[slot];
}
t[slot] = (int16_t)host;
LOG("[input] %s %s -> %s%s%s%s\n", dev == BIND_DEV_PAD ? "controller" : "keyboard", k_names[slot],
dev == BIND_DEV_PAD ? k_pad_ini[host] : bind_key_label(host), other >= 0 ? " (swapped with " : "",
other >= 0 ? k_names[other] : "", other >= 0 ? ")" : "");
if (other >= 0) LOG("[input] %s -> %s\n", k_names[other], dev == BIND_DEV_PAD ? bind_pad_label(t[other], 0) : bind_key_label(t[other]));
result(other >= 0 ? 2 : 1, dev, slot, other);
LOG("[input] %s %s -> %s\n", dev == BIND_DEV_PAD ? "controller" : "keyboard", k_names[slot],
dev == BIND_DEV_PAD ? k_pad_ini[host] : bind_key_label(host));
result(1, dev, slot, -1);
act_refresh();
}

Expand Down Expand Up @@ -585,7 +577,7 @@ bool act_is_default(int id) {

// The raw Switch input b (not a face button) is bound to something other than its defaults. In play the game reads
// those slots for actions at their factory defaults, so Call horse moved with Magnesis: pull closer and Aim rune with
// Menu: previous tab. The face buttons need none of this: in play act_gameplay_buttons builds them from the actions.
// Menu: previous tab. The face buttons need none of this: in play act_play_keys / act_play_pads build them from the actions.
static bool raw_moved(int b) {
if (b < 0 || b >= BIND_PAD_COUNT || b == BIND_A || b == BIND_B || b == BIND_X || b == BIND_Y) return false;
return g_bind_key[b] != k_def_key[b] || g_bind_key2[b] != 0 || g_bind_pad[b] != k_def_pad[b] ||
Expand Down Expand Up @@ -671,6 +663,37 @@ static void act_migrate(int dev, int slot) {
act_refresh();
}

// In play the game's A / B / X / Y / L / R / ZL / ZR / stick-press bits are built from the actions, never from the menu
// rows: a key given to "Menu: sort / sensor" must not press Attack, and rebinding Jump must not take Space away from the
// other actions that default to the same Switch button. A bit is set by the default binding of an action (still on its
// factory binding, so the game answers it from this bit) that reads that button. The menus keep using the menu rows.
#define ACT_RAW_SLOTS ((1u << BIND_A) | (1u << BIND_B) | (1u << BIND_X) | (1u << BIND_Y) | (1u << BIND_LSTICK) | \
(1u << BIND_RSTICK) | (1u << BIND_L) | (1u << BIND_R) | (1u << BIND_ZL) | (1u << BIND_ZR))
uint64_t act_raw_slots(void) { return ACT_RAW_SLOTS; }
// Only once the game has asked about an action (its hook is there); until then, and for game versions without the hook,
// the menu rows keep driving every button as before.
bool act_play_active(void) { return k_masks != NULL; }

uint64_t act_play_keys(int (*held)(int scancode)) {
uint64_t out = 0;
for (int id = 0; id < ACT_COUNT; id++) {
int slot = act_switch_button(id), k = g_act_key[id];
if (slot < 0 || !(ACT_RAW_SLOTS >> slot & 1) || (a_custom >> id & 1)) continue;
if (k > 0 && held(k)) out |= 1ull << slot;
}
return out;
}

uint64_t act_play_pads(uint32_t host_buttons) {
uint64_t out = 0;
for (int id = 0; id < ACT_COUNT; id++) {
int slot = act_switch_button(id), k = g_act_pad[id];
if (slot < 0 || !(ACT_RAW_SLOTS >> slot & 1) || (a_custom >> id & 1)) continue;
if (k >= 0 && k < PADB_HOST_COUNT && (host_buttons >> k & 1)) out |= 1ull << slot;
}
return out;
}

int act_prompt_host(int dev, int sw) {
const int16_t *actions = dev == BIND_DEV_PAD ? g_act_pad : g_act_key;
int host = -1;
Expand Down Expand Up @@ -716,39 +739,6 @@ uint64_t act_scan_pad(uint64_t pad_buttons, uint32_t host_buttons) {
return out;
}

static bool act_held_host(int id, int (*held)(int scancode), uint32_t host) {
if (id < 0 || id >= ACT_COUNT) return false;
int k = g_act_key[id], k2 = g_act_key2[id], p = g_act_pad[id], p2 = g_act_pad2[id];
return (k > 0 && held && held(k)) || (k2 > 0 && held && held(k2)) ||
(p >= 0 && p < PADB_HOST_COUNT && (host >> p & 1)) ||
(p2 >= 0 && p2 < PADB_HOST_COUNT && (host >> p2 & 1));
}

// During gameplay, decouple in-game action buttons (Y/X/A/B) from raw menu rebinds
// so that rebinding a menu slot (e.g. "Menu: sort / sensor") never hijacks actions in play.
// Only the raw keyboard/pad mask is rewritten; script/console/cursor/auto-continue bits stay untouched.
uint64_t act_gameplay_buttons(uint64_t raw, int (*held)(int scancode), uint32_t host) {
raw &= ~((1ull << BIND_Y) | (1ull << BIND_X) | (1ull << BIND_A) | (1ull << BIND_B));
if (act_held_host(3, held, host) || act_held_host(36, held, host)) raw |= 1ull << BIND_Y;
if (act_held_host(2, held, host)) raw |= 1ull << BIND_X;
if (act_held_host(0, held, host)) raw |= 1ull << BIND_A;
if (act_held_host(12, held, host) || act_held_host(14, held, host)) raw |= 1ull << BIND_B;
// ZL and ZR too, once Guard / lock on (13) or Bow (18) answers from its own bindings: the game also reads ZL and
// ZR as buttons, not only through those actions (the shield held up, the lock-on kept), so a moved Menu: previous
// tab 2 / next tab 2 went on guarding in play and Guard's own key did half of it (#1103). Factory defaults leave
// the raw input as it is: the two are the same key then.
uint64_t custom = a_custom;
if (custom >> 13 & 1) {
raw &= ~(1ull << BIND_ZL);
if (act_held_host(13, held, host)) raw |= 1ull << BIND_ZL;
}
if (custom >> 18 & 1) {
raw &= ~(1ull << BIND_ZR);
if (act_held_host(18, held, host)) raw |= 1ull << BIND_ZR;
}
return raw;
}

// Each side publishes its own half (the keyboard and the controller change at different times)
void act_publish(uint64_t keys, uint64_t pads) {
if (keys != ~0ull) a_keys = keys;
Expand Down
24 changes: 15 additions & 9 deletions runtime/hle/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ enum {
_Static_assert(BTN_DOWN == BIND_DOWN && BTN_ZL == BIND_ZL, "bindings follow the button bits");

static _Atomic uint64_t key_buttons, pad_buttons;
static _Atomic uint64_t key_play, pad_play; // the same in play: the action-driven bits replace the menu rows' (act_play_keys)
// A contextual action consumes a held button until release, while observers
// still read the raw snapshot to detect the next physical press.
static _Atomic uint64_t consumed_buttons;
Expand Down Expand Up @@ -191,6 +192,7 @@ static void recompute_keyboard(void) {
for (int i = 0; i < BIND_PAD_COUNT; i++)
if (game_key_slot(i)) b |= 1ull << i;
key_buttons = b;
key_play = (b & ~act_raw_slots()) | act_play_keys(game_key);
act_publish(act_scan_keys(b, game_key), ~0ull); // actions read their own host keys
int tilt = game_key_slot(BIND_WALK) ? 13107 : 32767; // walk: 40% (BOTW walks below about half)
key_lx = (game_key_slot(BIND_LS_RIGHT) - game_key_slot(BIND_LS_LEFT)) * tilt;
Expand Down Expand Up @@ -219,6 +221,7 @@ static void dead_zone(_Atomic int32_t *x, _Atomic int32_t *y, int32_t rx, int32_
static void recompute_pad(void) {
if (!pad_focused() && !host_test) {
pad_buttons = 0;
pad_play = 0;
host_buttons = 0;
recompute_motion();
act_publish(~0ull, 0);
Expand Down Expand Up @@ -264,6 +267,7 @@ static void recompute_pad(void) {
freecam_pad_buttons(host);
}
pad_buttons = 0;
pad_play = 0;
host_buttons = 0; // (the bindings see nothing either: the free camera has the controller)
recompute_motion();
act_publish(~0ull, 0);
Expand All @@ -281,6 +285,7 @@ static void recompute_pad(void) {
if ((g_bind_pad[i] >= 0 && g_bind_pad[i] < PADB_HOST_COUNT && (host >> g_bind_pad[i] & 1)) ||
(g_bind_pad2[i] >= 0 && g_bind_pad2[i] < PADB_HOST_COUNT && (host >> g_bind_pad2[i] & 1))) b |= 1ull << i;
pad_buttons = b;
pad_play = (b & ~act_raw_slots()) | act_play_pads(host);
act_publish(~0ull, act_scan_pad(b, host)); // actions read their own host buttons
// Fly mode (test builds): the press of its controller button toggles it. Not while the menu or a rebind has the pad
// (the held state is still tracked, so letting go of a button that was just bound does not toggle).
Expand Down Expand Up @@ -1255,10 +1260,10 @@ static bool ui_menu_active(void) {
uint64_t input_buttons_now(void) {
bool muted = (!win_focused && !host_test) || menu_input_captured();
bool pad_muted = (!pad_focused() && !host_test) || menu_input_captured();
uint64_t raw = (muted ? 0 : key_buttons) | (pad_muted ? 0 : pad_buttons);
if (!pad_muted && !ui_menu_active() && !pc_cursor_active())
raw = act_gameplay_buttons(raw, game_key, host_buttons);
uint64_t b = raw | (muted ? 0 : escape_buttons) | script_buttons;
bool play = !pad_muted && !ui_menu_active() && !pc_cursor_active() && act_play_active();
uint64_t kbtn = muted ? 0 : (play ? key_play : key_buttons);
uint64_t pbtn = pad_muted ? 0 : (play ? pad_play : pad_buttons);
uint64_t b = kbtn | pbtn | (muted ? 0 : escape_buttons) | script_buttons;
control_input_apply(&b, NULL, NULL, NULL, NULL);
return b;
}
Expand Down Expand Up @@ -1399,12 +1404,13 @@ static void fill_state(Cpu *c) {
// the window unfocused or the overlay up, use the Switch layer, so no binding can lock the player out.
bool ui_menu = ui_menu_active();
uint64_t bow = pc_bow_sample();
// In play the game's buttons come from the actions, not from the menu rows (act_play_keys); menus (and shops and
// dialogues) read the rows
bool in_menu = pad_menu || ui_menu;
uint64_t kbtn = menu ? 0 : key_buttons;
uint64_t pbtn = pad_menu ? 0 : pad_buttons;
uint64_t raw = in_menu ? (kbtn | pbtn)
: act_gameplay_buttons(kbtn | pbtn, game_key, pad_menu ? 0 : host_buttons);
uint64_t b = raw | (menu ? 0 : escape_buttons | bow) | script_buttons;
bool acts = !in_menu && act_play_active();
uint64_t kbtn = menu ? 0 : (acts ? key_play : key_buttons);
uint64_t pbtn = pad_menu ? 0 : (acts ? pad_play : pad_buttons);
uint64_t b = kbtn | pbtn | (menu ? 0 : escape_buttons | bow) | script_buttons;
if (!menu) b |= auto_continue_buttons(b); // (not while the overlay has the controls)
b=pc_cursor_buttons(b);
// (Accessibility toggles: a menu, a cutscene or a talk lets go, so the shield or the bow isn't still up after it)
Expand Down
18 changes: 13 additions & 5 deletions runtime/input_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool bind_is_default(int dev);
bool bind_is_default_slot(int dev, int slot);

// "Click a binding, then press": begun from the UI; the next press (any thread's SDL event) is taken. Escape cancels,
// as does BIND_CAPTURE_MS without a press. On a conflict the two inputs swap.
// as does BIND_CAPTURE_MS without a press. Any input may share its key or button with another: nothing swaps.
#define BIND_CAPTURE_MS 5000
void bind_capture_begin(int dev, int slot);
void bind_capture_begin_alt(int dev, int slot, bool alt);
Expand All @@ -84,7 +84,7 @@ void bind_capture_cancel(void);
bool bind_capture_active(int *dev, int *slot, int *ms_left);
// Main thread, before anything else sees the event: true = consumed by a capture
bool bind_capture_event(const SDL_Event *e);
// Last change for the UI: 0 none, 1 set, 2 swapped (with *other), 3 cancelled, 4 timed out, 5 reset, 6 A / B swapped; *serial bumps
// Last change for the UI: 0 none, 1 set, 2 (unused: nothing swaps any more), 3 cancelled, 4 timed out, 5 reset, 6 A / B swapped; *serial bumps
int bind_last_result(int *dev, int *slot, int *other, int *serial);

// savagewind.ini: bind_pad_<input> / bind_key_<input> (only the ones that differ from the defaults are written)
Expand All @@ -100,8 +100,9 @@ int bind_pad_from_name(const char *name);
// Switch button (a table in the game: several actions share a button). Every action owns an explicit host key and
// controller binding, initially copied from that button's factory defaults for 1.9.0. An action differing on either
// device reads both host bindings directly. A factory-default action leaves the game to answer from its Switch layer,
// preserving JumpButtonChange and raw Switch injection. Before act_schema = 2, legacy ini raw-button rebinds migrate
// for action/device pairs without an act_* line. Menus also use the Switch layer. input.c publishes host state.
// preserving JumpButtonChange and raw Switch injection; in play that layer's bits come from the default actions, not from
// the menu rows (act_play_keys). Before act_schema = 2, legacy ini raw-button rebinds migrate for action/device pairs
// without an act_* line. Menus use the Switch layer, driven by the menu rows. input.c publishes host state.
#define ACT_COUNT 41
enum { ACT_FOLLOW = -1, ACT_NONE = -2 };
extern int16_t g_act_key[ACT_COUNT]; // SDL_Scancode / BIND_MOUSE + button, or ACT_NONE
Expand Down Expand Up @@ -150,10 +151,17 @@ uint64_t act_hud_slot_pane(int slot, const char *name);
void act_masks(const uint32_t *table); // the game's table of one mask per action (its address, from the patch)
void act_reset(void); // every action back to the default

// In play the game's A / B / X / Y / L / R / ZL / ZR / stick-press bits come from the actions (the default binding of every
// action still on its factory binding), never from the menu rows; the menus keep using the menu rows. act_play_active()
// is false until the game has asked about an action (and on game versions without the hook): then the rows drive everything.
bool act_play_active(void);
uint64_t act_raw_slots(void); // the BIND_* bits above (1 << slot)
uint64_t act_play_keys(int (*held)(int scancode)); // those bits, keyboard side
uint64_t act_play_pads(uint32_t host_buttons); // ... controller side

// Host state in, from runtime/hle/input.c. Main thread, on every key / button event:
uint64_t act_scan_keys(uint64_t key_buttons, int (*held)(int scancode)); // actions the keyboard side holds
uint64_t act_scan_pad(uint64_t pad_buttons, uint32_t host_buttons); // ... the controller side holds
uint64_t act_gameplay_buttons(uint64_t raw, int (*held)(int scancode), uint32_t host_buttons); // gameplay A/B/X/Y from action bindings
void act_publish(uint64_t keys, uint64_t pads); // (bit per action)
// The controller poll (game thread, once per GetNpadStates): freezes the held / pressed sets the game's queries see.
// live = false in the game's menus, with the window unfocused or the overlay up: the Switch layer answers then.
Expand Down
Loading
Loading