feat(input): a Screenshot control saves a PNG of the game's picture, F12 and the Capture button by default #1709

Open
cuecuemoar wants to merge 4 commits from cuecuemoar/Longshot:feat/screenshot-button into main
Contributor

Summary

Longshot had no way for a player to take a screenshot, and the Capture button of a Switch controller did nothing. This adds a Screenshot control to the Controls page, F12 and the Capture button by default and changeable like any other control. One press writes a PNG of the game's picture at its own size, with the HUD and without the menu, to screenshots/Longshot_<date>_<time>.png in the game folder, and a notice at the top says where it went. Nothing else in the game changes: idle, the frame time is main's; while a picture a second is taken the median is 0.6 ms higher and no frame went over 25 ms at 2560x1440 and 3840x2160.

Read first: screenshot_tick and draw_shot_toast in gpu/vk/vk_menu.cpp (the trigger and the notice), shot_ask_native, nat_prepare and nat_warm in gpu/vk/vk_replay.cpp (the picture), host/nn_hid.c (the control and its rules), gpu/vk/screenshot_file.h.

  • Controls: HOS_KEY_SCREENSHOT after Sprint and HOS_PAD_MISC1 (SDL's MISC1: a Switch controller's Capture, an Xbox Series pad's Share) after the paddles, so saved pad_/key_ lines keep their places; MKWVK_API_VERSION 46. Screenshot is a gamepad-input peer of the Switch buttons and Sprint (pad_swaps): an input that is Screenshot's is no other control's, and choosing one another control has asks first, as everywhere on the page (hos_rebind_control). A mouse button is refused for it, in hos_bind and in hos_rebind_control; an options file from before it that gave F12 to another control leaves it without a key.
  • Steam: with SteamGameId or SteamAppId set, Screenshot starts with no key and no button (binding_defaults makes Reset give it none too, not run), because Steam takes F12 and the Capture button for its own pictures.
  • Trigger and notice: not while a binding waits for its input, a text field has the keyboard, before the first frame, or while the last picture is being written; the press that chooses a key is not a picture.
  • Picture: the control bridge's readback at the picture's own size (it was fixed at RX_VK_SHOT_W x RX_VK_SHOT_H). The player's readback has its own image and buffer, made by a thread in the first presents of a session, used once there and kept; the PNG is written from the mapped buffer on a thread of its own, so the present thread copies nothing.
  • Docs and tests: "Screenshots" in docs/user/graphics-and-controls.md, tests/test_screenshot_button.py, and the fixtures and pinned lines of 14 other checks that cut the control table, the menu and vk_api.h take the new names.

Fixes #712

Testing

Tested: on my PC (Windows 10 Pro 22H2, RTX 4090, driver 617.42, 2560x1440, a keyboard), in the game. The runs below were made on 274901a6 (this branch over main a2dc5385) and the hand checks again on 6b39c8f3 (over main 0e32bc10); the head, 67b874dc, differs from 6b39c8f3 by one sentence of docs/user/graphics-and-controls.md, and from 274901a6 by main's 18 commits since (Threaded rendering's Auto from 4 cores, Streamline presentation, ...), the API version (45 to 46) and one help text.

  • F12 made one valid PNG per press: 178 presses in three 2560x1440 runs made 178 PNGs (11,061,548 bytes each, 2560x1440), and at 3840x2160 89 presses made 47 PNGs (24,887,323 bytes each, 3840x2160; a press while the last picture is being written makes none, 1 to 2 s at 4K). On the head's build 60 of 60 at 2560x1440.
  • By hand, through the menu, on 274901a6 (the Controls page, the question about C and the picture with the menu open again on 6b39c8f3): the Controls page lists Screenshot last, after Toggle HUD and before Reset to defaults, with Capture, None and F12 and its help (on main the last row is Toggle HUD). Bound to F9 it is saved as key_screenshot=120,0, and the press that chose F9 made no picture (226 files before and after); F12 then made nothing and F9 made one, with the Insert menu open and with it closed. Giving it C, which the Right stick press has, asks "C is already bound to Right stick press. Remove that assignment and bind it to Screenshot?"; Cancel left both as they were (key_rs=67,0, key_screenshot=120,0). Its Reset button restored pad_screenshot=21 and key_screenshot=123,0. A burst of 5 presses in 0.5 s made 1 file.
  • A press with the Insert menu open (the Controls tab showing, the notice over it): one 2560x1440 PNG with the HUD and with neither the menu nor the notice, looked at.
  • Steam's defaults, without Steam: started with SteamAppId=480 and no options file the Controls page shows Screenshot as None, None, None, the file has pad_screenshot=-1 and key_screenshot=0,0, and F12 made no picture (229 files before and after); without it pad_screenshot=21 (Capture) and key_screenshot=123,0 (F12).
  • Game-free: tests/test_screenshot_button.py (the file name, the press, the binding table's rules and defaults, the Steam defaults, the options file, screenshot_tick and its notice against stubs, the wiring, and that the readback is not made on the render thread) fails on main and passes here.
  • Linux (WSL, Ubuntu 22.04, clang): the renderer builds, host/nn_hid.c and host/pad_sdl.c compile with the same warnings as main (63 and 0), nothing linked, the game not run. tests/run_all.py --strict on 6b39c8f3 against main 0e32bc10: 922 passed and 18 failed on this branch, 921 and 18 on main, the same 18 files: nx2/test_coop_spirv.py, test_cpp_preflight, test_crash_record, test_dev_packs, test_dev_update, test_dlss_actor, test_fsr3_math, test_fsr3_shaders, test_fsr3fi_hud_layer, test_fsr3fi_hudless_colour, test_late_fix_shaders, test_mesh_unreachable_outputs, test_obj_cache_size, test_pipeline_state_computes, test_prof_clock, test_reactive_mask, test_saveload_warm_cache, test_wmma16_spirv_val. The checks that read the docs pass on the head.

A crash that is not this PR's: in 31 launches of the game on this PC, 1 of 18 on this branch and 1 of 13 on main (a2dc5385) crashed 25 to 30 s after the save loaded (0xc0000005 in the game's code, the same fault address longshot.exe+0x1e33b032 and the same guest backtrace starting at 0x83331040 on both, no press involved). The PR run it hit was run again; no issue about it was found on the forge.

