summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/ym2151.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/ym2151.cpp')
-rw-r--r--src/devices/sound/ym2151.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/devices/sound/ym2151.cpp b/src/devices/sound/ym2151.cpp
index b519d9a1224..74cfa9643ae 100644
--- a/src/devices/sound/ym2151.cpp
+++ b/src/devices/sound/ym2151.cpp
@@ -1845,7 +1845,6 @@ void ym2151_device::sound_stream_update(sound_stream &stream, std::vector<read_s
return;
}
- constexpr stream_buffer::sample_t sample_scale = 1.0 / 32768.0;
for (int sampindex=0; sampindex<outputs[0].samples(); sampindex++)
{
advance_eg();
@@ -1864,16 +1863,8 @@ void ym2151_device::sound_stream_update(sound_stream &stream, std::vector<read_s
outr += chanout[ch] & pan[2*ch+1];
}
- if (outl > 32767)
- outl = 32767;
- else if (outl < -32768)
- outl = -32768;
- if (outr > 32767)
- outr = 32767;
- else if (outr < -32768)
- outr = -32768;
- outputs[0].put(sampindex, stream_buffer::sample_t(outl) * sample_scale);
- outputs[1].put(sampindex, stream_buffer::sample_t(outr) * sample_scale);
+ outputs[0].put_int_clamp(sampindex, outl, 32768);
+ outputs[1].put_int_clamp(sampindex, outr, 32768);
advance();
}