Skip to content

Shrine sensor audio volume level slider and mute option (#449) - #571

Closed
jfpaardoo wants to merge 1 commit into
Revivedx:testfrom
jfpaardoo:feat/shrine-sensor-volume
Closed

jfpaardoo wants to merge 1 commit into
Revivedx:testfrom
jfpaardoo:feat/shrine-sensor-volume

Conversation

@jfpaardoo

@jfpaardoo jfpaardoo commented Nov 8, 2026 •

Copy link
Copy Markdown

What this changes

Fixes #449

Adds an option and slider to configure the Sheikah Slate shrine and item sensor beeping volume level from 0% to 100% (default 100%), with 0% completely muting the sensor beeps:

  • Intercepts and patches Sound/Resource/M_UI.bars inside Pack/Bootup.pack (or loose in RomFS) on RomFS mount.
  • Parses the BARS container structure and locates Sys_Item_SheikSensor (AMTA metadata and BWAV sound data).
  • For non-zero volumes, computes logarithmic decibel attenuation (orig_db + 20.0f * log10f(pct / 100.0f)).
  • For 0% (mute), sets the AMTA volume to -999.0f dB and zeroes the raw 16-bit PCM sample data in the BWAV payload for an absolute silence guarantee.
  • Adds shrine_sensor_volume (0-100) to Settings, with full persistence in settings file and live control socket exposure.
  • Dynamically applies volume adjustments without requiring game restarts via shrine_sensor_apply().
  • Exposes UI controls in:
    • In-game Options menu (P_AUDIO page, Off / 10% .. 100%).
    • Standalone launcher / configuration menu (Audio tab slider).
  • Provides localized UI strings across all 13 supported languages in runtime/ui/i18n/*.inc.
  • Adds unit tests in tests/test_shrine_sensor.c and a new Makefile target test-shrine-sensor.

How it was tested

  • OS: Windows 11 (MSYS2 UCRT64 toolchain, Clang 19)
  • Unit tests:
    • make test-shrine-sensor: Validated BARS parsing, 100% level preservation, 50% attenuation (-6.02 dB), 0% mute (-999.0 dB and sample data zeroing), and runtime shrine_sensor_apply().
    • python tools/i18n_check.py: Passed with 0 missing and 0 unused strings across all 13 languages.
    • make test-pc-controls: Verified settings persistence and controls integrity.
    • make runtime-objs: Clean compile of all runtime objects without errors or warnings.
    • git diff --check: 0 whitespace/formatting errors.

Checklist

  • Based on the latest test and opened against test
  • Built and run locally, and checked in the game
  • No game files, keys, firmware, generated game code or save files in the changes

…dx#449)

Add a slider and choice option to adjust the volume level of the Sheikah
Slate shrine/item sensor beeps from 0% to 100% (default 100%), with 0%
muting the sensor completely.

- Parse BARS container and patch AMTA/BWAV for Sys_Item_SheikSensor on
  mount in runtime/services/fs.c and dynamically in runtime/shrine_sensor.c
- Add shrine_sensor_volume to Settings, with persistence and control socket support
- Add UI controls to in-game Options (P_AUDIO) and standalone launcher Audio tab
- Add translations across all 13 supported languages in runtime/ui/i18n/
- Add test coverage in tests/test_shrine_sensor.c and Makefile target test-shrine-sensor
Copilot AI balanced review requested due to automatic review settings November 8, 2026 09:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Revivedx added a commit that referenced this pull request Nov 8, 2026
New:
- Audio > Audio output: Stereo, Surround 5.1 or 3D Headphones. Stereo stays the default (#576).
- Audio > Shrine sensor volume, 0% to 100%, from the next start (#571, fixes #449). The sound is changed in memory
  only; the game files are not touched.
- Controls > HUD button layout: where A, B, X and Y sit on the HUD's diamond, from the next start. Automatic follows
  the controller bindings (#574, #321).

Tested by playing on Windows with headphones (Stereo and 3D Headphones), and with a hidden start, warp and teleport
run: no crash and no errors in the log. Surround 5.1 has not been tested on real 5.1 speakers, and the option says so.

Co-authored-by: jfpaardoo <juaparpar@alum.us.es>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Revivedx

Revivedx commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Thanks, this is in test as a04bafd. One change: the option now applies from the next start. shrine_sensor_apply() never reached the game, because g_sensor_vol_ptr was never set and the game reads the sound file when it starts. It also kept a pointer to the buffer that is freed at 100%, so changing the option from the default wrote into freed memory. The BARS patch itself is unchanged. Closing since test gets one clean commit per batch; you are credited as co-author.

@Revivedx Revivedx closed this Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants