Diff for /np2/sound/adpcmg.c between versions 1.3 and 1.5

version 1.3, 2003/12/08 00:55:33 version 1.5, 2004/02/06 17:10:32
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 129  static void SOUNDCALL getadpcmdata(ADPCM Line 129  static void SOUNDCALL getadpcmdata(ADPCM
         pos = ad->pos;          pos = ad->pos;
         if (!(ad->reg.ctrl2 & 2)) {          if (!(ad->reg.ctrl2 & 2)) {
                 data = ad->buf[(pos >> 3) & 0x3ffff];                  data = ad->buf[(pos >> 3) & 0x3ffff];
                 pos += ADPCM_NBR + 4;  
                 if (!(pos & ADPCM_NBR)) {                  if (!(pos & ADPCM_NBR)) {
                         data >>= 4;                          data >>= 4;
                 }                  }
                   pos += ADPCM_NBR + 4;
         }          }
         else {          else {
                 const BYTE *ptr;                  const BYTE *ptr;
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;

Removed from v.1.3  
changed lines
  Added in v.1.5


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