Diff for /np2/sound/psggeng.c between versions 1.1 and 1.5

version 1.1, 2003/10/16 17:58:05 version 1.5, 2003/10/26 08:59:53
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
   #include        "parts.h"
 #include        "sound.h"  #include        "sound.h"
 #include        "psggen.h"  #include        "psggen.h"
   
Line 19  void SOUNDCALL psggen_getpcm(PSGGEN psg, Line 20  void SOUNDCALL psggen_getpcm(PSGGEN psg,
         UINT    i;          UINT    i;
         UINT    noise;          UINT    noise;
   
         while(count--) {          if ((psg->mixer & 0x3f) == 0) {
                   count = min(count, psg->puchicount);
                   psg->puchicount -= count;
           }
           if (count == 0) {
                   return;
           }
           do {
                 noisevol = 0;                  noisevol = 0;
                 if (psg->envcnt) {                  if (psg->envcnt) {
                         psg->envcnt--;                          psg->envcnt--;
Line 51  void SOUNDCALL psggen_getpcm(PSGGEN psg, Line 59  void SOUNDCALL psggen_getpcm(PSGGEN psg,
                                 countbak = psg->noise.count;                                  countbak = psg->noise.count;
                                 psg->noise.count -= psg->noise.freq;                                  psg->noise.count -= psg->noise.freq;
                                 if (psg->noise.count > countbak) {                                  if (psg->noise.count > countbak) {
                                         psg->noise.base = rand() & (1 << (1 << PSGADDEDBIT));  //                                      psg->noise.base = GETRAND() & (1 << (1 << PSGADDEDBIT));
                                           psg->noise.base = rand_get() & (1 << (1 << PSGADDEDBIT));
                                 }                                  }
                                 noisetbl += psg->noise.base;                                  noisetbl += psg->noise.base;
                                 noisetbl >>= 1;                                  noisetbl >>= 1;
Line 68  void SOUNDCALL psggen_getpcm(PSGGEN psg, Line 77  void SOUNDCALL psggen_getpcm(PSGGEN psg,
                                         case 0:                                                 // no mix                                          case 0:                                                 // no mix
                                                 if (tone->puchi) {                                                  if (tone->puchi) {
                                                         tone->puchi--;                                                          tone->puchi--;
                                                         samp += vol;                                                          samp += vol << PSGADDEDBIT;
                                                 }                                                  }
                                                 break;                                                  break;
   
Line 107  void SOUNDCALL psggen_getpcm(PSGGEN psg, Line 116  void SOUNDCALL psggen_getpcm(PSGGEN psg,
                 pcm[0] += samp;                  pcm[0] += samp;
                 pcm[1] += samp;                  pcm[1] += samp;
                 pcm += 2;                  pcm += 2;
         }          } while(--count);
 }  }
   

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


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