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

version 1.2, 2003/10/18 09:02:38 version 1.3, 2003/12/08 00:55:33
Line 10  static const UINT adpcmdeltatable[8] = { Line 10  static const UINT adpcmdeltatable[8] = {
                         228,    228,    228,    228,    308,    408,    512,    612};                          228,    228,    228,    228,    308,    408,    512,    612};
   
   
 BYTE SOUNDCALL adpcm_readsample(ADPCM ad) {  REG8 SOUNDCALL adpcm_readsample(ADPCM ad) {
   
         UINT32  pos;          UINT32  pos;
         BYTE    data;          REG8    data;
         BYTE    ret;          REG8    ret;
   
         if ((ad->reg.ctrl1 & 0x60) == 0x20) {          if ((ad->reg.ctrl1 & 0x60) == 0x20) {
                 pos = ad->pos & 0x1fffff;                  pos = ad->pos & 0x1fffff;
Line 24  BYTE SOUNDCALL adpcm_readsample(ADPCM ad Line 24  BYTE SOUNDCALL adpcm_readsample(ADPCM ad
                 }                  }
                 else {                  else {
                         const BYTE *ptr;                          const BYTE *ptr;
                         BYTE bit;                          REG8 bit;
                         UINT tmp;                          UINT tmp;
                         ptr = ad->buf + ((pos >> 3) & 0x7fff);                          ptr = ad->buf + ((pos >> 3) & 0x7fff);
                         bit = 1 << (pos & 7);                          bit = 1 << (pos & 7);
Line 36  BYTE SOUNDCALL adpcm_readsample(ADPCM ad Line 36  BYTE SOUNDCALL adpcm_readsample(ADPCM ad
                         tmp += (ptr[0x28000] & bit) << 5;                          tmp += (ptr[0x28000] & bit) << 5;
                         tmp += (ptr[0x30000] & bit) << 6;                          tmp += (ptr[0x30000] & bit) << 6;
                         tmp += (ptr[0x38000] & bit) << 7;                          tmp += (ptr[0x38000] & bit) << 7;
                         data = (BYTE)(tmp >> (pos & 7));                          data = (REG8)(tmp >> (pos & 7));
                         pos++;                          pos++;
                 }                  }
                 if (pos != ad->stop) {                  if (pos != ad->stop) {
Line 58  BYTE SOUNDCALL adpcm_readsample(ADPCM ad Line 58  BYTE SOUNDCALL adpcm_readsample(ADPCM ad
         return(ret);          return(ret);
 }  }
   
 void SOUNDCALL adpcm_datawrite(ADPCM ad, BYTE data) {  void SOUNDCALL adpcm_datawrite(ADPCM ad, REG8 data) {
   
         UINT32  pos;          UINT32  pos;
   
Line 69  void SOUNDCALL adpcm_datawrite(ADPCM ad, Line 69  void SOUNDCALL adpcm_datawrite(ADPCM ad,
         }          }
         else {          else {
                 BYTE *ptr;                  BYTE *ptr;
                 BYTE bit;                  UINT8 bit;
                 BYTE mask;                  UINT8 mask;
                 ptr = ad->buf + ((pos >> 3) & 0x7fff);                  ptr = ad->buf + ((pos >> 3) & 0x7fff);
                 bit = 1 << (pos & 7);                  bit = 1 << (pos & 7);
                 mask = ~bit;                  mask = ~bit;
Line 136  static void SOUNDCALL getadpcmdata(ADPCM Line 136  static void SOUNDCALL getadpcmdata(ADPCM
         }          }
         else {          else {
                 const BYTE *ptr;                  const BYTE *ptr;
                 BYTE bit;                  REG8 bit;
                 UINT tmp;                  UINT tmp;
                 ptr = ad->buf + ((pos >> 3) & 0x7fff);                  ptr = ad->buf + ((pos >> 3) & 0x7fff);
                 bit = 1 << (pos & 7);                  bit = 1 << (pos & 7);

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


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