diff options
Diffstat (limited to 'src/devices/sound/huc6230.cpp')
-rw-r--r-- | src/devices/sound/huc6230.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/devices/sound/huc6230.cpp b/src/devices/sound/huc6230.cpp index 31e143fea8c..50a28a37cbb 100644 --- a/src/devices/sound/huc6230.cpp +++ b/src/devices/sound/huc6230.cpp @@ -18,8 +18,6 @@ #include "emu.h" #include "huc6230.h" -constexpr int clamp(int val, int min, int max) { return std::min(max, std::max(min, val)); } - void huc6230_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { @@ -35,8 +33,8 @@ void huc6230_device::sound_stream_update(sound_stream &stream, std::vector<read_ if (!channel->m_playing) continue; - samp0 = clamp(samp0 + ((channel->m_output * channel->m_lvol) >> 3), -32768, 32767); - samp1 = clamp(samp1 + ((channel->m_output * channel->m_rvol) >> 3), -32768, 32767); + samp0 = std::clamp(samp0 + ((channel->m_output * channel->m_lvol) >> 3), -32768, 32767); + samp1 = std::clamp(samp1 + ((channel->m_output * channel->m_rvol) >> 3), -32768, 32767); } outputs[0].put_int(i, samp0, 32768); |