|
|
| version 1.1, 2004/08/01 05:31:31 | version 1.3, 2005/02/04 06:42:12 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM) | |
| #include "sound.h" | #include "sound.h" |
| #include "sndctrl.h" | #include "sndctrl.h" |
| extern OPMCFG opmcfg; | extern OPMCFG opmcfg; |
| #define CALCENV(e, c, s) \ | #define CALCENV(e, c, s) \ |
| (c)->slot[(s)].freq_cnt += (c)->slot[(s)].freq_inc; \ | (c)->slot[(s)].freq_cnt += (c)->slot[(s)].freq_inc; \ |
| (c)->slot[(s)].env_cnt += (c)->slot[(s)].env_inc; \ | (c)->slot[(s)].env_cnt += (c)->slot[(s)].env_inc; \ |
| Line 131 void SOUNDCALL opmgen_getpcm(void *hdl, | Line 132 void SOUNDCALL opmgen_getpcm(void *hdl, |
| } | } |
| } | } |
| samp_l += opmgen.outdl * opmgen.calcremain; | samp_l += opmgen.outdl * opmgen.calcremain; |
| // samp_l >>= 8; | samp_l >>= 8; |
| // samp_l *= opmcfg.fmvol; | samp_l *= opmcfg.fmvol; |
| samp_l >>= (OPM_OUTSB + FMDIV_BITS + 1 + 0 - FMVOL_SFTBIT - 0); | samp_l >>= (OPM_OUTSB + FMDIV_BITS + 1 + 6 - FMVOL_SFTBIT - 8); |
| pcm[0] += samp_l; | pcm[0] += samp_l; |
| samp_r += opmgen.outdr * opmgen.calcremain; | samp_r += opmgen.outdr * opmgen.calcremain; |
| // samp_r >>= 8; | samp_r >>= 8; |
| // samp_r *= opmcfg.fmvol; | samp_r *= opmcfg.fmvol; |
| samp_r >>= (OPM_OUTSB + FMDIV_BITS + 1 + 0 - FMVOL_SFTBIT - 0); | samp_r >>= (OPM_OUTSB + FMDIV_BITS + 1 + 6 - FMVOL_SFTBIT - 8); |
| pcm[1] += samp_r; | pcm[1] += samp_r; |
| opmgen.calcremain -= opmcfg.calc1024; | opmgen.calcremain -= opmcfg.calc1024; |
| pcm += 2; | pcm += 2; |
| Line 147 void SOUNDCALL opmgen_getpcm(void *hdl, | Line 148 void SOUNDCALL opmgen_getpcm(void *hdl, |
| (void)hdl; | (void)hdl; |
| } | } |
| #endif |