fix(host): on/off switches read true, yes and on as on, by the one rule #980

Open
zeldaootr wants to merge 1 commit from zeldaootr/Longshot:host-env-on-switches into main
Contributor

Type: fix · Risk: medium · Tested on: Linux, Steam Deck (RADV VANGOGH) · Needs: Windows, any GPU

Why

HOS_FULLSCREEN=true did nothing, and HOS_AUDIO=true muted the game. The switch reference says an on/off switch is on for any value but 0, false, off or no, yet 26 switches in host/ were still read with atoi, which takes true, yes and on for 0. They follow the one rule now. No issue in the tracker reports it; #62 lists the switches and does not change how they are read.

How to reproduce

Seen on: Linux and a Steam Deck (any OS: the reads are the same code)
Settings and switches: HOS_AUDIO=true, or HOS_FULLSCREEN=true with a window
Steps: start the game with the switch set to the word
Expected: sound as without the switch (it is on by default); fullscreen
Actual: on main, HOS_AUDIO=true opens no sound device (atoi("true") is 0, read as "off"), and HOS_FULLSCREEN=true starts in a window

What changed

Every on/off switch of host/ is read by the rule the switch reference states, and a check keeps it so.

  • gpu/vk/compat/longshot_env.h: env_on_or(name, def) (new): unset, the default; set, as env_on reads it (set and empty is off).
  • host/: 26 switches read env_on, env_on_or or env_value_off instead of atoi (the table below): hos_thread.c, hos_main.c, display.c, posix/display_sdl.c, nn_vi.c, nn_audio.c, nn_hid.c, nn_applet.c, nn_video.c, nvn_native.c, discord_rpc.c, oot_heap_retry.c, oot_voice.c, hos_wide_ui.c, mouse_native.c, texts.c.
  • gpu/vk/vk_menu.cpp: its copy of the HOS_HANDHELD rule (a new install's Output resolution) reads the value as host/nn_applet.c does, so the two still agree.
  • gpu/vk/vk_replay.cpp: RX_VK_PRESENT_AFTER_SIGNAL reads env_on_or(name, gate_on()), the same answer as before in one call. tests/test_env_on.py fails on main over this line (#622 settles it in the check instead: whichever lands second rebases).
  • tests/test_env_on.py: checks env_on_or; lets vk_menu.cpp ask whether HOS_FULLSCREEN is set at all, by name; and names any switch of host/ read with atoi, as atoi(getenv(name)) or as atoi(e) within a few lines of e = getenv(name), that is not in its list of numbers. (It caught HOS_VOICE_OPTION_FOLLOW, HOS_TEXTS and a second read of HOS_AUDIO, which main gained while this was open.) tests/test_hud_layout.py and tests/test_mods_size_table.py compile copies of changed files and bring the rule's header, as does main's new tests/test_frame_rate_cap_30.py, whose fake getenv the rule now reads through (it counts one read of HOS_MOVIE_PACE, where the old line read it twice when set).
  • Eight checks that paste the changed code put the rule's header before it (-include, as test_frame_rate_cap_step does): test_movie_frame_count, test_oot_heap_retry, test_output_resolution, test_screensaver, test_vcore_escape, test_motion_background, test_wide_ui, test_oot_voice_option; test_threaded_rendering pins the new line.
  • docs/development.md: the switch reference says how a switch that is on by default reads.

Left as they are: switches that take a number (HOS_CORES, HOS_COND_RECORD, HOS_FPS_TARGET, ...), and gpu/vk's on/off switches still read with atoi (RX_VK_FRAME_GATE, RX_VK_FRAMEGEN, ...): a follow-up.

Measurements

Verdict: nothing to measure: each switch is read once into a static, no default changes, and no per-frame path reads differently. It passes: the words were seen to take effect in the game on a Steam Deck (Testing).

Flags and settings

26 switches change how they read a word; none is added, renamed or given another default. For each: 0, false, off, no, unset and every number but 0 (negative ones too) read as before. A value atoi took for 0 that is not one of those words (true, yes, on, 00, 0x1) now means on.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
HOS_FULLSCREEN, HOS_PRESENT_POLL, HOS_GAME_INTERVAL, HOS_INPUT_FRAME_CLOCK, HOS_NO_RENDERER_WAIT, HOS_NVN_HOLD, HOS_POWER_THROTTLING, HOS_RESERVE_CORE, HOS_VIDEO_RGBA on/off, off unless set true, yes, on: off true, yes, on: on the word a person types turns the switch on untested in the game (none was set in the Deck runs) as before: off unless testing
HOS_AUDIO, HOS_VCORES, HOS_CACHE_CORES, HOS_DISCORD, HOS_FPS_MOVIE, HOS_FPS_STEP, HOS_MOVIE_PACE, HOS_KEEP_DISPLAY, HOS_GPU_ALLOC_RETRY, HOS_VOICE_OPTION_FOLLOW, HOS_TEXTS, HOS_WIDE_UI (still on when set and empty) on/off, on unless turned off true, yes, on: off true, yes, on: on (the default) HOS_AUDIO=true no longer mutes the game on the Deck: HOS_AUDIO=off, HOS_DISCORD=no off, and HOS_VCORES=yes, HOS_FPS_STEP=on, HOS_WIDE_UI=true, HOS_CACHE_CORES=on, HOS_KEEP_DISPLAY=true on; the rest untested in the game as before: on
HOS_HANDHELD, HOS_GUEST_MEMFD, HOS_PRESENT_NOWAIT, HOS_INPUT_BACKGROUND, HOS_MOUSE_NATIVE on/off over another answer (the options file, what the system can do, the renderer, a menu row) true, yes, on: off true, yes, on: on as above on the Deck: HOS_INPUT_BACKGROUND=yes ran; the rest untested in the game as before
RX_VK_PRESENT_AFTER_SIGNAL on/off over the frame gate by the rule by the rule none: one call for two — as before

Documented in docs/development.md, "Switches for testing and debugging" (the rule's paragraph).

Testing

Tested:

  • In the game, on Steam Deck OLED, SteamOS 3.9.5 (20261023.100), AMD Custom GPU 0932 (RADV VANGOGH), Mesa 26.2.0-devel: headless at 1280x720 with the fixture save, from empty shader caches (no preparation): the child save in Kokiri Forest settled 20 s, a teleport to Hyrule Field, 15 s to settle and 30 s there, driven through the control bridge. The build that ran is the three branches of this set merged on main a8a30c22 (v3.0.0-rc.4-120-gd01328f1: this PR with the retire-later holder and the options reader), built for x86-64-v3, not this branch alone; this branch has been rebased onto bbe421f5 since (2026-11-16); the lines for HOS_VOICE_OPTION_FOLLOW, HOS_TEXTS and main's new HOS_AUDIO read (#1001's output_route_update, and the report it added where the device is not opened) came after that run. A run with HOS_AUDIO=off HOS_DISCORD=no HOS_VCORES=yes HOS_FPS_STEP=on HOS_KEEP_DISPLAY=true HOS_WIDE_UI=true HOS_INPUT_BACKGROUND=yes HOS_CACHE_CORES=on, beside runs with none of them: to the Field and through its sample at the same pace as the others (about 20 frames a second, shaders compiling as it went: not a measurement). With the switches the log has no audio: output on the default device line and no discord: line (both there without them), and still has the vcores: lines, vi: real-time step on and the wide ui: line.
  • The checks of the touched code by name (48 of them) on Linux x86-64 (Ryzen 7 5700U), clang 23.1.5, gcc, glslang, spirv-val, the Vulkan and SPIR-V headers, here and on main. A full python3 -I -B tests/run_all.py on main e4d035e9 and on this branch rebased onto it, the same day and PC (6 at once, the PC busy with other builds): main 609 passed, 28 failed, 26 skipped; this branch 609 / 28 / 26. By name every failure here is one of main's but tests/test_pipeline_cache_file.py, a timed check that passes alone on both, and tests/test_hud_layout.py, which compiles a copy of hos_wide_ui.c and wanted the rule's header: it has it now and passes. tests/test_mods_size_table.py fails here as on main (prompts.c's hos_options_file is not linked in its fixture). test_oot_state_tap and test_pipeline_state_sources failed on main's run only (timing). The branch was then rebased onto main bbe421f5 (two files of main's, neither touched here) and then onto f7922126 (one conflict, in nn_vi.c beside main's 30 fps cap), and pushed; the full run was not repeated for those steps, but the checks of every file the branch changes were (run_all.py --changed: 275 passed, 10 failed, 3 skipped; nine of the ten fail on main, and the tenth, test_frame_rate_cap_30, wanted the header and passes now).
  • The touched host/*.c, -fsyntax-only -Werror=implicit-function-declaration, gcc and clang for Linux and llvm-mingw 20261104 for Windows, with a stand-in for the generated a64_suyu.h: no error from this PR's lines.
  • Every place in the repository that sets one of these switches (scripts/, the tests, run-vk.ps1): only 0, 1 or empty, which read as before.
  • An independent review of the diff before this opened; the menu's HOS_HANDHELD copy, four switches read as atoi(e) and the check's narrower exception for HOS_FULLSCREEN come from it.

Not tested: Windows, in the game. HOS_FULLSCREEN=true itself (the Deck runs were headless). Checks that only run on Windows and paste host/display.c or the other files: one of them may want the rule's header as the eight above did.

Must be tested:

  • Windows, any GPU: python -I -B tests/run_all.py, expecting the same results as on main; and a start with HOS_FULLSCREEN=true, expecting fullscreen, and with HOS_AUDIO=off, expecting no sound (Test Farm: @Beanstalk windows, the game-free checks and a start with HOS_FULLSCREEN=true; or by hand)

Risks

What could break: a script that set one of these switches to a word atoi read as 0 gets the other answer: HOS_VCORES=yes kept the virtual cores off and now leaves them on. Nothing in the repository sets them so. It touches tests/test_env_on.py, which #622 also edits, and lines beside the options-reader PR of this set in nn_applet.c, nn_vi.c and discord_rpc.c: whichever lands second rebases.
Turning it off: revert the commit.
Compatibility: Nothing changes for a player who sets none of these switches. One who set a word (true, yes, on) gets what the word says.

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).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main (f7922126, 2026-11-16; head 88de20a8).
  • 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.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • 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.
  • Docs updated.
**Type:** fix · **Risk:** medium · **Tested on:** Linux, Steam Deck (RADV VANGOGH) · **Needs:** Windows, any GPU ## Why `HOS_FULLSCREEN=true` did nothing, and `HOS_AUDIO=true` muted the game. The switch reference says an on/off switch is on for any value but `0`, `false`, `off` or `no`, yet 26 switches in `host/` were still read with `atoi`, which takes `true`, `yes` and `on` for 0. They follow the one rule now. No issue in the tracker reports it; #62 lists the switches and does not change how they are read. ## How to reproduce **Seen on:** Linux and a Steam Deck (any OS: the reads are the same code) **Settings and switches:** `HOS_AUDIO=true`, or `HOS_FULLSCREEN=true` with a window **Steps:** start the game with the switch set to the word **Expected:** sound as without the switch (it is on by default); fullscreen **Actual:** on main, `HOS_AUDIO=true` opens no sound device (`atoi("true")` is 0, read as "off"), and `HOS_FULLSCREEN=true` starts in a window ## What changed Every on/off switch of `host/` is read by the rule the switch reference states, and a check keeps it so. - `gpu/vk/compat/longshot_env.h`: `env_on_or(name, def)` (new): unset, the default; set, as `env_on` reads it (set and empty is off). - `host/`: 26 switches read `env_on`, `env_on_or` or `env_value_off` instead of `atoi` (the table below): `hos_thread.c`, `hos_main.c`, `display.c`, `posix/display_sdl.c`, `nn_vi.c`, `nn_audio.c`, `nn_hid.c`, `nn_applet.c`, `nn_video.c`, `nvn_native.c`, `discord_rpc.c`, `oot_heap_retry.c`, `oot_voice.c`, `hos_wide_ui.c`, `mouse_native.c`, `texts.c`. - `gpu/vk/vk_menu.cpp`: its copy of the `HOS_HANDHELD` rule (a new install's Output resolution) reads the value as `host/nn_applet.c` does, so the two still agree. - `gpu/vk/vk_replay.cpp`: `RX_VK_PRESENT_AFTER_SIGNAL` reads `env_on_or(name, gate_on())`, the same answer as before in one call. `tests/test_env_on.py` fails on main over this line (#622 settles it in the check instead: whichever lands second rebases). - `tests/test_env_on.py`: checks `env_on_or`; lets `vk_menu.cpp` ask whether `HOS_FULLSCREEN` is set at all, by name; and names any switch of `host/` read with `atoi`, as `atoi(getenv(name))` or as `atoi(e)` within a few lines of `e = getenv(name)`, that is not in its list of numbers. (It caught `HOS_VOICE_OPTION_FOLLOW`, `HOS_TEXTS` and a second read of `HOS_AUDIO`, which main gained while this was open.) `tests/test_hud_layout.py` and `tests/test_mods_size_table.py` compile copies of changed files and bring the rule's header, as does main's new `tests/test_frame_rate_cap_30.py`, whose fake `getenv` the rule now reads through (it counts one read of `HOS_MOVIE_PACE`, where the old line read it twice when set). - Eight checks that paste the changed code put the rule's header before it (`-include`, as `test_frame_rate_cap_step` does): `test_movie_frame_count`, `test_oot_heap_retry`, `test_output_resolution`, `test_screensaver`, `test_vcore_escape`, `test_motion_background`, `test_wide_ui`, `test_oot_voice_option`; `test_threaded_rendering` pins the new line. - `docs/development.md`: the switch reference says how a switch that is on by default reads. Left as they are: switches that take a number (`HOS_CORES`, `HOS_COND_RECORD`, `HOS_FPS_TARGET`, ...), and `gpu/vk`'s on/off switches still read with `atoi` (`RX_VK_FRAME_GATE`, `RX_VK_FRAMEGEN`, ...): a follow-up. ## Measurements **Verdict:** nothing to measure: each switch is read once into a static, no default changes, and no per-frame path reads differently. It passes: the words were seen to take effect in the game on a Steam Deck (Testing). ### Flags and settings 26 switches change how they read a word; none is added, renamed or given another default. For each: `0`, `false`, `off`, `no`, unset and every number but 0 (negative ones too) read as before. A value `atoi` took for 0 that is not one of those words (`true`, `yes`, `on`, `00`, `0x1`) now means on. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `HOS_FULLSCREEN`, `HOS_PRESENT_POLL`, `HOS_GAME_INTERVAL`, `HOS_INPUT_FRAME_CLOCK`, `HOS_NO_RENDERER_WAIT`, `HOS_NVN_HOLD`, `HOS_POWER_THROTTLING`, `HOS_RESERVE_CORE`, `HOS_VIDEO_RGBA` | on/off, off unless set | `true`, `yes`, `on`: off | `true`, `yes`, `on`: on | the word a person types turns the switch on | untested in the game (none was set in the Deck runs) | as before: off unless testing | | `HOS_AUDIO`, `HOS_VCORES`, `HOS_CACHE_CORES`, `HOS_DISCORD`, `HOS_FPS_MOVIE`, `HOS_FPS_STEP`, `HOS_MOVIE_PACE`, `HOS_KEEP_DISPLAY`, `HOS_GPU_ALLOC_RETRY`, `HOS_VOICE_OPTION_FOLLOW`, `HOS_TEXTS`, `HOS_WIDE_UI` (still on when set and empty) | on/off, on unless turned off | `true`, `yes`, `on`: off | `true`, `yes`, `on`: on (the default) | `HOS_AUDIO=true` no longer mutes the game | on the Deck: `HOS_AUDIO=off`, `HOS_DISCORD=no` off, and `HOS_VCORES=yes`, `HOS_FPS_STEP=on`, `HOS_WIDE_UI=true`, `HOS_CACHE_CORES=on`, `HOS_KEEP_DISPLAY=true` on; the rest untested in the game | as before: on | | `HOS_HANDHELD`, `HOS_GUEST_MEMFD`, `HOS_PRESENT_NOWAIT`, `HOS_INPUT_BACKGROUND`, `HOS_MOUSE_NATIVE` | on/off over another answer (the options file, what the system can do, the renderer, a menu row) | `true`, `yes`, `on`: off | `true`, `yes`, `on`: on | as above | on the Deck: `HOS_INPUT_BACKGROUND=yes` ran; the rest untested in the game | as before | | `RX_VK_PRESENT_AFTER_SIGNAL` | on/off over the frame gate | by the rule | by the rule | none: one call for two | — | as before | Documented in `docs/development.md`, "Switches for testing and debugging" (the rule's paragraph). ## Testing **Tested:** - In the game, on Steam Deck OLED, SteamOS 3.9.5 (20261023.100), AMD Custom GPU 0932 (RADV VANGOGH), Mesa 26.2.0-devel: headless at 1280x720 with the fixture save, from empty shader caches (no preparation): the child save in Kokiri Forest settled 20 s, a teleport to Hyrule Field, 15 s to settle and 30 s there, driven through the control bridge. The build that ran is the three branches of this set merged on main a8a30c22 (`v3.0.0-rc.4-120-gd01328f1`: this PR with the retire-later holder and the options reader), built for x86-64-v3, not this branch alone; this branch has been rebased onto bbe421f5 since (2026-11-16); the lines for `HOS_VOICE_OPTION_FOLLOW`, `HOS_TEXTS` and main's new `HOS_AUDIO` read (#1001's `output_route_update`, and the report it added where the device is not opened) came after that run. A run with `HOS_AUDIO=off HOS_DISCORD=no HOS_VCORES=yes HOS_FPS_STEP=on HOS_KEEP_DISPLAY=true HOS_WIDE_UI=true HOS_INPUT_BACKGROUND=yes HOS_CACHE_CORES=on`, beside runs with none of them: to the Field and through its sample at the same pace as the others (about 20 frames a second, shaders compiling as it went: not a measurement). With the switches the log has no `audio: output on the default device` line and no `discord:` line (both there without them), and still has the `vcores:` lines, `vi: real-time step on` and the `wide ui:` line. - The checks of the touched code by name (48 of them) on Linux x86-64 (Ryzen 7 5700U), clang 23.1.5, gcc, glslang, spirv-val, the Vulkan and SPIR-V headers, here and on main. A full `python3 -I -B tests/run_all.py` on main e4d035e9 and on this branch rebased onto it, the same day and PC (6 at once, the PC busy with other builds): main 609 passed, 28 failed, 26 skipped; this branch 609 / 28 / 26. By name every failure here is one of main's but `tests/test_pipeline_cache_file.py`, a timed check that passes alone on both, and `tests/test_hud_layout.py`, which compiles a copy of `hos_wide_ui.c` and wanted the rule's header: it has it now and passes. `tests/test_mods_size_table.py` fails here as on main (`prompts.c`'s `hos_options_file` is not linked in its fixture). `test_oot_state_tap` and `test_pipeline_state_sources` failed on main's run only (timing). The branch was then rebased onto main bbe421f5 (two files of main's, neither touched here) and then onto f7922126 (one conflict, in `nn_vi.c` beside main's 30 fps cap), and pushed; the full run was not repeated for those steps, but the checks of every file the branch changes were (`run_all.py --changed`: 275 passed, 10 failed, 3 skipped; nine of the ten fail on main, and the tenth, `test_frame_rate_cap_30`, wanted the header and passes now). - The touched `host/*.c`, `-fsyntax-only -Werror=implicit-function-declaration`, gcc and clang for Linux and llvm-mingw 20261104 for Windows, with a stand-in for the generated `a64_suyu.h`: no error from this PR's lines. - Every place in the repository that sets one of these switches (`scripts/`, the tests, `run-vk.ps1`): only `0`, `1` or empty, which read as before. - An independent review of the diff before this opened; the menu's `HOS_HANDHELD` copy, four switches read as `atoi(e)` and the check's narrower exception for `HOS_FULLSCREEN` come from it. **Not tested:** Windows, in the game. `HOS_FULLSCREEN=true` itself (the Deck runs were headless). Checks that only run on Windows and paste `host/display.c` or the other files: one of them may want the rule's header as the eight above did. **Must be tested:** - Windows, any GPU: `python -I -B tests/run_all.py`, expecting the same results as on main; and a start with `HOS_FULLSCREEN=true`, expecting fullscreen, and with `HOS_AUDIO=off`, expecting no sound (Test Farm: @Beanstalk windows, the game-free checks and a start with HOS_FULLSCREEN=true; or by hand) ## Risks **What could break:** a script that set one of these switches to a word `atoi` read as 0 gets the other answer: `HOS_VCORES=yes` kept the virtual cores off and now leaves them on. Nothing in the repository sets them so. It touches `tests/test_env_on.py`, which #622 also edits, and lines beside the options-reader PR of this set in `nn_applet.c`, `nn_vi.c` and `discord_rpc.c`: whichever lands second rebases. **Turning it off:** revert the commit. **Compatibility:** Nothing changes for a player who sets none of these switches. One who set a word (`true`, `yes`, `on`) gets what the word says. ## 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] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main` (f7922126, 2026-11-16; head `88de20a8`). - [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] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [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. - [x] Docs updated.
fix(host): on/off switches in host/ read the one rule, with env_on_or for the ones on by default
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
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
676cbac476
25 switches read with `atoi` took `true`, `yes` and `on` for off (`HOS_FULLSCREEN=true` did nothing). They read
`env_on` now, `env_on_or` (new in `longshot_env.h`) where unset means on, or `env_value_off` where unset means
another answer. `gpu/vk/vk_menu.cpp`'s copy of the `HOS_HANDHELD` rule follows the host's, and
`RX_VK_PRESENT_AFTER_SIGNAL` reads through `env_on_or`, which `tests/test_env_on.py` asked for on main.
The check names any switch of `host/` read with `atoi` that is not in its list of numbers.

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

Tested in game: Steam Deck OLED, SteamOS 3.9.5 (20261023.100), AMD Custom GPU 0932 (RADV VANGOGH), Mesa 26.2.0-devel. A build of this branch merged with the two other branches of its set on main a8a30c22 (v3.0.0-rc.4-120-gd01328f1), headless at 1280x720, from empty shader caches: the child save in Kokiri Forest, a teleport to Hyrule Field and 45 s there, four runs, each to its end with no device loss. One run with HOS_AUDIO=off HOS_DISCORD=no HOS_VCORES=yes HOS_FPS_STEP=on HOS_KEEP_DISPLAY=true HOS_WIDE_UI=true HOS_INPUT_BACKGROUND=yes HOS_CACHE_CORES=on: no 'audio: output on the default device' and no 'discord:' line in its log (both are there without the switches), and the vcores, real-time step and wide ui lines still there. HOS_FULLSCREEN=true was not run (headless), and HOS_VOICE_OPTION_FOLLOW's line was added after the run.

Tested in game: Steam Deck OLED, SteamOS 3.9.5 (20261023.100), AMD Custom GPU 0932 (RADV VANGOGH), Mesa 26.2.0-devel. A build of this branch merged with the two other branches of its set on main a8a30c22 (v3.0.0-rc.4-120-gd01328f1), headless at 1280x720, from empty shader caches: the child save in Kokiri Forest, a teleport to Hyrule Field and 45 s there, four runs, each to its end with no device loss. One run with HOS_AUDIO=off HOS_DISCORD=no HOS_VCORES=yes HOS_FPS_STEP=on HOS_KEEP_DISPLAY=true HOS_WIDE_UI=true HOS_INPUT_BACKGROUND=yes HOS_CACHE_CORES=on: no 'audio: output on the default device' and no 'discord:' line in its log (both are there without the switches), and the vcores, real-time step and wide ui lines still there. HOS_FULLSCREEN=true was not run (headless), and HOS_VOICE_OPTION_FOLLOW's line was added after the run.
zeldaootr changed title from WIP: fix(host): on/off switches read true, yes and on as on, by the one rule to fix(host): on/off switches read true, yes and on as on, by the one rule 2026-11-16 00:13:55 +00:00
Collaborator

Possibly related, for context:

  • PR #979 refactor(host): one reader for longshot_options.ini's lines, not six — Concurrent changes in overlapping host files, including nn_applet.c, nn_audio.c, nn_hid.c and discord_rpc.c.
Possibly related, for context: - PR #979 refactor(host): one reader for longshot_options.ini's lines, not six — Concurrent changes in overlapping host files, including nn_applet.c, nn_audio.c, nn_hid.c and discord_rpc.c.
zeldaootr force-pushed host-env-on-switches from 676cbac476
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
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
to 262e05be27
Some checks failed
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
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 05:04:41 +00:00
Compare
Author
Contributor

Rebased onto main bbe421f5; the description names what changed with it.

Rebased onto main bbe421f5; the description names what changed with it.
Author
Contributor

Rebased onto main f7922126 (a conflict in nn_vi.c); the description names what changed with it.

Rebased onto main f7922126 (a conflict in `nn_vi.c`); the description names what changed with it.
zeldaootr force-pushed host-env-on-switches from 262e05be27
Some checks failed
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
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 88de20a880
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
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
PR description / Description follows the template (pull_request_target) Successful in 4s
2026-11-16 07:02:04 +00:00
Compare
Member

Code-only review of 88de20a880; informational findings, with final approval left to another reviewer.

No confirmed new correctness defect found in the switch conversions. The unset defaults and menu/system fallbacks remain intact, including the paired handheld and native-mouse reads. The existing empty-value exception for HOS_WIDE_UI is preserved. The fixture adjustment from two getenv reads to one follows the actual helper change rather than relaxing its behavior assertion.

The remaining validation is the Windows run already named in Testing: compare the game-free checks against main, verify HOS_FULLSCREEN=true starts fullscreen, and HOS_AUDIO=off disables output. The documented Deck run is useful evidence, but it was headless, combined three branches, and predates the later voice/text/audio-route conversions; it cannot establish those Windows results. The helper tests exercise defaults and word parsing, while the source scan checks call-site spelling rather than every switch's runtime effect.

Merge coordination: the options-reader PR is complementary; preserve both its option-reader substitutions and these environment overrides when resolving adjacent hunks. The environment-test PR also edits the guard; preserve its coverage when integrating.

Read the full diff, affected callers/helper, extraction-fixture changes, existing reports and relevant overlapping diffs. No tests, builds or game runs performed for this review.

Code-only review of 88de20a8806c51a35391f14ffde347fc3988228a; informational findings, with final approval left to another reviewer. No confirmed new correctness defect found in the switch conversions. The unset defaults and menu/system fallbacks remain intact, including the paired handheld and native-mouse reads. The existing empty-value exception for `HOS_WIDE_UI` is preserved. The fixture adjustment from two `getenv` reads to one follows the actual helper change rather than relaxing its behavior assertion. The remaining validation is the Windows run already named in Testing: compare the game-free checks against main, verify `HOS_FULLSCREEN=true` starts fullscreen, and `HOS_AUDIO=off` disables output. The documented Deck run is useful evidence, but it was headless, combined three branches, and predates the later voice/text/audio-route conversions; it cannot establish those Windows results. The helper tests exercise defaults and word parsing, while the source scan checks call-site spelling rather than every switch's runtime effect. Merge coordination: [the options-reader PR](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/979) is complementary; preserve both its option-reader substitutions and these environment overrides when resolving adjacent hunks. [The environment-test PR](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/622) also edits the guard; preserve its coverage when integrating. Read the full diff, affected callers/helper, extraction-fixture changes, existing reports and relevant overlapping diffs. No tests, builds or game runs performed for this review.
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
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
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'host-env-on-switches:zeldaootr-host-env-on-switches'
git switch 'zeldaootr-host-env-on-switches'
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!980
No description provided.