feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects #1092

Open
lg wants to merge 2 commits from lg/Longshot:feat/controller-notices into main
Contributor

Type: feat · Risk: low · Tested on: Windows 11, RTX 4090 (621.24), a DualSense over Bluetooth · Needs: an Xbox and a Switch controller; a run on Linux; Steam Deck

Why

A controller that runs out of battery just stops answering, and nothing on screen says why. The game never asks for
a controller's battery: on the console the system shows the low-battery notice and the controller screen, and
Longshot had nothing in their place.

No issue asks for this (tracker searched: battery, disconnect, controller connected).

What changed

Longshot now shows a short notice at the top of the screen, in the menu's style and language, when a controller's
battery gets low, when it gets very low, when a controller disconnects (saying if its battery was low) and when one
connects during play. Each shows for 6 to 12 seconds; the game is not paused. The game's own pause menu names the
controller on its System page, under the controller picture of "Basic Controls", with its battery percentage when it
reports a measured one (a DualSense or DualShock 4) and a bolt while it is plugged in. A controller that reports no
battery gets only the connected and disconnected notices, and under Steam Input that is the case whenever the game is
given only Steam's stand-in controller.

  • rules: host/pad_battery.h (pure). Low and very low follow what each controller reports through SDL: DualSense and
    DualShock 4 count in tenths (20% and 10%, the number shown); Xbox controllers warn at 40% and 10% and Switch
    controllers at 25% and 0%, with no number shown (SDL gives them as four and five levels); SDL2 and XInput give four
    steps. Each warning shows once as the battery falls. No new warning while the controller is plugged in, and one on
    screen goes after five readings plugged in (about 5 s through SDL, about 25 s through XInput).
  • host: host/pad_battery.c keeps a queue of notices: a new one replaces the same controller's earlier ones;
    otherwise the one on screen plays out, then the most urgent waiting one. A notice's time counts only while the
    player can be looking: the game's window in front (or an overlay over it), or the controllers set to count in the
    background. pads_poll (host/pad_sdl.c, once a second, through the new hos_sdl_pad_power) and,
    only when SDL's controller support is not there, pads_read (host/nn_hid.c, XInput) report controllers to it.
  • the pause menu's line: host/oot_menu.c finds the System page in front from the game's own menu hooks, on Windows
    and Linux (one of the page's panes took the focus last, and its screen still updates); host/hos_wide_ui.c notes the
    pane that shows the page's panel as it is placed and reads where it is when asked, so the line slides in with the
    page. It hides on the other pages, under a screen opened from the page (Load, Options), under the Insert menu and
    when the menu closes.
  • renderer: MkwVkHost.pad_notice and pad_status (MKWVK_API_VERSION 30); draw_pad_notice and draw_pad_status
    in gpu/vk/vk_menu.cpp; the notice's five texts in each menu language (gpu/vk/menu_i18n.h).
  • tests: tests/test_pad_battery.py and tests/test_pad_panel.py (new); test_fps_overlay_order.py,
    test_pads_after_menu.py, test_hold_toggle.py and test_audio_output_devices.py updated for the changed
    functions and the new version (the audio check pinned version 29 and the interface's last members).
  • docs: the README's controller section, docs/development.md, and the guide-image review note.

Limits:

  • No battery reading, so no battery warning: Steam Input's stand-in controllers, the Steam Deck's built-in controls,
    and controllers SDL reads through the plain Linux joystick driver. The log says so once.
  • XInput controllers are reported only when SDL's controller support is not running.
  • A controller SDL first lists more than about 2 s after the game starts is announced as connected.
  • With several controllers, the pause menu names the first one.
  • The pause menu's line needs the supported game version's hooks (those the mouse in the game's menus uses); on a
    wider screen than 16:9 its place follows the menus' fit but was not looked at.
  • At the Large menu size, a long help text reaches up under the banner, and the notice covers the help box's title
    for the seconds it shows (second sheet below).

Measurements

Verdict: it works in the game (screenshots below), and no frame-rate cost was measured while no notice shows: standing still, main 80.2 / 80.0 fps, this PR 80.5 / 80.6, this PR with the notices off 80.9 / 80.75. Through the controller going and coming back, with the disconnected and then the connected notice shown, the six 5 s readings are 79.3 to 80.6 fps on main (median 79.55) and 79.5 to 80.6 here (median 79.85): no difference beyond the noise of so few samples, and the readings cover more than the notices themselves.

Hardware: Windows 11, RTX 4090 24 GB, driver 621.24, Core i9-10900K, 32 GB
Scene: the village, by its gate, daytime, standing still where the save loads; 3840x2160, DLAA, frame generation off, no frame rate cap, V-Sync off, HDR off (read back from each run's log)
Method: the vi: lines of longshot_log.txt (fps over 5 s). Standing still: 60 s from 25 s after the save loaded, main, this PR and this PR with the switch in turn, twice, after a warm-up launch of each build; the median of each run's 12 lines. The controller going and coming back: its device switched off in Windows, 5 s, switched on, 6 s, main and this PR in turn, twice; the three lines that end in that time (each covers 5 s, so they reach back before the disconnect)
How to reproduce: load a save standing still with a controller connected, the settings above, and read the log's vi: lines; HOS_PAD_NOTICE=0 in longshot_env.txt for the third column
Commits: 9f0dd23 is this PR's code commit, on main 544229a. The builds that ran name themselves 3938f4c (the Insert menu's banner in the second sheet too): that commit with an earlier set of run files. The head 974550e differs from it only under docs/tested/

Before: main @ 544229a After: this PR @ 9f0dd23 After, HOS_PAD_NOTICE=0: this PR @ 9f0dd23
fps standing still, no notice on screen: median (run 1 / run 2) 80.2 / 80.0 80.5 / 80.6 80.9 / 80.75
fps through the controller going and coming back (run 1; run 2) 79.3, 79.5, 80.4; 79.6, 79.5, 80.6 79.5, 79.7, 80.5; 79.7, 80.0, 80.6 (the disconnected, then the connected notice shown) not measured
A controller disconnects or connects nothing shown a notice each nothing shown
Its battery low or very low (from HOS_PAD_BATTERY_TEST; its own reading was 85%, on its battery) nothing shown a notice each nothing shown
The pause menu's System page no controller named DualSense Wireless Controller: 85% under the controller picture no controller named
The log lines
--- main-1 (longshot 544229a), standing still
vi: 12150 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 12552 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 12953 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 13356 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 13758 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 14159 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 14561 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 14963 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 15361 frames presented (79.5 fps over the last 5.0 s, interval 1)
vi: 15762 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 16164 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 16566 frames presented (80.3 fps over the last 5.0 s, interval 1)
--- pr-1 (longshot 9f0dd23), standing still
vi: 12410 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 12812 frames presented (80.4 fps over the last 5.0 s, interval 1)
vi: 13215 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 13618 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 14020 frames presented (80.4 fps over the last 5.0 s, interval 1)
vi: 14424 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 14828 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 15231 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 15633 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 16038 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 16442 frames presented (80.7 fps over the last 5.0 s, interval 1)
vi: 16844 frames presented (80.2 fps over the last 5.0 s, interval 1)
--- off-1 (longshot 9f0dd23, HOS_PAD_NOTICE=0), standing still
vi: 11830 frames presented (80.7 fps over the last 5.0 s, interval 1)
vi: 12234 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 12639 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 13043 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 13449 frames presented (81.2 fps over the last 5.0 s, interval 1)
vi: 13854 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 14258 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 14663 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 15069 frames presented (81.1 fps over the last 5.0 s, interval 1)
vi: 15475 frames presented (81.1 fps over the last 5.0 s, interval 1)
vi: 15881 frames presented (81.1 fps over the last 5.0 s, interval 1)
vi: 16287 frames presented (81.0 fps over the last 5.0 s, interval 1)
--- main-2 (longshot 544229a), standing still
vi: 11131 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 11529 frames presented (79.6 fps over the last 5.0 s, interval 1)
vi: 11929 frames presented (79.9 fps over the last 5.0 s, interval 1)
vi: 12330 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 12732 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 13132 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 13533 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 13933 frames presented (79.8 fps over the last 5.0 s, interval 1)
vi: 14335 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 14737 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 15138 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 15536 frames presented (79.5 fps over the last 5.0 s, interval 1)
--- pr-2 (longshot 9f0dd23), standing still
vi: 11503 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 11904 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 12307 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 12711 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 13116 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 13519 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 13922 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 14325 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 14729 frames presented (80.7 fps over the last 5.0 s, interval 1)
vi: 15132 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 15536 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 15939 frames presented (80.5 fps over the last 5.0 s, interval 1)
--- off-2 (longshot 9f0dd23, HOS_PAD_NOTICE=0), standing still
vi: 12021 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 12423 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 12827 frames presented (80.7 fps over the last 5.0 s, interval 1)
vi: 13232 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 13637 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 14042 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 14447 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 14852 frames presented (81.0 fps over the last 5.0 s, interval 1)
vi: 15253 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 15657 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 16062 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 16465 frames presented (80.4 fps over the last 5.0 s, interval 1)
--- main-g1 (longshot 544229a), the controller going and coming back
vi: 12539 frames presented (79.3 fps over the last 5.0 s, interval 1)
vi: 12937 frames presented (79.5 fps over the last 5.0 s, interval 1)
vi: 13340 frames presented (80.4 fps over the last 5.0 s, interval 1)
--- pr-g1 (longshot 9f0dd23), the controller going and coming back
vi: 12890 frames presented (79.5 fps over the last 5.0 s, interval 1)
vi: 13289 frames presented (79.7 fps over the last 5.0 s, interval 1)
vi: 13692 frames presented (80.5 fps over the last 5.0 s, interval 1)
--- main-g2 (longshot 544229a), the controller going and coming back
vi: 12746 frames presented (79.6 fps over the last 5.0 s, interval 1)
vi: 13144 frames presented (79.5 fps over the last 5.0 s, interval 1)
vi: 13548 frames presented (80.6 fps over the last 5.0 s, interval 1)
--- pr-g2 (longshot 9f0dd23), the controller going and coming back
vi: 12349 frames presented (79.7 fps over the last 5.0 s, interval 1)
vi: 12749 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 13152 frames presented (80.6 fps over the last 5.0 s, interval 1)

Flags and settings

Two new switches, no menu row (HOS_HEADLESS, HOS_WINDOW_NOACTIVATE, HOS_INPUT_BACKGROUND and HOS_MENU_TRACE in the diff are existing ones, only read).

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
HOS_PAD_NOTICE=0 Turns the notices off (none) Unset: the notices are on No battery is read; no notices, no battery lines in the log, no controller named on the pause menu Unset and =0: run in the game On by default (unset)
HOS_PAD_BATTERY_TEST=<percent>[,xbox|switch|sony][,plugged] Reads every controller as on its battery at that level, as that kind of controller when one is named; plugged reads it as plugged in (none) Unset Shows the warnings without running a battery down, and another kind of controller's rules without having one 5, 15, 40,xbox and 0,switch: run in the game; plugged: the game-free test only Off: for testing only

Testing

Tested:

  • Game-free, Ubuntu 26.04, gcc 15.2: python -I -B tests/run_all.py: 608 passed, 37 failed, 78 skipped (on 3938f4c; the head differs only under docs/tested/, whose check passes for this PR's files and fails on main for another's). main 544229a on
    that PC: 606 passed and the same 37 failed (test_bug_report, test_bug_report_defaults, test_cpu_report,
    test_crash_groups, test_crt_options, test_damage_debug_menu, test_display_startup_failure,
    test_dlss_feature_size, test_failed_compile_keeps_objects, test_framegen_preset, test_guest_imported,
    test_hardware_report, test_hud_layout_row, test_invalidate_vcore, test_linux_preflight,
    test_linux_pressure, test_linux_update, test_mirror_budget, test_missing_nup, test_mods_size_table,
    test_pending_guest_import, test_pipeline_play_cache, test_present_thread, test_profiling_mode,
    test_readback_timeout_source, test_rumble_menu, test_run_all_changed, test_slow_frames, test_switch_table,
    test_target_image_pool, test_tested_configurations, test_upscaler_round_trip, test_upscaler_rows,
    test_vcore_escape, test_vk_occlusion_queries, test_vk_swapchain_compat, test_walk_key).
  • The Windows game cross-built on Linux (RX_TARGET=windows, llvm-mingw 20261104), main and this PR.
  • The whole game built for Linux at 3938f4c (scripts/dev_build.py build --quick, Ubuntu 26.04, tools.lock's tools):
    longshot and longshot_vk.so compile and link. Not run there: that PC has no GPU.
  • In the game on 9f0dd23, Windows 11, RTX 4090 (driver 621.24), one DualSense over Bluetooth on its battery, SDL 3.4.20,
    4K: nothing shown at launch, each notice over the game, the low and very low ones over the open Insert menu, German
    at the Large menu size, an Xbox and a Switch controller simulated (HOS_PAD_BATTERY_TEST=40,xbox and 0,switch:
    the warning with no number), and no notice with HOS_PAD_NOTICE=0 (that the pause menu then names no controller is
    covered by the game-free test only). The low and very low warnings came from
    HOS_PAD_BATTERY_TEST; connecting and disconnecting from switching the controller's device off and on in Windows.
  • The pause menu's line, the same run: on the System page with another of its buttons chosen; gone on the Load screen
    opened from it and back on return; gone on the Items page and back; gone under the Insert menu; gone with the
    controller disconnected and back with it; gone with the menu closed and there when it opens again on that page;
    15% and an Xbox controller's name alone from HOS_PAD_BATTERY_TEST. The presses were sent with HOS_INPUT_LIVE.
  • In the game on earlier builds of this change: the controller on its charger (read as plugged in, its battery at 100%), several notices one after another, and a notice that came up behind another window still there on coming
    back.

Not tested:

  • A real battery falling through 20% and 10% during play, a controller switching itself off, and a cable plugged in
    and pulled on purpose.
  • Any real Xbox, Switch or other controller, two controllers at once, SDL2, and the XInput path on hardware: their
    rules are covered by the game-free test, from SDL 3.4's source, and the Xbox and Switch notices by the simulation.
  • The pause menu's bolt for a controller that is plugged in: the controller was on its battery in this run (the same
    drawing showed it on the Insert menu in earlier builds).
  • A run on Linux (it builds there), the Steam Deck, and Steam Input; the pause menu's line on a screen that is not
    16:9, and in the game's other languages (the line itself is a name and a number).
  • The translations were written with AI help and not checked by native speakers.

Must be tested:

  • Windows, an Xbox controller over Bluetooth or the wireless adapter: start the game with it on its battery, then again with HOS_PAD_BATTERY_TEST=40 in longshot_env.txt, expecting a hid: "(its name)": on its battery, its battery at about N% line in longshot_log.txt the first time and "Controller battery low" with no percentage the second (by hand: the log line and the notice)
  • Windows or Linux, a Switch Pro Controller or Joy-Con: the same with HOS_PAD_BATTERY_TEST=25, expecting the same kind of log line and "Controller battery low" with no percentage (by hand: the log line and the notice)
  • Linux, any GPU, a DualSense that SDL opens over hidraw (the udev rules): start the game with the controller on, turn it off and on, expecting no notice at the start, then "Controller disconnected" and "Controller connected" with its percentage (by hand: the notices)
  • linux: start the game with a controller connected, expecting no controller notice at the start, and a hid: "(its name)": ... line in the log saying what was read of its battery (Test Farm: asked in a comment, @Beanstalk on Linux: ...)
  • steamdeck: start the game and play a minute, expecting no controller notice and no battery reading from it so far in the log, or a battery line if the Deck's controls turn out to report one (Test Farm: asked in a comment, @Beanstalk on the Steam Deck: ...)

Screenshots

Before: main @ 544229a · After: this PR @ 9f0dd23. The same save, the same spot, 3840x2160. The battery levels are set with HOS_PAD_BATTERY_TEST; the Xbox and Switch controllers are simulated with it on the DualSense.

Controller notices over the game: before and after

The controller on the pause menu (before and after), a notice over the Insert menu, and the caveat

Risks

What could break: a controller that misreports its battery gets a warning it should not; a virtual controller that
reconnects by itself would be announced each time; the pause menu's line reads the game's own menu objects each frame
that page shows (as the mouse in the game's menus does), so a game version they do not fit shows no line.
Turning it off: HOS_PAD_NOTICE=0.
Compatibility: MKWVK_API_VERSION is 30: the game and its renderer must come from the same build, as before. Saves,
longshot_options.ini and the caches are not touched.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks. Not ticked yet: Risks names a per-frame menu read on the pause page, but no measurement covers that page.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main. (main @ 544229a)
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • MKWVK_API_VERSION bumped (gpu/vk/vk_api.h's MkwVkHost or MkwVkRenderer changed).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: the whole game cross-built. Linux: the whole game built with scripts/dev_build.py build --quick. No path code changed.)
  • Docs updated.

🤖 Generated with Claude Code

**Type:** feat · **Risk:** low · **Tested on:** Windows 11, RTX 4090 (621.24), a DualSense over Bluetooth · **Needs:** an Xbox and a Switch controller; a run on Linux; Steam Deck ## Why A controller that runs out of battery just stops answering, and nothing on screen says why. The game never asks for a controller's battery: on the console the system shows the low-battery notice and the controller screen, and Longshot had nothing in their place. No issue asks for this (tracker searched: battery, disconnect, controller connected). ## What changed Longshot now shows a short notice at the top of the screen, in the menu's style and language, when a controller's battery gets low, when it gets very low, when a controller disconnects (saying if its battery was low) and when one connects during play. Each shows for 6 to 12 seconds; the game is not paused. The game's own pause menu names the controller on its System page, under the controller picture of "Basic Controls", with its battery percentage when it reports a measured one (a DualSense or DualShock 4) and a bolt while it is plugged in. A controller that reports no battery gets only the connected and disconnected notices, and under Steam Input that is the case whenever the game is given only Steam's stand-in controller. - rules: `host/pad_battery.h` (pure). Low and very low follow what each controller reports through SDL: DualSense and DualShock 4 count in tenths (20% and 10%, the number shown); Xbox controllers warn at 40% and 10% and Switch controllers at 25% and 0%, with no number shown (SDL gives them as four and five levels); SDL2 and XInput give four steps. Each warning shows once as the battery falls. No new warning while the controller is plugged in, and one on screen goes after five readings plugged in (about 5 s through SDL, about 25 s through XInput). - host: `host/pad_battery.c` keeps a queue of notices: a new one replaces the same controller's earlier ones; otherwise the one on screen plays out, then the most urgent waiting one. A notice's time counts only while the player can be looking: the game's window in front (or an overlay over it), or the controllers set to count in the background. `pads_poll` (`host/pad_sdl.c`, once a second, through the new `hos_sdl_pad_power`) and, only when SDL's controller support is not there, `pads_read` (`host/nn_hid.c`, XInput) report controllers to it. - the pause menu's line: `host/oot_menu.c` finds the System page in front from the game's own menu hooks, on Windows and Linux (one of the page's panes took the focus last, and its screen still updates); `host/hos_wide_ui.c` notes the pane that shows the page's panel as it is placed and reads where it is when asked, so the line slides in with the page. It hides on the other pages, under a screen opened from the page (Load, Options), under the Insert menu and when the menu closes. - renderer: `MkwVkHost.pad_notice` and `pad_status` (`MKWVK_API_VERSION` 30); `draw_pad_notice` and `draw_pad_status` in `gpu/vk/vk_menu.cpp`; the notice's five texts in each menu language (`gpu/vk/menu_i18n.h`). - tests: `tests/test_pad_battery.py` and `tests/test_pad_panel.py` (new); `test_fps_overlay_order.py`, `test_pads_after_menu.py`, `test_hold_toggle.py` and `test_audio_output_devices.py` updated for the changed functions and the new version (the audio check pinned version 29 and the interface's last members). - docs: the README's controller section, `docs/development.md`, and the guide-image review note. Limits: - No battery reading, so no battery warning: Steam Input's stand-in controllers, the Steam Deck's built-in controls, and controllers SDL reads through the plain Linux joystick driver. The log says so once. - XInput controllers are reported only when SDL's controller support is not running. - A controller SDL first lists more than about 2 s after the game starts is announced as connected. - With several controllers, the pause menu names the first one. - The pause menu's line needs the supported game version's hooks (those the mouse in the game's menus uses); on a wider screen than 16:9 its place follows the menus' fit but was not looked at. - At the Large menu size, a long help text reaches up under the banner, and the notice covers the help box's title for the seconds it shows (second sheet below). ## Measurements **Verdict:** it works in the game (screenshots below), and no frame-rate cost was measured while no notice shows: standing still, main 80.2 / 80.0 fps, this PR 80.5 / 80.6, this PR with the notices off 80.9 / 80.75. Through the controller going and coming back, with the disconnected and then the connected notice shown, the six 5 s readings are 79.3 to 80.6 fps on main (median 79.55) and 79.5 to 80.6 here (median 79.85): no difference beyond the noise of so few samples, and the readings cover more than the notices themselves. Hardware: Windows 11, RTX 4090 24 GB, driver 621.24, Core i9-10900K, 32 GB Scene: the village, by its gate, daytime, standing still where the save loads; 3840x2160, DLAA, frame generation off, no frame rate cap, V-Sync off, HDR off (read back from each run's log) Method: the `vi:` lines of `longshot_log.txt` (fps over 5 s). Standing still: 60 s from 25 s after the save loaded, main, this PR and this PR with the switch in turn, twice, after a warm-up launch of each build; the median of each run's 12 lines. The controller going and coming back: its device switched off in Windows, 5 s, switched on, 6 s, main and this PR in turn, twice; the three lines that end in that time (each covers 5 s, so they reach back before the disconnect) How to reproduce: load a save standing still with a controller connected, the settings above, and read the log's `vi:` lines; `HOS_PAD_NOTICE=0` in `longshot_env.txt` for the third column Commits: 9f0dd23 is this PR's code commit, on main 544229a. The builds that ran name themselves 3938f4c (the Insert menu's banner in the second sheet too): that commit with an earlier set of run files. The head 974550e differs from it only under `docs/tested/` | | Before: main @ 544229a | After: this PR @ 9f0dd23 | After, HOS_PAD_NOTICE=0: this PR @ 9f0dd23 | |---|---|---|---| | fps standing still, no notice on screen: median (run 1 / run 2) | 80.2 / 80.0 | 80.5 / 80.6 | 80.9 / 80.75 | | fps through the controller going and coming back (run 1; run 2) | 79.3, 79.5, 80.4; 79.6, 79.5, 80.6 | 79.5, 79.7, 80.5; 79.7, 80.0, 80.6 (the disconnected, then the connected notice shown) | not measured | | A controller disconnects or connects | nothing shown | a notice each | nothing shown | | Its battery low or very low (from `HOS_PAD_BATTERY_TEST`; its own reading was 85%, on its battery) | nothing shown | a notice each | nothing shown | | The pause menu's System page | no controller named | `DualSense Wireless Controller: 85%` under the controller picture | no controller named | <details><summary>The log lines</summary> ``` --- main-1 (longshot 544229a), standing still vi: 12150 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 12552 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 12953 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 13356 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 13758 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 14159 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 14561 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 14963 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 15361 frames presented (79.5 fps over the last 5.0 s, interval 1) vi: 15762 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 16164 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 16566 frames presented (80.3 fps over the last 5.0 s, interval 1) --- pr-1 (longshot 9f0dd23), standing still vi: 12410 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 12812 frames presented (80.4 fps over the last 5.0 s, interval 1) vi: 13215 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 13618 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 14020 frames presented (80.4 fps over the last 5.0 s, interval 1) vi: 14424 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 14828 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 15231 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 15633 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 16038 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 16442 frames presented (80.7 fps over the last 5.0 s, interval 1) vi: 16844 frames presented (80.2 fps over the last 5.0 s, interval 1) --- off-1 (longshot 9f0dd23, HOS_PAD_NOTICE=0), standing still vi: 11830 frames presented (80.7 fps over the last 5.0 s, interval 1) vi: 12234 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 12639 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 13043 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 13449 frames presented (81.2 fps over the last 5.0 s, interval 1) vi: 13854 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 14258 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 14663 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 15069 frames presented (81.1 fps over the last 5.0 s, interval 1) vi: 15475 frames presented (81.1 fps over the last 5.0 s, interval 1) vi: 15881 frames presented (81.1 fps over the last 5.0 s, interval 1) vi: 16287 frames presented (81.0 fps over the last 5.0 s, interval 1) --- main-2 (longshot 544229a), standing still vi: 11131 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 11529 frames presented (79.6 fps over the last 5.0 s, interval 1) vi: 11929 frames presented (79.9 fps over the last 5.0 s, interval 1) vi: 12330 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 12732 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 13132 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 13533 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 13933 frames presented (79.8 fps over the last 5.0 s, interval 1) vi: 14335 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 14737 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 15138 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 15536 frames presented (79.5 fps over the last 5.0 s, interval 1) --- pr-2 (longshot 9f0dd23), standing still vi: 11503 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 11904 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 12307 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 12711 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 13116 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 13519 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 13922 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 14325 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 14729 frames presented (80.7 fps over the last 5.0 s, interval 1) vi: 15132 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 15536 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 15939 frames presented (80.5 fps over the last 5.0 s, interval 1) --- off-2 (longshot 9f0dd23, HOS_PAD_NOTICE=0), standing still vi: 12021 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 12423 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 12827 frames presented (80.7 fps over the last 5.0 s, interval 1) vi: 13232 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 13637 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 14042 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 14447 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 14852 frames presented (81.0 fps over the last 5.0 s, interval 1) vi: 15253 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 15657 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 16062 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 16465 frames presented (80.4 fps over the last 5.0 s, interval 1) --- main-g1 (longshot 544229a), the controller going and coming back vi: 12539 frames presented (79.3 fps over the last 5.0 s, interval 1) vi: 12937 frames presented (79.5 fps over the last 5.0 s, interval 1) vi: 13340 frames presented (80.4 fps over the last 5.0 s, interval 1) --- pr-g1 (longshot 9f0dd23), the controller going and coming back vi: 12890 frames presented (79.5 fps over the last 5.0 s, interval 1) vi: 13289 frames presented (79.7 fps over the last 5.0 s, interval 1) vi: 13692 frames presented (80.5 fps over the last 5.0 s, interval 1) --- main-g2 (longshot 544229a), the controller going and coming back vi: 12746 frames presented (79.6 fps over the last 5.0 s, interval 1) vi: 13144 frames presented (79.5 fps over the last 5.0 s, interval 1) vi: 13548 frames presented (80.6 fps over the last 5.0 s, interval 1) --- pr-g2 (longshot 9f0dd23), the controller going and coming back vi: 12349 frames presented (79.7 fps over the last 5.0 s, interval 1) vi: 12749 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 13152 frames presented (80.6 fps over the last 5.0 s, interval 1) ``` </details> ### Flags and settings Two new switches, no menu row (`HOS_HEADLESS`, `HOS_WINDOW_NOACTIVATE`, `HOS_INPUT_BACKGROUND` and `HOS_MENU_TRACE` in the diff are existing ones, only read). | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `HOS_PAD_NOTICE=0` | Turns the notices off | (none) | Unset: the notices are on | No battery is read; no notices, no battery lines in the log, no controller named on the pause menu | Unset and `=0`: run in the game | On by default (unset) | | `HOS_PAD_BATTERY_TEST=<percent>[,xbox\|switch\|sony][,plugged]` | Reads every controller as on its battery at that level, as that kind of controller when one is named; `plugged` reads it as plugged in | (none) | Unset | Shows the warnings without running a battery down, and another kind of controller's rules without having one | `5`, `15`, `40,xbox` and `0,switch`: run in the game; `plugged`: the game-free test only | Off: for testing only | ## Testing **Tested:** - Game-free, Ubuntu 26.04, gcc 15.2: `python -I -B tests/run_all.py`: 608 passed, 37 failed, 78 skipped (on 3938f4c; the head differs only under `docs/tested/`, whose check passes for this PR's files and fails on main for another's). main 544229a on that PC: 606 passed and the same 37 failed (`test_bug_report`, `test_bug_report_defaults`, `test_cpu_report`, `test_crash_groups`, `test_crt_options`, `test_damage_debug_menu`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_failed_compile_keeps_objects`, `test_framegen_preset`, `test_guest_imported`, `test_hardware_report`, `test_hud_layout_row`, `test_invalidate_vcore`, `test_linux_preflight`, `test_linux_pressure`, `test_linux_update`, `test_mirror_budget`, `test_missing_nup`, `test_mods_size_table`, `test_pending_guest_import`, `test_pipeline_play_cache`, `test_present_thread`, `test_profiling_mode`, `test_readback_timeout_source`, `test_rumble_menu`, `test_run_all_changed`, `test_slow_frames`, `test_switch_table`, `test_target_image_pool`, `test_tested_configurations`, `test_upscaler_round_trip`, `test_upscaler_rows`, `test_vcore_escape`, `test_vk_occlusion_queries`, `test_vk_swapchain_compat`, `test_walk_key`). - The Windows game cross-built on Linux (`RX_TARGET=windows`, llvm-mingw 20261104), main and this PR. - The whole game built for Linux at 3938f4c (`scripts/dev_build.py build --quick`, Ubuntu 26.04, tools.lock's tools): `longshot` and `longshot_vk.so` compile and link. Not run there: that PC has no GPU. - In the game on 9f0dd23, Windows 11, RTX 4090 (driver 621.24), one DualSense over Bluetooth on its battery, SDL 3.4.20, 4K: nothing shown at launch, each notice over the game, the low and very low ones over the open Insert menu, German at the Large menu size, an Xbox and a Switch controller simulated (`HOS_PAD_BATTERY_TEST=40,xbox` and `0,switch`: the warning with no number), and no notice with `HOS_PAD_NOTICE=0` (that the pause menu then names no controller is covered by the game-free test only). The low and very low warnings came from `HOS_PAD_BATTERY_TEST`; connecting and disconnecting from switching the controller's device off and on in Windows. - The pause menu's line, the same run: on the System page with another of its buttons chosen; gone on the Load screen opened from it and back on return; gone on the Items page and back; gone under the Insert menu; gone with the controller disconnected and back with it; gone with the menu closed and there when it opens again on that page; `15%` and an Xbox controller's name alone from `HOS_PAD_BATTERY_TEST`. The presses were sent with `HOS_INPUT_LIVE`. - In the game on earlier builds of this change: the controller on its charger (read as `plugged in, its battery at 100%`), several notices one after another, and a notice that came up behind another window still there on coming back. **Not tested:** - A real battery falling through 20% and 10% during play, a controller switching itself off, and a cable plugged in and pulled on purpose. - Any real Xbox, Switch or other controller, two controllers at once, SDL2, and the XInput path on hardware: their rules are covered by the game-free test, from SDL 3.4's source, and the Xbox and Switch notices by the simulation. - The pause menu's bolt for a controller that is plugged in: the controller was on its battery in this run (the same drawing showed it on the Insert menu in earlier builds). - A run on Linux (it builds there), the Steam Deck, and Steam Input; the pause menu's line on a screen that is not 16:9, and in the game's other languages (the line itself is a name and a number). - The translations were written with AI help and not checked by native speakers. **Must be tested:** - Windows, an Xbox controller over Bluetooth or the wireless adapter: start the game with it on its battery, then again with `HOS_PAD_BATTERY_TEST=40` in `longshot_env.txt`, expecting a `hid: "(its name)": on its battery, its battery at about N%` line in `longshot_log.txt` the first time and "Controller battery low" with no percentage the second (by hand: the log line and the notice) - Windows or Linux, a Switch Pro Controller or Joy-Con: the same with `HOS_PAD_BATTERY_TEST=25`, expecting the same kind of log line and "Controller battery low" with no percentage (by hand: the log line and the notice) - Linux, any GPU, a DualSense that SDL opens over hidraw (the udev rules): start the game with the controller on, turn it off and on, expecting no notice at the start, then "Controller disconnected" and "Controller connected" with its percentage (by hand: the notices) - linux: start the game with a controller connected, expecting no controller notice at the start, and a `hid: "(its name)": ...` line in the log saying what was read of its battery (Test Farm: asked in a comment, `@Beanstalk on Linux: ...`) - steamdeck: start the game and play a minute, expecting no controller notice and `no battery reading from it so far` in the log, or a battery line if the Deck's controls turn out to report one (Test Farm: asked in a comment, `@Beanstalk on the Steam Deck: ...`) ## Screenshots Before: main @ 544229a · After: this PR @ 9f0dd23. The same save, the same spot, 3840x2160. The battery levels are set with `HOS_PAD_BATTERY_TEST`; the Xbox and Switch controllers are simulated with it on the DualSense. ![Controller notices over the game: before and after](https://git.magicbean.dev/attachments/6c25e31b-f671-411c-8934-25c277bdadb3) ![The controller on the pause menu (before and after), a notice over the Insert menu, and the caveat](https://git.magicbean.dev/attachments/77853f33-8ea6-42c7-9fab-5caa71530e3a) ## Risks **What could break:** a controller that misreports its battery gets a warning it should not; a virtual controller that reconnects by itself would be announced each time; the pause menu's line reads the game's own menu objects each frame that page shows (as the mouse in the game's menus does), so a game version they do not fit shows no line. **Turning it off:** `HOS_PAD_NOTICE=0`. **Compatibility:** `MKWVK_API_VERSION` is 30: the game and its renderer must come from the same build, as before. Saves, `longshot_options.ini` and the caches are not touched. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [ ] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. Not ticked yet: Risks names a per-frame menu read on the pause page, but no measurement covers that page. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. (main @ 544229a) - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] `MKWVK_API_VERSION` bumped (`gpu/vk/vk_api.h`'s `MkwVkHost` or `MkwVkRenderer` changed). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: the whole game cross-built. Linux: the whole game built with `scripts/dev_build.py build --quick`. No path code changed.) - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lg added 2 commits 2026-11-16 07:51:05 +00:00
The game never asks for a controller's battery: on the console the system shows the low-battery notice and the
controller screen. Nothing stood in for it, so a controller that ran out just stopped answering.

host/pad_battery.c keeps a short queue of notices the renderer draws over the game (MkwVkHost.pad_notice, API
version 25): battery low, battery very low, disconnected (and whether the battery was low), connected. The readers
only report pads opening, their battery readings and their going: host/pad_sdl.c for SDL's pads, host/nn_hid.c for
XInput's when SDL's controller support is not there. Where low and very low lie follows what each family reports
(host/pad_battery.h). The menu's Controls screens name the controller and its battery (MkwVkHost.pad_status).
HOS_PAD_NOTICE=0 turns it all off.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
docs(tested): the controller notices' measured runs
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
904aba71fc
Ten runs on one PC (Windows 11, RTX 4090, a DualSense over Bluetooth), main 0691f81 against this change at 0922406:
standing still with no notice (main, this change, this change with HOS_PAD_NOTICE=0, twice in turn), and the
controller going and coming back (main and this change, twice in turn).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Contributor

Tested in game: RTX 4090, driver 621.24, Windows 11, one DualSense over Bluetooth, 3840x2160: the village by its gate. Each notice showed over the game (battery low, very low, disconnected, disconnected with its battery low, connected), the low and very low ones over the open menu too; the Controls tab named the controller with 100% and the charging bolt; nothing showed with HOS_PAD_NOTICE=0. The low levels and the Xbox and Switch cases were set with HOS_PAD_BATTERY_TEST; connecting and disconnecting by switching the controller's device off and on in Windows. Run on 0922406, this branch's code commit before its last rebase over commits the game does not run (the builder and scripts).

Tested in game: RTX 4090, driver 621.24, Windows 11, one DualSense over Bluetooth, 3840x2160: the village by its gate. Each notice showed over the game (battery low, very low, disconnected, disconnected with its battery low, connected), the low and very low ones over the open menu too; the Controls tab named the controller with 100% and the charging bolt; nothing showed with HOS_PAD_NOTICE=0. The low levels and the Xbox and Switch cases were set with HOS_PAD_BATTERY_TEST; connecting and disconnecting by switching the controller's device off and on in Windows. Run on 0922406, this branch's code commit before its last rebase over commits the game does not run (the builder and scripts).
Author
Contributor

@Beanstalk on Linux: build this PR and start the game, with a controller connected if one is at hand; play a minute. Check that the build succeeds, that no controller notice shows at the start, and report the log's hid: lines about the controller (its battery reading, or "no battery reading from it so far"). A picture of the Insert menu's Controls tab, please.

@Beanstalk on the Steam Deck: start the game and play a minute with the Deck's own controls. Check that no controller notice shows over the game, and report the log's hid: lines about the controller ("no battery reading from it so far" is expected). A picture of the game, please.

@Beanstalk on Linux: build this PR and start the game, with a controller connected if one is at hand; play a minute. Check that the build succeeds, that no controller notice shows at the start, and report the log's `hid:` lines about the controller (its battery reading, or "no battery reading from it so far"). A picture of the Insert menu's Controls tab, please. @Beanstalk on the Steam Deck: start the game and play a minute with the Deck's own controls. Check that no controller notice shows over the game, and report the log's `hid:` lines about the controller ("no battery reading from it so far" is expected). A picture of the game, please.
Member

@lg only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it. This request was for 904aba7, and the PR has changed since (d59d240), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@lg only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it.~~ This request was for `904aba7`, and the PR has changed since (`d59d240`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
lg force-pushed feat/controller-notices from 904aba71fc
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to d59d240006
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-16 17:12:40 +00:00
Compare
Author
Contributor

Rebased onto main 55e8fbd (cc194ad, d59d240). main's microphone test took interface version 25, so this change's two members now follow it and the version is 26; the two audio checks that pinned 25 and the last member are updated. The whole game now builds for Linux too (scripts/dev_build.py build --quick, Ubuntu 26.04): that box is ticked. The rebased change ran in the game again (RTX 4090, 621.24, Windows 11, a DualSense): the disconnected, connected and low notices, the Controls tab's line, and main's new Audio rows beside them. The frame-rate numbers and the two sheets are from before the rebase (main 0691f81 against 0922406), and were not taken again: the change itself is the same but for the version.

Rebased onto main 55e8fbd (cc194ad, d59d240). main's microphone test took interface version 25, so this change's two members now follow it and the version is 26; the two audio checks that pinned 25 and the last member are updated. The whole game now builds for Linux too (scripts/dev_build.py build --quick, Ubuntu 26.04): that box is ticked. The rebased change ran in the game again (RTX 4090, 621.24, Windows 11, a DualSense): the disconnected, connected and low notices, the Controls tab's line, and main's new Audio rows beside them. The frame-rate numbers and the two sheets are from before the rebase (main 0691f81 against 0922406), and were not taken again: the change itself is the same but for the version.
lg changed title from WIP: feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects to feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects 2026-11-16 17:12:56 +00:00
lg changed title from feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects to WIP: feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects 2026-11-17 05:38:10 +00:00
Author
Contributor

Back to work in progress. The controller's name and battery are moving from the Insert menu's Controls screens to the game's own pause menu: its System page, above the controller picture under "Basic Controls". The change is written and has game-free checks, but it has not run in the game yet, and the description, its pictures and its Testing section still describe the Insert menu's line. Ready again once it has run in the game and those are redone.

Back to work in progress. The controller's name and battery are moving from the Insert menu's Controls screens to the game's own pause menu: its System page, above the controller picture under "Basic Controls". The change is written and has game-free checks, but it has not run in the game yet, and the description, its pictures and its Testing section still describe the Insert menu's line. Ready again once it has run in the game and those are redone.
lg force-pushed feat/controller-notices from d59d240006
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 974550ed92
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Failing after 9s
2026-11-17 07:06:17 +00:00
Compare
Author
Contributor

The controller's name and battery now show on the game's own pause menu instead of the Insert menu: on the System page, under the controller picture at the foot of the "Basic Controls" panel (it was tried under the title first: crowded). host/oot_menu.c finds that page in front from the game's menu hooks and host/hos_wide_ui.c reads where the panel is, so the line slides in with the page; it hides on the other pages, under a screen opened from the page, under the Insert menu and when the menu closes. Rebased onto main 544229a (9f0dd23, 974550e); the interface version is 30 now, after main's 29. Everything was run again on these commits on the same PC (RTX 4090, 621.24, Windows 11, a DualSense): the pictures, the frame rate (main 80.2 / 80.0 fps, this PR 80.5 / 80.6, notices off 80.9 / 80.75), the reconnect comparison and the pause menu; the run files under docs/tested/ are the new runs'. It builds whole for Windows and Linux.

The controller's name and battery now show on the game's own pause menu instead of the Insert menu: on the System page, under the controller picture at the foot of the "Basic Controls" panel (it was tried under the title first: crowded). host/oot_menu.c finds that page in front from the game's menu hooks and host/hos_wide_ui.c reads where the panel is, so the line slides in with the page; it hides on the other pages, under a screen opened from the page, under the Insert menu and when the menu closes. Rebased onto main 544229a (9f0dd23, 974550e); the interface version is 30 now, after main's 29. Everything was run again on these commits on the same PC (RTX 4090, 621.24, Windows 11, a DualSense): the pictures, the frame rate (main 80.2 / 80.0 fps, this PR 80.5 / 80.6, notices off 80.9 / 80.75), the reconnect comparison and the pause menu; the run files under docs/tested/ are the new runs'. It builds whole for Windows and Linux.
lg changed title from WIP: feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects to feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects 2026-11-17 07:06:47 +00:00
TrashPanda left a comment

A controller's low battery, a disconnect and a connect show a short notice, and the pause menu's System page names the controller. I read head 974550ed. It applies onto current main. Unset, the notices are on. HOS_PAD_NOTICE=0 reads no battery and names no controller. The page is found from the menu hooks, and a pointer outside the guest window is not followed. MKWVK_API_VERSION goes from 29 to 30 for pad_notice and pad_status. #1034 and #1358 also take 30, so whichever lands second renumbers. The notice strings sit beside #1318 and #1349: keep all of them.

On Windows a DualSense showed each notice, and standing still stayed at about 80 fps. An Xbox controller, a Switch controller, a Linux DualSense, and the Deck's own controls are still open. The earlier farm ask was for an older commit and never started.

A controller's low battery, a disconnect and a connect show a short notice, and the pause menu's System page names the controller. I read head `974550ed`. It applies onto current main. Unset, the notices are on. `HOS_PAD_NOTICE=0` reads no battery and names no controller. The page is found from the menu hooks, and a pointer outside the guest window is not followed. `MKWVK_API_VERSION` goes from 29 to 30 for `pad_notice` and `pad_status`. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1034 and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1358 also take 30, so whichever lands second renumbers. The notice strings sit beside https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1318 and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1349: keep all of them. On Windows a DualSense showed each notice, and standing still stayed at about 80 fps. An Xbox controller, a Switch controller, a Linux DualSense, and the Deck's own controls are still open. The earlier farm ask was for an older commit and never started.
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: an in-game run on Windows 11, RTX 4090 (driver 621.24) with a DualSense over Bluetooth.
  • Nothing gets worse that I know of: not ticked: Risks names a per-frame menu read on the pause page, but no measurement covers that page. Measure that cost and state it in Risks, then tick it.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: an in-game run on Windows 11, RTX 4090 (driver 621.24) with a DualSense over Bluetooth. - *Nothing gets worse that I know of*: not ticked: Risks names a per-frame menu read on the pause page, but no measurement covers that page. Measure that cost and state it in Risks, then tick it.
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Failing after 9s
This pull request has changes conflicting with the target branch.
  • gpu/vk/vk_api.h
  • host/rx_backend.c
  • tests/test_audio_output_devices.py
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/controller-notices:lg-feat/controller-notices'
git switch 'lg-feat/controller-notices'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1092
No description provided.