diff options
author | JP Cimalando <jpcima@users.noreply.github.com> | 2018-06-09 05:24:08 +0200 |
---|---|---|
committer | JP Cimalando <jpcima@users.noreply.github.com> | 2018-06-09 05:24:08 +0200 |
commit | 286c2a8635b2aaa22e8d8c5e3ae3aa457643c6fc (patch) | |
tree | 116b99efb46c946cf0f345f13c74fec824067b9b | |
parent | 2899c50228b8be18254dddee53c86c6dc3b8f19a (diff) | |
download | libADLMIDI-286c2a8635b2aaa22e8d8c5e3ae3aa457643c6fc.tar.gz libADLMIDI-286c2a8635b2aaa22e8d8c5e3ae3aa457643c6fc.tar.bz2 libADLMIDI-286c2a8635b2aaa22e8d8c5e3ae3aa457643c6fc.zip |
don't forget to increment sample pointer in generate16
-rw-r--r-- | src/chips/opl_chip_base.tcc | 6 |
1 files changed, 4 insertions, 2 deletions
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<T>::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<T *>(this)->nativePostGenerate(); } @@ -83,8 +84,9 @@ void OPLChipBaseT<T>::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<T *>(this)->nativePostGenerate(); } |