Diff for /np2/sound/adpcmg.c between versions 1.4 and 1.6

version 1.4, 2004/02/04 10:30:55 version 1.6, 2005/02/07 14:46:12
Line 23  REG8 SOUNDCALL adpcm_readsample(ADPCM ad Line 23  REG8 SOUNDCALL adpcm_readsample(ADPCM ad
                         pos += 8;                          pos += 8;
                 }                  }
                 else {                  else {
                         const BYTE *ptr;                          const UINT8 *ptr;
                         REG8 bit;                          REG8 bit;
                         UINT tmp;                          UINT tmp;
                         ptr = ad->buf + ((pos >> 3) & 0x7fff);                          ptr = ad->buf + ((pos >> 3) & 0x7fff);
Line 68  void SOUNDCALL adpcm_datawrite(ADPCM ad, Line 68  void SOUNDCALL adpcm_datawrite(ADPCM ad,
                 pos += 8;                  pos += 8;
         }          }
         else {          else {
                 BYTE *ptr;                  UINT8 *ptr;
                 UINT8 bit;                  UINT8 bit;
                 UINT8 mask;                  UINT8 mask;
                 ptr = ad->buf + ((pos >> 3) & 0x7fff);                  ptr = ad->buf + ((pos >> 3) & 0x7fff);
Line 108  void SOUNDCALL adpcm_datawrite(ADPCM ad, Line 108  void SOUNDCALL adpcm_datawrite(ADPCM ad,
                 }                  }
                 pos++;                  pos++;
         }          }
         if (pos != ad->stop) {          if (pos == ad->stop) {
                 pos &= 0x1fffff;                  pos &= 0x1fffff;
                 ad->status |= 4;                  ad->status |= 4;
         }          }
Line 135  static void SOUNDCALL getadpcmdata(ADPCM Line 135  static void SOUNDCALL getadpcmdata(ADPCM
                 pos += ADPCM_NBR + 4;                  pos += ADPCM_NBR + 4;
         }          }
         else {          else {
                 const BYTE *ptr;                  const UINT8 *ptr;
                 REG8 bit;                  REG8 bit;
                 UINT tmp;                  UINT tmp;
                 ptr = ad->buf + ((pos >> 3) & 0x7fff);                  ptr = ad->buf + ((pos >> 3) & 0x7fff);
Line 160  static void SOUNDCALL getadpcmdata(ADPCM Line 160  static void SOUNDCALL getadpcmdata(ADPCM
         dir = data & 8;          dir = data & 8;
         data &= 7;          data &= 7;
         dlt = adpcmdeltatable[data] * ad->delta;          dlt = adpcmdeltatable[data] * ad->delta;
 //      dlt -= 12;  
         dlt >>= 8;          dlt >>= 8;
         if (dlt < 126) {          if (dlt < 127) {
                 dlt = 126;                  dlt = 127;
         }          }
         else if (dlt > 24000) {          else if (dlt > 24000) {
                 dlt = 24000;                  dlt = 24000;
Line 191  static void SOUNDCALL getadpcmdata(ADPCM Line 190  static void SOUNDCALL getadpcmdata(ADPCM
                         if (ad->reg.ctrl1 & 0x10) {                          if (ad->reg.ctrl1 & 0x10) {
                                 pos = ad->start;                                  pos = ad->start;
                                 ad->samp = 0;                                  ad->samp = 0;
                                 ad->delta = 128;                                  ad->delta = 127;
                         }                          }
                         else {                          else {
                                 pos &= 0x1fffff;                                  pos &= 0x1fffff;
Line 208  static void SOUNDCALL getadpcmdata(ADPCM Line 207  static void SOUNDCALL getadpcmdata(ADPCM
         samp >>= (10 + 1);          samp >>= (10 + 1);
         ad->out0 = ad->out1;          ad->out0 = ad->out1;
         ad->out1 = samp + ad->fb;          ad->out1 = samp + ad->fb;
         ad->fb = samp;                                  // >> 1;          ad->fb = samp >> 1;
 }  }
   
 void SOUNDCALL adpcm_getpcm(ADPCM ad, SINT32 *pcm, UINT count) {  void SOUNDCALL adpcm_getpcm(ADPCM ad, SINT32 *pcm, UINT count) {

Removed from v.1.4  
changed lines
  Added in v.1.6


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