Diff for /np2/sound/opngenc.c between versions 1.11 and 1.14

version 1.11, 2005/05/13 05:47:25 version 1.14, 2011/02/04 14:43:55
Line 54  void opngen_initialize(UINT rate) { Line 54  void opngen_initialize(UINT rate) {
   
         UINT    ratebit;          UINT    ratebit;
         int             i;          int             i;
           char    sft;
         int             j;          int             j;
         double  pom;          double  pom;
           long    detune;
         double  freq;          double  freq;
         UINT32  calcrate;          UINT32  calcrate;
   
Line 73  void opngen_initialize(UINT rate) { Line 75  void opngen_initialize(UINT rate) {
   
         for (i=0; i<EVC_ENT; i++) {          for (i=0; i<EVC_ENT; i++) {
 #ifdef OPNGENX86  #ifdef OPNGENX86
                 char sft;  
                 sft = ENVTBL_BIT;                  sft = ENVTBL_BIT;
                 while(sft < (ENVTBL_BIT + 8)) {                  while(sft < (ENVTBL_BIT + 8)) {
                         pom = (double)(1 << sft) / pow(10.0, EG_STEP*(EVC_ENT-i)/20.0);                          pom = (double)(1 << sft) / pow(10.0, EG_STEP*(EVC_ENT-i)/20.0);
Line 133  void opngen_initialize(UINT rate) { Line 134  void opngen_initialize(UINT rate) {
   
         for (i=0; i<4; i++) {          for (i=0; i<4; i++) {
                 for (j=0; j<32; j++) {                  for (j=0; j<32; j++) {
 #if (FREQ_BITS >= 21)                          detune = dttable[i*32 + j];
                         freq = FREQBASE4096 * dttable[i*32 + j] *                          sft = ratebit + (FREQ_BITS - 21);
                                                                                         (1 << (FREQ_BITS-21));                          if (sft >= 0) {
 #else                                  detune <<= sft;
                         freq = FREQBASE4096 * dttable[i*32 + j] /                          }
                                                                                         (1 << (21-FREQ_BITS));                          else {
 #endif                                  detune >>= (0 - sft);
                         detunetable[i][j]   = (long)freq;                          }
                         detunetable[i+4][j] = (long)-freq;  
                           detunetable[i][j]   = detune;
                           detunetable[i+4][j] = -detune;
                 }                  }
         }          }
         for (i=0; i<4; i++) {          for (i=0; i<4; i++) {
Line 164  void opngen_initialize(UINT rate) { Line 167  void opngen_initialize(UINT rate) {
                 decaytable[i] = (long)(freq / OPM_DRRATE);                  decaytable[i] = (long)(freq / OPM_DRRATE);
 #endif  #endif
                 if (attacktable[i] >= EC_DECAY) {                  if (attacktable[i] >= EC_DECAY) {
                         TRACEOUT(("attacktable %d %d %d", i, attacktable[i], EC_DECAY));                          TRACEOUT(("attacktable %d %d %ld", i, attacktable[i], EC_DECAY));
                 }                  }
                 if (decaytable[i] >= EC_DECAY) {                  if (decaytable[i] >= EC_DECAY) {
                         TRACEOUT(("decaytable %d %d %d", i, decaytable[i], EC_DECAY));                          TRACEOUT(("decaytable %d %d %ld", i, decaytable[i], EC_DECAY));
                 }                  }
         }          }
         attacktable[62] = EC_DECAY - 1;          attacktable[62] = EC_DECAY - 1;
Line 442  void opngen_reset(void) { Line 445  void opngen_reset(void) {
         }          }
 }  }
   
 void opngen_setcfg(REG8 maxch, UINT flag) {  void opngen_setcfg(REG8 maxch, UINT32 flag) {
   
         OPNCH   *ch;          OPNCH   *ch;
         UINT    i;          UINT    i;

Removed from v.1.11  
changed lines
  Added in v.1.14


RetroPC.NET-CVS <cvs@retropc.net>