aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVitaly Novichkov <Wohlstand@users.noreply.github.com>2018-06-09 12:41:57 +0300
committerGitHub <noreply@github.com>2018-06-09 12:41:57 +0300
commita3e8ca2f942b466b658800a26a5674334b8c15ab (patch)
tree116b99efb46c946cf0f345f13c74fec824067b9b /src
parent2899c50228b8be18254dddee53c86c6dc3b8f19a (diff)
parent286c2a8635b2aaa22e8d8c5e3ae3aa457643c6fc (diff)
downloadlibADLMIDI-a3e8ca2f942b466b658800a26a5674334b8c15ab.tar.gz
libADLMIDI-a3e8ca2f942b466b658800a26a5674334b8c15ab.tar.bz2
libADLMIDI-a3e8ca2f942b466b658800a26a5674334b8c15ab.zip
Merge pull request #110 from jpcima/chips-generate16
don't forget to increment sample pointer in generate16
Diffstat (limited to 'src')
-rw-r--r--src/chips/opl_chip_base.tcc6
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();
}