summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2025-10-11 18:29:51 -0500
committerJordan Woyak <jordan.woyak@gmail.com>2026-10-08 17:41:22 -0500
commitbaa05e32f1db379e98bbd48b35b2aaa2e6fa4e94 (patch)
tree66004b6719fe090e41887fa7f61a0184aca084ce /Source/Core/AudioCommon
parente6f3ae17627e4344da95b13424af5baf4c892b08 (diff)
HW/Wiimote: Speaker logic accuracy fixes, comments, and code cleanups.
Diffstat (limited to 'Source/Core/AudioCommon')
-rw-r--r--Source/Core/AudioCommon/Mixer.cpp4
-rw-r--r--Source/Core/AudioCommon/Mixer.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/AudioCommon/Mixer.cpp b/Source/Core/AudioCommon/Mixer.cpp
index fe7f0e7349..aac346d31b 100644
--- a/Source/Core/AudioCommon/Mixer.cpp
+++ b/Source/Core/AudioCommon/Mixer.cpp
@@ -268,6 +268,9 @@ void Mixer::PushWiimoteSpeakerSamples(std::size_t wiimote_index, const s16* samp
if (!IsOutputSampleRateValid() || wiimote_index >= m_wiimote_speaker_mixers.size())
return;
+ if (!m_config_wiimote_enable_speaker)
+ return;
+
// WiimoteEmu produces host-endian mono samples.
m_wiimote_speaker_mixers[wiimote_index].SetInputSampleRateDivisor(sample_rate_divisor);
@@ -448,6 +451,7 @@ void Mixer::RefreshConfig()
m_config_gba_routing_enabled = Config::Get(Config::MAIN_GBA_AUDIO_ROUTING_ENABLED);
for (std::size_t i = 0; i < m_config_gba_output_enabled.size(); ++i)
m_config_gba_output_enabled[i] = Config::Get(Config::MAIN_GBA_AUDIO_OUTPUT_ENABLED[i]);
+ m_config_wiimote_enable_speaker = Config::Get(Config::MAIN_WIIMOTE_ENABLE_SPEAKER);
}
void Mixer::MixerFifo::DoState(PointerWrap& p)
diff --git a/Source/Core/AudioCommon/Mixer.h b/Source/Core/AudioCommon/Mixer.h
index 26e179f03b..01cbae78a3 100644
--- a/Source/Core/AudioCommon/Mixer.h
+++ b/Source/Core/AudioCommon/Mixer.h
@@ -204,6 +204,7 @@ private:
std::array<bool, 4> m_config_wiimote_output_enabled{};
bool m_config_gba_routing_enabled = false;
std::array<bool, Config::GBA_SPEAKER_COUNT> m_config_gba_output_enabled{};
+ bool m_config_wiimote_enable_speaker;
Config::ConfigChangedCallbackID m_config_changed_callback_id;
};