From 286c2a8635b2aaa22e8d8c5e3ae3aa457643c6fc Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Sat, 9 Jun 2018 05:24:08 +0200 Subject: don't forget to increment sample pointer in generate16 --- src/chips/opl_chip_base.tcc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/chips/opl_chip_base.tcc b/src/chips/opl_chip_base.tcc index 42cfc13..58145bc 100644 --- a/src/chips/opl_chip_base.tcc +++ b/src/chips/opl_chip_base.tcc @@ -65,8 +65,9 @@ void OPLChipBaseT::generate(int16_t *output, size_t frames) int32_t temp = frame[c]; temp = (temp > -32768) ? temp : -32768; temp = (temp < 32767) ? temp : 32767; - output[c] = temp; + output[c] = (int16_t)temp; } + output += 2; } static_cast(this)->nativePostGenerate(); } @@ -83,8 +84,9 @@ void OPLChipBaseT::generateAndMix(int16_t *output, size_t frames) int32_t temp = (int32_t)output[c] + frame[c]; temp = (temp > -32768) ? temp : -32768; temp = (temp < 32767) ? temp : 32767; - output[c] = temp; + output[c] = (int16_t)temp; } + output += 2; } static_cast(this)->nativePostGenerate(); } -- cgit v1.2.3