diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-02-19 17:25:56 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-02-19 17:25:56 +0900 |
commit | d78900cd1497441d7712805b08072e46ee361ff8 (patch) | |
tree | 5a696ac5ffa4e6d71992c9329ff5b13ad14cf977 /libopna/opnaadpcm.c | |
parent | be500d48fbc381273dfdc600898f68df725aa954 (diff) |
add opna status display
Diffstat (limited to 'libopna/opnaadpcm.c')
-rw-r--r-- | libopna/opnaadpcm.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libopna/opnaadpcm.c b/libopna/opnaadpcm.c index 1157b56..68dbae5 100644 --- a/libopna/opnaadpcm.c +++ b/libopna/opnaadpcm.c @@ -185,16 +185,18 @@ void opna_adpcm_mix(struct opna_adpcm *adpcm, int16_t *buf, unsigned samples) { if (!(adpcm->control1 & C1_START)) return; for (unsigned i = 0; i < samples; i++) { adpcm_calc(adpcm); - int32_t lo = buf[i*2+0]; - int32_t ro = buf[i*2+1]; - if (adpcm->control2 & C2_L) lo += (adpcm->out>>1); - if (adpcm->control2 & C2_R) ro += (adpcm->out>>1); - if (lo < INT16_MIN) lo = INT16_MIN; - if (lo > INT16_MAX) lo = INT16_MAX; - if (ro < INT16_MIN) ro = INT16_MIN; - if (ro > INT16_MAX) ro = INT16_MAX; - buf[i*2+0] = lo; - buf[i*2+1] = ro; + if (!adpcm->masked) { + int32_t lo = buf[i*2+0]; + int32_t ro = buf[i*2+1]; + if (adpcm->control2 & C2_L) lo += (adpcm->out>>1); + if (adpcm->control2 & C2_R) ro += (adpcm->out>>1); + if (lo < INT16_MIN) lo = INT16_MIN; + if (lo > INT16_MAX) lo = INT16_MAX; + if (ro < INT16_MIN) ro = INT16_MIN; + if (ro > INT16_MAX) ro = INT16_MAX; + buf[i*2+0] = lo; + buf[i*2+1] = ro; + } if (!(adpcm->control1 & C1_START)) return; } } |