Apply Sound Mixer volumes after every pccore_reset#13
Merged
Conversation
The core pccore_reset() resets all sound chips to their power-on volume. sound_init() only restores the basic chip volumes and misses the FMGEN linear volumes and cs4231 scaling, so the np2cfg.vol_* Sound Mixer settings were never actually applied at startup (or after any reset). Wrap pccore_reset() in the glue layer (usa_pccore_reset) so it re-applies the full mixer via fmboard_updatevolume() afterwards, matching the live slider-edit path, and route all callers through it. NP2kai's core stays unpatched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
アプリ起動時に Sound Mixer(
np2cfg.vol_*)の設定が実際にはサウンドチップへ反映されていなかった問題の修正です。pccore_reset()は全サウンドチップを電源投入時の音量へリセットします。sound_init()は基本的なチップ音量しか復元せず、FMGEN のリニア音量や cs4231 のスケーリングを設定しないため、起動時(およびリセット後)に Mixer 設定が無視されていました。usa_pccore_reset()を新設し、pccore_reset()の直後にfmboard_updatevolume()で Mixer 全体を再適用するようにしました(ライブのスライダー編集経路と同じ)。変更ファイルは
src/c.zigとsrc/np2_glue.cの2点のみ。Test plan
zig build成功core/np2kaiが無改変(クリーン)であることを確認🤖 Generated with Claude Code