Still to test:

  • Windows, a Switch Pro Controller or Joy-Con: press Capture in the game, expecting one PNG in screenshots/ and the notice (by hand, or @Beanstalk windows, a Switch controller: press the Capture button in the game and check a PNG is written to screenshots/)
  • Linux, any GPU: press F12 in the game, expecting the same, since the trigger takes another path there (@Beanstalk linux, press F12 in the game, a PNG in screenshots/)
  • Windows, an AMD GPU: take a screenshot a second for 20 s, expecting no frame over 25 ms (@Beanstalk windows amd, take screenshots with F12 and compare frame time)
  • Steam (Windows or the Deck): start the game from Steam, expecting Screenshot's key and button empty and Steam's own F12 picture the only one (by hand)

Not run at all: a controller of any kind (so a gamepad input that another control has, in the rebind dialog), Reset to defaults under Steam's environment, the DualSense's microphone button (SDL's MISC1, a picture by default), HDR, frame generation on.

Measurements

Verdict: idle, this PR's frame time is main's (median 9.12 ms against 9.12 at 2560x1440 and 9.23 against 9.21 at 3840x2160; p99 +0.14 and +0.23 ms; no frame over 25 ms). While a picture is taken once a second the median is 0.63 ms (7%) higher at 2560x1440 (9.77 against 9.14, main ignoring F12) and 0.62 ms at 3840x2160, and no frame in 18 press phases went over 25 ms (the worst of them 17.8 ms). The extra shows only while pictures are being taken; it was not separated into the notice's overlay pass and the picture's own copy. main had one frame over 25 ms in an idle phase at each size (40.6 ms and 35.8 ms), the PR none.

Setup: Windows 10 Pro 22H2 (19045), RTX 4090 24 GB, driver 617.42, Core i9-13900K, 32 GB; a copied save, adult Link standing in the Lost Woods; RX_VK_FRAME_TRACE=1, HOS_FPS_MAX=1000 (about 110 fps), Output resolution 2560x1440 and, in a second set, 3840x2160, Render resolution 100%, Upscaler Game's own, Frame generation Off, a job-queue timing slot. main a2dc5385 and the PR (274901a6) as dev.py packs packs over one base, a warm-up run of each, then interleaved runs: main, PR, main, PR, main, PR at 2560x1440 (the third PR run crashed, see Testing, and was run again after the third main run), main, PR, main, PR at 3840x2160. Each: 800 frames of warm-up, then 4 rounds (3 at 4K) of 1,500 frames with no press and 1,500 frames with F12 once a second (14 or 15 presses; main ignores F12), F12 sent only while the game's window was the foreground one. The table is the median over the phases of each phase's statistic from longshot_frames.csv.

2560x1440, frame time in ms (12 phases a column, 18,000 frames):

Before, no press: main @ a2dc5385 Before, F12 ignored: main @ a2dc5385 After, no press: this PR @ 274901a6 After, F12 once a second: this PR @ 274901a6
median 9.12 9.14 9.12 9.77
p99 11.61 11.54 11.75 12.40
p99.9 16.06 14.19 15.89 14.90
worst frame (median of the phases) 16.96 15.68 16.13 15.89
worst frame (of all phases) 40.57 24.46 20.34 17.61
frames over 25 ms 1 0 0 0

3840x2160 (6 phases a column, 9,000 frames; the game is not GPU-bound here: the same frame time as at 1440p):

Before, no press: main @ a2dc5385 Before, F12 ignored: main @ a2dc5385 After, no press: this PR @ 274901a6 After, F12 once a second: this PR @ 274901a6
median 9.21 9.20 9.23 9.82
p99 11.31 11.23 11.54 12.55
p99.9 16.39 13.49 13.94 15.77
worst frame (median of the phases) 17.75 15.86 16.23 17.00
worst frame (of all phases) 35.80 20.38 20.97 17.78
frames over 25 ms 1 0 0 0

The first press of a session, which cost one frame of 120 to 210 ms on this branch's earlier commits (the first use of the new image and buffer), now falls in the first presents instead (nat_warm): in the three 2560x1440 PR runs above the first press phase's worst frame is 14.6 to 16.9 ms, and 14.7 and 17.3 ms in the two at 4K. The player's readback is kept for the session (image and buffer, 4 bytes a pixel each: 29.5 MB at 2560x1440 and 66 MB at 3840x2160).

The head's build, once: this PR @ 6b39c8f3 over main 0e32bc10, 2560x1440, 4 rounds as above, no main beside it (the numbers are not an A/B): no press median 9.12, p99 11.24, p99.9 13.73, worst 18.62; F12 once a second median 9.73, p99 12.56, p99.9 15.88, worst 24.76 ms in one phase, no frame over 25 ms; 60 presses made 60 PNGs.

Log lines: longshot v3.0.0-208-ga2dc5385 (source 63363428) and longshot v3.0.0-212-g274901a6 (source b6e279e1); each press vk: present <n> written to ...Longshot_<date>_<time>.png (a screenshot).

Screenshots

All 1280x720, the game window only, the same spot (adult Link, Lost Woods), taken by me.

Before: main @ a2dc5385, the Controls page (no Screenshot row; the last control is Toggle HUD):

Before: main @ a2dc5385, the Controls page

After: this PR @ 6b39c8f3, the Controls page with the Screenshot row selected (Capture, None, F12) and its help:

After: this PR @ 6b39c8f3, the Controls page with the Screenshot row

After: this PR @ 6b39c8f3, the notice just after F12 (it is not in the saved picture):

After: this PR @ 6b39c8f3, the notice after F12

After: this PR @ 6b39c8f3, giving Screenshot a key another control has (C, the right stick press) asks first:

After: this PR @ 6b39c8f3, the binding already in use

After: this PR @ 6b39c8f3, the file F12 wrote with the Insert menu open (the whole 2560x1440 PNG as saved, 11 MB: the HUD, no menu, no notice):

After: this PR @ 6b39c8f3, the saved Longshot_2026-11-22_22-58-21.png

Risks

  • A new cost while it is used: the median frame time is about 0.6 ms (7%) higher while pictures are being taken, while the notice shows and the picture is copied, measured on a 4090; a slower GPU may show it more, which is untested.
  • Memory: the player's readback is kept for the session: 30 MB at 2560x1440 and 66 MB at 3840x2160 of image and buffer, of the 9.8 GB the game has. It is made at the start of every session, by everyone, whether or not they take a picture.
  • One picture at a time: at 4K a PNG takes 1 to 2 s to write (the project's PNG writer does not compress), and a press meanwhile makes no picture and shows no message. Files are about 11 MB at 2560x1440 and 25 MB at 4K, and nothing limits how many pile up in screenshots/.
  • The shared control table grew by one row: an options file that gave F12 to another control leaves Screenshot without a key (logged), and Reset to defaults gives it back its own (none under Steam).
  • Other overlays and Steam: outside Steam F12 may also open another overlay's own screenshot (GeForce, Discord, Windows); inside Steam Screenshot starts empty on purpose.
  • A DualSense's microphone Mute button, SDL's MISC1 too, takes a picture by default (the issue says Share; on a DualSense that is the Create button, which SDL gives as Back).
  • The picture is the game's frame: with an upscaler or Render resolution under 100% it is the game's picture at the size it is drawn, not the window's.

Turning it off: unbind Screenshot's key and button on the Controls page (Delete), or revert the commit; the readback is still made at the start of a session. Compatibility: MKWVK_API_VERSION is 46 (a host and a renderer built from other commits are refused as before; a renderer given an older host ignores the control). longshot_options.ini gains pad_screenshot and key_screenshot lines; older files load as before, and older builds ignore them. No shader or pipeline cache changes.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (tests/run_all.py --strict on Linux: the same 18 files fail on main and here, named in Testing.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • MKWVK_API_VERSION bumped (MkwVkHost or MkwVkRenderer in gpu/vk/vk_api.h changed).
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: built and run. Linux, WSL: the renderer builds and host/nn_hid.c and host/pad_sdl.c compile, nothing linked, the game not run there.)
  • Screenshots of the same spot on main and here, for a change that shows on screen.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VxeaZhiNvC7bfnojvd99Rh

## Summary Longshot had no way for a player to take a screenshot, and the Capture button of a Switch controller did nothing. This adds a **Screenshot** control to the Controls page, F12 and the Capture button by default and changeable like any other control. One press writes a PNG of the game's picture at its own size, with the HUD and without the menu, to `screenshots/Longshot_<date>_<time>.png` in the game folder, and a notice at the top says where it went. Nothing else in the game changes: idle, the frame time is `main`'s; while a picture a second is taken the median is 0.6 ms higher and no frame went over 25 ms at 2560x1440 and 3840x2160. Read first: `screenshot_tick` and `draw_shot_toast` in `gpu/vk/vk_menu.cpp` (the trigger and the notice), `shot_ask_native`, `nat_prepare` and `nat_warm` in `gpu/vk/vk_replay.cpp` (the picture), `host/nn_hid.c` (the control and its rules), `gpu/vk/screenshot_file.h`. - **Controls:** `HOS_KEY_SCREENSHOT` after Sprint and `HOS_PAD_MISC1` (SDL's `MISC1`: a Switch controller's Capture, an Xbox Series pad's Share) after the paddles, so saved `pad_`/`key_` lines keep their places; `MKWVK_API_VERSION` 46. Screenshot is a gamepad-input peer of the Switch buttons and Sprint (`pad_swaps`): an input that is Screenshot's is no other control's, and choosing one another control has asks first, as everywhere on the page (`hos_rebind_control`). A mouse button is refused for it, in `hos_bind` and in `hos_rebind_control`; an options file from before it that gave F12 to another control leaves it without a key. - **Steam:** with `SteamGameId` or `SteamAppId` set, Screenshot starts with no key and no button (`binding_defaults` makes Reset give it none too, not run), because Steam takes F12 and the Capture button for its own pictures. - **Trigger and notice:** not while a binding waits for its input, a text field has the keyboard, before the first frame, or while the last picture is being written; the press that chooses a key is not a picture. - **Picture:** the control bridge's readback at the picture's own size (it was fixed at `RX_VK_SHOT_W` x `RX_VK_SHOT_H`). The player's readback has its own image and buffer, made by a thread in the first presents of a session, used once there and kept; the PNG is written from the mapped buffer on a thread of its own, so the present thread copies nothing. - **Docs and tests:** "Screenshots" in `docs/user/graphics-and-controls.md`, `tests/test_screenshot_button.py`, and the fixtures and pinned lines of 14 other checks that cut the control table, the menu and `vk_api.h` take the new names. Fixes #712 ## Testing **Tested:** on my PC (Windows 10 Pro 22H2, RTX 4090, driver 617.42, 2560x1440, a keyboard), in the game. The runs below were made on `274901a6` (this branch over `main` a2dc5385) and the hand checks again on `6b39c8f3` (over `main` 0e32bc10); the head, `67b874dc`, differs from `6b39c8f3` by one sentence of `docs/user/graphics-and-controls.md`, and from `274901a6` by `main`'s 18 commits since (Threaded rendering's Auto from 4 cores, Streamline presentation, ...), the API version (45 to 46) and one help text. - F12 made one valid PNG per press: 178 presses in three 2560x1440 runs made 178 PNGs (11,061,548 bytes each, 2560x1440), and at 3840x2160 89 presses made 47 PNGs (24,887,323 bytes each, 3840x2160; a press while the last picture is being written makes none, 1 to 2 s at 4K). On the head's build 60 of 60 at 2560x1440. - By hand, through the menu, on `274901a6` (the Controls page, the question about C and the picture with the menu open again on `6b39c8f3`): the Controls page lists **Screenshot** last, after Toggle HUD and before Reset to defaults, with Capture, None and F12 and its help (on `main` the last row is Toggle HUD). Bound to F9 it is saved as `key_screenshot=120,0`, and the press that chose F9 made no picture (226 files before and after); F12 then made nothing and F9 made one, with the Insert menu open and with it closed. Giving it C, which the Right stick press has, asks "C is already bound to Right stick press. Remove that assignment and bind it to Screenshot?"; Cancel left both as they were (`key_rs=67,0`, `key_screenshot=120,0`). Its Reset button restored `pad_screenshot=21` and `key_screenshot=123,0`. A burst of 5 presses in 0.5 s made 1 file. - A press with the Insert menu open (the Controls tab showing, the notice over it): one 2560x1440 PNG with the HUD and with neither the menu nor the notice, looked at. - Steam's defaults, without Steam: started with `SteamAppId=480` and no options file the Controls page shows Screenshot as None, None, None, the file has `pad_screenshot=-1` and `key_screenshot=0,0`, and F12 made no picture (229 files before and after); without it `pad_screenshot=21` (Capture) and `key_screenshot=123,0` (F12). - Game-free: `tests/test_screenshot_button.py` (the file name, the press, the binding table's rules and defaults, the Steam defaults, the options file, `screenshot_tick` and its notice against stubs, the wiring, and that the readback is not made on the render thread) fails on `main` and passes here. - Linux (WSL, Ubuntu 22.04, clang): the renderer builds, `host/nn_hid.c` and `host/pad_sdl.c` compile with the same warnings as `main` (63 and 0), nothing linked, the game not run. `tests/run_all.py --strict` on `6b39c8f3` against `main` 0e32bc10: 922 passed and 18 failed on this branch, 921 and 18 on `main`, the same 18 files: `nx2/test_coop_spirv.py`, `test_cpp_preflight`, `test_crash_record`, `test_dev_packs`, `test_dev_update`, `test_dlss_actor`, `test_fsr3_math`, `test_fsr3_shaders`, `test_fsr3fi_hud_layer`, `test_fsr3fi_hudless_colour`, `test_late_fix_shaders`, `test_mesh_unreachable_outputs`, `test_obj_cache_size`, `test_pipeline_state_computes`, `test_prof_clock`, `test_reactive_mask`, `test_saveload_warm_cache`, `test_wmma16_spirv_val`. The checks that read the docs pass on the head. A crash that is not this PR's: in 31 launches of the game on this PC, 1 of 18 on this branch and 1 of 13 on `main` (a2dc5385) crashed 25 to 30 s after the save loaded (`0xc0000005` in the game's code, the same fault address `longshot.exe+0x1e33b032` and the same guest backtrace starting at `0x83331040` on both, no press involved). The PR run it hit was run again; no issue about it was found on the forge. **Still to test:** - Windows, a Switch Pro Controller or Joy-Con: press Capture in the game, expecting one PNG in `screenshots/` and the notice (by hand, or `@Beanstalk windows, a Switch controller: press the Capture button in the game and check a PNG is written to screenshots/`) - Linux, any GPU: press F12 in the game, expecting the same, since the trigger takes another path there (`@Beanstalk linux, press F12 in the game, a PNG in screenshots/`) - Windows, an AMD GPU: take a screenshot a second for 20 s, expecting no frame over 25 ms (`@Beanstalk windows amd, take screenshots with F12 and compare frame time`) - Steam (Windows or the Deck): start the game from Steam, expecting Screenshot's key and button empty and Steam's own F12 picture the only one (by hand) Not run at all: a controller of any kind (so a gamepad input that another control has, in the rebind dialog), Reset to defaults under Steam's environment, the DualSense's microphone button (SDL's `MISC1`, a picture by default), HDR, frame generation on. ## Measurements **Verdict:** idle, this PR's frame time is `main`'s (median 9.12 ms against 9.12 at 2560x1440 and 9.23 against 9.21 at 3840x2160; p99 +0.14 and +0.23 ms; no frame over 25 ms). While a picture is taken once a second the median is 0.63 ms (7%) higher at 2560x1440 (9.77 against 9.14, `main` ignoring F12) and 0.62 ms at 3840x2160, and no frame in 18 press phases went over 25 ms (the worst of them 17.8 ms). The extra shows only while pictures are being taken; it was not separated into the notice's overlay pass and the picture's own copy. `main` had one frame over 25 ms in an idle phase at each size (40.6 ms and 35.8 ms), the PR none. Setup: Windows 10 Pro 22H2 (19045), RTX 4090 24 GB, driver 617.42, Core i9-13900K, 32 GB; a copied save, adult Link standing in the Lost Woods; `RX_VK_FRAME_TRACE=1`, `HOS_FPS_MAX=1000` (about 110 fps), Output resolution 2560x1440 and, in a second set, 3840x2160, Render resolution 100%, Upscaler Game's own, Frame generation Off, a job-queue `timing` slot. `main` a2dc5385 and the PR (274901a6) as `dev.py packs` packs over one base, a warm-up run of each, then interleaved runs: main, PR, main, PR, main, PR at 2560x1440 (the third PR run crashed, see Testing, and was run again after the third `main` run), main, PR, main, PR at 3840x2160. Each: 800 frames of warm-up, then 4 rounds (3 at 4K) of 1,500 frames with no press and 1,500 frames with F12 once a second (14 or 15 presses; `main` ignores F12), F12 sent only while the game's window was the foreground one. The table is the median over the phases of each phase's statistic from `longshot_frames.csv`. 2560x1440, frame time in ms (12 phases a column, 18,000 frames): | | Before, no press: main @ a2dc5385 | Before, F12 ignored: main @ a2dc5385 | After, no press: this PR @ 274901a6 | After, F12 once a second: this PR @ 274901a6 | |---|---|---|---|---| | median | 9.12 | 9.14 | 9.12 | 9.77 | | p99 | 11.61 | 11.54 | 11.75 | 12.40 | | p99.9 | 16.06 | 14.19 | 15.89 | 14.90 | | worst frame (median of the phases) | 16.96 | 15.68 | 16.13 | 15.89 | | worst frame (of all phases) | 40.57 | 24.46 | 20.34 | 17.61 | | frames over 25 ms | 1 | 0 | 0 | 0 | 3840x2160 (6 phases a column, 9,000 frames; the game is not GPU-bound here: the same frame time as at 1440p): | | Before, no press: main @ a2dc5385 | Before, F12 ignored: main @ a2dc5385 | After, no press: this PR @ 274901a6 | After, F12 once a second: this PR @ 274901a6 | |---|---|---|---|---| | median | 9.21 | 9.20 | 9.23 | 9.82 | | p99 | 11.31 | 11.23 | 11.54 | 12.55 | | p99.9 | 16.39 | 13.49 | 13.94 | 15.77 | | worst frame (median of the phases) | 17.75 | 15.86 | 16.23 | 17.00 | | worst frame (of all phases) | 35.80 | 20.38 | 20.97 | 17.78 | | frames over 25 ms | 1 | 0 | 0 | 0 | The first press of a session, which cost one frame of 120 to 210 ms on this branch's earlier commits (the first use of the new image and buffer), now falls in the first presents instead (`nat_warm`): in the three 2560x1440 PR runs above the first press phase's worst frame is 14.6 to 16.9 ms, and 14.7 and 17.3 ms in the two at 4K. The player's readback is kept for the session (image and buffer, 4 bytes a pixel each: 29.5 MB at 2560x1440 and 66 MB at 3840x2160). The head's build, once: this PR @ 6b39c8f3 over `main` 0e32bc10, 2560x1440, 4 rounds as above, no `main` beside it (the numbers are not an A/B): no press median 9.12, p99 11.24, p99.9 13.73, worst 18.62; F12 once a second median 9.73, p99 12.56, p99.9 15.88, worst 24.76 ms in one phase, no frame over 25 ms; 60 presses made 60 PNGs. Log lines: `longshot v3.0.0-208-ga2dc5385 (source 63363428)` and `longshot v3.0.0-212-g274901a6 (source b6e279e1)`; each press `vk: present <n> written to ...Longshot_<date>_<time>.png (a screenshot)`. ### Screenshots All 1280x720, the game window only, the same spot (adult Link, Lost Woods), taken by me. Before: `main` @ a2dc5385, the Controls page (no Screenshot row; the last control is Toggle HUD): ![Before: main @ a2dc5385, the Controls page](https://git.magicbean.dev/attachments/7baf6c4c-9a5f-4184-a4eb-f8cdae60aba9) After: this PR @ 6b39c8f3, the Controls page with the Screenshot row selected (Capture, None, F12) and its help: ![After: this PR @ 6b39c8f3, the Controls page with the Screenshot row](https://git.magicbean.dev/attachments/2a7276ce-6a4e-4360-aa10-a5cd259fc8c9) After: this PR @ 6b39c8f3, the notice just after F12 (it is not in the saved picture): ![After: this PR @ 6b39c8f3, the notice after F12](https://git.magicbean.dev/attachments/00b2f8b0-9ef6-4a6b-8a8a-55fd2d206e1b) After: this PR @ 6b39c8f3, giving Screenshot a key another control has (C, the right stick press) asks first: ![After: this PR @ 6b39c8f3, the binding already in use](https://git.magicbean.dev/attachments/fa4c5409-94e3-43d7-9a29-956477896b20) After: this PR @ 6b39c8f3, the file F12 wrote with the Insert menu open (the whole 2560x1440 PNG as saved, 11 MB: the HUD, no menu, no notice): ![After: this PR @ 6b39c8f3, the saved Longshot_2026-11-22_22-58-21.png](https://git.magicbean.dev/attachments/886075bb-0dd0-465d-ad93-af4bf8c82aef) ## Risks - **A new cost while it is used:** the median frame time is about 0.6 ms (7%) higher while pictures are being taken, while the notice shows and the picture is copied, measured on a 4090; a slower GPU may show it more, which is untested. - **Memory:** the player's readback is kept for the session: 30 MB at 2560x1440 and 66 MB at 3840x2160 of image and buffer, of the 9.8 GB the game has. It is made at the start of every session, by everyone, whether or not they take a picture. - **One picture at a time:** at 4K a PNG takes 1 to 2 s to write (the project's PNG writer does not compress), and a press meanwhile makes no picture and shows no message. Files are about 11 MB at 2560x1440 and 25 MB at 4K, and nothing limits how many pile up in `screenshots/`. - **The shared control table grew by one row:** an options file that gave F12 to another control leaves Screenshot without a key (logged), and Reset to defaults gives it back its own (none under Steam). - **Other overlays and Steam:** outside Steam F12 may also open another overlay's own screenshot (GeForce, Discord, Windows); inside Steam Screenshot starts empty on purpose. - **A DualSense's microphone Mute button,** SDL's `MISC1` too, takes a picture by default (the issue says Share; on a DualSense that is the Create button, which SDL gives as Back). - **The picture is the game's frame:** with an upscaler or Render resolution under 100% it is the game's picture at the size it is drawn, not the window's. **Turning it off:** unbind Screenshot's key and button on the Controls page (Delete), or revert the commit; the readback is still made at the start of a session. **Compatibility:** `MKWVK_API_VERSION` is 46 (a host and a renderer built from other commits are refused as before; a renderer given an older host ignores the control). `longshot_options.ini` gains `pad_screenshot` and `key_screenshot` lines; older files load as before, and older builds ignore them. No shader or pipeline cache changes. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). (`tests/run_all.py --strict` on Linux: the same 18 files fail on `main` and here, named in Testing.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] `MKWVK_API_VERSION` bumped (`MkwVkHost` or `MkwVkRenderer` in `gpu/vk/vk_api.h` changed). - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: built and run. Linux, WSL: the renderer builds and `host/nn_hid.c` and `host/pad_sdl.c` compile, nothing linked, the game not run there.) - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VxeaZhiNvC7bfnojvd99Rh
A new row on the Controls page, bindable on the keyboard (two keys) and on a gamepad (two inputs).
Pressing it writes the game's own frame, at its own size and with its HUD but without the Insert
menu or the FPS counter, to screenshots/Longshot_<date>_<time>.png in the game folder, and a toast
at the top says where. The picture reuses the renderer's readback (the control bridge's shot) at
the picture's size instead of RX_VK_SHOT_W x RX_VK_SHOT_H.

