diff --git a/backends/playback/zsm/zsm_backend.hpp b/backends/playback/zsm/zsm_backend.hpp index febcf23..c1c29b4 100644 --- a/backends/playback/zsm/zsm_backend.hpp +++ b/backends/playback/zsm/zsm_backend.hpp @@ -134,11 +134,11 @@ class ZsmBackend : public PlaybackBackend { ym_resample_len /= sizeof(int16_t); for (size_t i = 0; i < samples / 2; i++) { size_t j = i * 2; - int32_t psg[2] = {psg_ptr[j], psg_ptr[j + 1]}; - int32_t pcm[2] = {pcm_ptr[j], pcm_ptr[j + 1]}; - int32_t vera[2] = {psg[0] + pcm[0], psg[1] + pcm[1]}; - int32_t fm[2] = {ym_resample_ptr[j], ym_resample_ptr[j + 1]}; - int16_t mix[2] = {(vera[0] + fm[0]) / 3, (vera[1] + fm[1]) / 3}; + int16_t psg[2] = {psg_ptr[j] >> 1, psg_ptr[j + 1] >> 1}; + int16_t pcm[2] = {pcm_ptr[j] >> 1, pcm_ptr[j + 1] >> 1}; + int16_t vera[2] = {psg[0] + pcm[0], psg[1] + pcm[1]}; + int16_t fm[2] = {ym_resample_ptr[j], ym_resample_ptr[j + 1]}; + int16_t mix[2] = {vera[0] + (fm[0] >> 1), vera[1] + (fm[1] >> 1)}; out_ptr[j++] = mix[0]; out_ptr[j++] = mix[1]; }