- HOS_KEY_SCREENSHOT after Walk, HOS_PAD_MISC1 (SDL's MISC1: the Capture button of a Switch
  controller, the Share button of an Xbox Series pad) after the paddles, so saved controls keep
  their places; MKWVK_API_VERSION 35.
- An input that is Screenshot's is no Switch button's: they trade places when one takes the
  other's, like the buttons among themselves, so a button that takes a picture never reaches the game.
- A mouse button is refused for it. An options file from before the control that gave F12 to
  another control leaves Screenshot without a key.
- Steam takes F12 and the Capture button for its own screenshots when it runs the game
  (SteamGameId / SteamAppId): Screenshot starts with neither there.
- Not while a binding waits for its input, a field has the keyboard or before the first frame, and
  one at a time. The press that chooses a key is not a picture.
- The player's shot has its own image and buffer, kept while it is used and let go after 30 s; the
  PNG is written from the mapped buffer on a thread of its own, so the present thread copies
  nothing (a first version that allocated, copied and freed on it cost the next frame 15 ms).

tests/test_screenshot_button.py fails on main (every part) and passes here; nine fixtures that
cut the binding table and the menu get the new names, and test_bug_report's blit check follows the
renamed image.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZk7YzdoyMsjiAMs7p8
docs(tested): the Screenshot control in the game: frame time with and without presses at 1440p and 4K, F12 and a rebound key (#712)
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
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
34a146d4d6
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZk7YzdoyMsjiAMs7p8
Author
Contributor

Tested in game: RTX 4090, driver 617.42, Windows 10 (19045), keyboard: F12 in the game's window (adult Link, Lost Woods) wrote a 2560x1440 PNG with the HUD and no menu, with the notice shown; frame time traced at 2560x1440 and 3840x2160 with a press a second: no frame over 25 ms (details in the description)

Tested in game: RTX 4090, driver 617.42, Windows 10 (19045), keyboard: F12 in the game's window (adult Link, Lost Woods) wrote a 2560x1440 PNG with the HUD and no menu, with the notice shown; frame time traced at 2560x1440 and 3840x2160 with a press a second: no frame over 25 ms (details in the description)
docs(tested): the Screenshot control against main, interleaved runs, idle and a press a second (#712)
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 4s
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
aa38014a83
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZk7YzdoyMsjiAMs7p8
Author
Contributor

Update at aa38014a: seven interleaved runs against main (the same PC, scene and settings): idle, this PR's frame time is main's (median 10.15 ms against 10.18, none over 25 ms), and with F12 pressed once a second the median is 0.4 ms higher and no frame went over 25 ms. The description now has the table, clean screenshots (the Controls page on main and here, the notice, the saved file) and a docs/tested row for the run. Still to run: the Capture button on a Switch controller, Linux and an AMD GPU (the Test Farm request follows).

Update at aa38014a: seven interleaved runs against main (the same PC, scene and settings): idle, this PR's frame time is main's (median 10.15 ms against 10.18, none over 25 ms), and with F12 pressed once a second the median is 0.4 ms higher and no frame went over 25 ms. The description now has the table, clean screenshots (the Controls page on main and here, the notice, the saved file) and a docs/tested row for the run. Still to run: the Capture button on a Switch controller, Linux and an AMD GPU (the Test Farm request follows).
Author
Contributor

@Beanstalk test the Screenshot control of this pull request (F12 writes a PNG of the game's picture into a screenshots folder in the game folder, and a "Screenshot saved" notice shows at the top of the window). On Linux, any GPU: start a game from a save, press F12 once in the game's window and check that one valid PNG is written to screenshots/ and the notice shows. On AMD, Windows and Linux: stand still in a scene, then compare frame time with F12 pressed once a second against none, against main on the same PC, expecting no frame over 25 ms and a median within about 0.5 ms; a press while the last picture is still being written makes no second picture, so at 4K only every other press writes a file.

@Beanstalk test the Screenshot control of this pull request (F12 writes a PNG of the game's picture into a screenshots folder in the game folder, and a "Screenshot saved" notice shows at the top of the window). On Linux, any GPU: start a game from a save, press F12 once in the game's window and check that one valid PNG is written to screenshots/ and the notice shows. On AMD, Windows and Linux: stand still in a scene, then compare frame time with F12 pressed once a second against none, against main on the same PC, expecting no frame over 25 ms and a median within about 0.5 ms; a press while the last picture is still being written makes no second picture, so at 4K only every other press writes a file.
Member

@cuecuemoar only members of BigBeans can start the farm.

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

@cuecuemoar only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `aa38014`, and the PR has changed since (`a07318c`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
cuecuemoar force-pushed feat/screenshot-button from aa38014a83
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 4s
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 a07318cf90
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
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-19 20:14:54 +00:00
Compare
Author
Contributor

Rebased onto main a433db32 (one conflict, in tests/test_menu_text_field.py: kept main's host stub and this PR's screenshot_tick stub). The commits are now 57c34612, 847a9421 and a07318cf (were 4f26f5c1, 34a146d4 and aa38014a). The Measurements section is unchanged: its numbers were taken on 4f26f5c1 over main 47430e81 and have not been measured again; the description says so.

Rebased onto main a433db32 (one conflict, in tests/test_menu_text_field.py: kept main's host stub and this PR's screenshot_tick stub). The commits are now 57c34612, 847a9421 and a07318cf (were 4f26f5c1, 34a146d4 and aa38014a). The Measurements section is unchanged: its numbers were taken on 4f26f5c1 over main 47430e81 and have not been measured again; the description says so.
Contributor

Claims check, no blame: where does this stand? Which test is still missing - the Capture button on a Switch controller, Linux, or an AMD GPU? The Test Farm request above was for aa38014 and no longer matches the head, so it needs a fresh @Beanstalk comment; meanwhile I can run Linux + an AMD GPU on the current head and report what the PR asks for (one PNG written on F12, and frame time with a press a second against main) - no code hand-over implied. One line keeps it, or one line releases it; after 2026-11-29 it is open to a fresh claim.

Claims check, no blame: where does this stand? Which test is still missing - the Capture button on a Switch controller, Linux, or an AMD GPU? The Test Farm request above was for aa38014 and no longer matches the head, so it needs a fresh @Beanstalk comment; meanwhile I can run Linux + an AMD GPU on the current head and report what the PR asks for (one PNG written on F12, and frame time with a press a second against main) - no code hand-over implied. One line keeps it, or one line releases it; after 2026-11-29 it is open to a fresh claim.
Member

@dazemc only members of BigBeans can start the farm.

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

@dazemc only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `a07318c`, and the PR has changed since (`6b39c8f`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Contributor

Correction: the Beanstalk mention in my comment above was unintended - no farm run is requested on my account, and nobody should approve one for it. I meant only that the earlier request no longer matches the head. The offer is a hand run on Linux + an AMD GPU, reported here.

Correction: the Beanstalk mention in my comment above was unintended - no farm run is requested on my account, and nobody should approve one for it. I meant only that the earlier request no longer matches the head. The offer is a hand run on Linux + an AMD GPU, reported here.
cuecuemoar force-pushed feat/screenshot-button from a07318cf90
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
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 6b39c8f3b8
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 5s
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
CI / Website build and checks (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-23 05:56:58 +00:00
Compare
cuecuemoar force-pushed feat/screenshot-button from 6b39c8f3b8
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 5s
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
CI / Website build and checks (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 67b874dcb9
Some checks are pending
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
CI / Website build and checks (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) Successful in 7s
2026-11-23 05:59:40 +00:00
Compare
Author
Contributor

Rebased onto main 0e32bc10 (4 commits, head 67b874dc) and measured again in the game; the description is rewritten for it.

  • Rebase: main had added Sprint, Toggle HUD, hos_rebind_control (rebinding asks before taking an input) and binding_defaults; Screenshot now sits after Sprint, is a pad_swaps peer, and its Steam and mouse rules are in the new code paths too. MKWVK_API_VERSION 46. Five checks that pin lines of the control table, the menu or vk_api.h were updated, not weakened. The Controls help text and the user docs no longer say a taken input "trades places".
  • Linux: renderer builds, host/nn_hid.c and host/pad_sdl.c compile with main's warnings, run_all.py --strict fails the same 18 files here and on main.
  • In the game (Windows, RTX 4090): 1440p and 4K against main as before, interleaved (idle equal; +0.6 ms median while pictures are taken; no frame over 25 ms in 18 press phases), the hand checks again (F12, F9 rebind, the question about a taken key, Reset, a burst, the menu open, Steam's environment), and the head's build once.
  • A crash that is on main too: the game crashed 25 to 30 s after loading once in 18 launches of this branch and once in 13 of main, with the same fault address and guest backtrace; not this PR's.
  • Still open: the pictures for the description (kept on my PC), and everything under Still to test.
Rebased onto `main` 0e32bc10 (4 commits, head 67b874dc) and measured again in the game; the description is rewritten for it. - **Rebase:** `main` had added Sprint, Toggle HUD, `hos_rebind_control` (rebinding asks before taking an input) and `binding_defaults`; Screenshot now sits after Sprint, is a `pad_swaps` peer, and its Steam and mouse rules are in the new code paths too. `MKWVK_API_VERSION` 46. Five checks that pin lines of the control table, the menu or `vk_api.h` were updated, not weakened. The Controls help text and the user docs no longer say a taken input "trades places". - **Linux:** renderer builds, `host/nn_hid.c` and `host/pad_sdl.c` compile with `main`'s warnings, `run_all.py --strict` fails the same 18 files here and on `main`. - **In the game (Windows, RTX 4090):** 1440p and 4K against `main` as before, interleaved (idle equal; +0.6 ms median while pictures are taken; no frame over 25 ms in 18 press phases), the hand checks again (F12, F9 rebind, the question about a taken key, Reset, a burst, the menu open, Steam's environment), and the head's build once. - **A crash that is on `main` too:** the game crashed 25 to 30 s after loading once in 18 launches of this branch and once in 13 of `main`, with the same fault address and guest backtrace; not this PR's. - **Still open:** the pictures for the description (kept on my PC), and everything under Still to test.
Author
Contributor

Pictures for the description. All 1280x720, the game window only, the same spot (adult Link, Lost Woods), taken by me.

Before: main @ a2dc5385, the Controls page (no Screenshot row; the last control is Toggle HUD):

Before: main @ a2dc5385, the Controls page

After: this PR @ 6b39c8f3, the Controls page with the Screenshot row selected (Capture, None, F12) and its help:

After: this PR @ 6b39c8f3, the Controls page with the Screenshot row

After: this PR @ 6b39c8f3, the notice just after F12 (it is not in the saved picture):

After: this PR @ 6b39c8f3, the notice after F12

After: this PR @ 6b39c8f3, giving Screenshot a key another control has (C, the right stick press) asks first:

After: this PR @ 6b39c8f3, the binding already in use

After: this PR @ 6b39c8f3, the file F12 wrote with the Insert menu open (the whole 2560x1440 PNG as saved, 11 MB: the HUD, no menu, no notice):

After: this PR @ 6b39c8f3, the saved Longshot_2026-11-22_22-58-21.png

Pictures for the description. All 1280x720, the game window only, the same spot (adult Link, Lost Woods), taken by me. Before: `main` @ a2dc5385, the Controls page (no Screenshot row; the last control is Toggle HUD): ![Before: main @ a2dc5385, the Controls page](https://git.magicbean.dev/attachments/7baf6c4c-9a5f-4184-a4eb-f8cdae60aba9) After: this PR @ 6b39c8f3, the Controls page with the Screenshot row selected (Capture, None, F12) and its help: ![After: this PR @ 6b39c8f3, the Controls page with the Screenshot row](https://git.magicbean.dev/attachments/2a7276ce-6a4e-4360-aa10-a5cd259fc8c9) After: this PR @ 6b39c8f3, the notice just after F12 (it is not in the saved picture): ![After: this PR @ 6b39c8f3, the notice after F12](https://git.magicbean.dev/attachments/00b2f8b0-9ef6-4a6b-8a8a-55fd2d206e1b) After: this PR @ 6b39c8f3, giving Screenshot a key another control has (C, the right stick press) asks first: ![After: this PR @ 6b39c8f3, the binding already in use](https://git.magicbean.dev/attachments/fa4c5409-94e3-43d7-9a29-956477896b20) After: this PR @ 6b39c8f3, the file F12 wrote with the Insert menu open (the whole 2560x1440 PNG as saved, 11 MB: the HUD, no menu, no notice): ![After: this PR @ 6b39c8f3, the saved Longshot_2026-11-22_22-58-21.png](https://git.magicbean.dev/attachments/886075bb-0dd0-465d-ad93-af4bf8c82aef)
Author
Contributor

The pictures of the description are attached now (the comment above): the Controls page on main and here, the notice, the binding-in-use question and a saved file with the menu open. The Screenshots box is ticked; Still to test and Ready to merge are as before.

The pictures of the description are attached now (the comment above): the Controls page on `main` and here, the notice, the binding-in-use question and a saved file with the menu open. The Screenshots box is ticked; Still to test and Ready to merge are as before.
cuecuemoar changed title from WIP: feat(input): a Screenshot control saves a PNG of the game's picture, F12 and the Capture button by default to feat(input): a Screenshot control saves a PNG of the game's picture, F12 and the Capture button by default 2026-11-23 15:48:37 +00:00
Some checks are pending
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
CI / Website build and checks (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) Successful in 7s
This pull request has changes conflicting with the target branch.
  • host/nn_hid.c
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/screenshot-button:cuecuemoar-feat/screenshot-button'
git switch 'cuecuemoar-feat/screenshot-button'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!1709
No description provided.