Diff for /np2/win9x/soundmng.cpp between versions 1.2 and 1.6

version 1.2, 2003/10/18 10:28:12 version 1.6, 2003/11/28 08:01:33
Line 10 Line 10
 #include        "vermouth.h"  #include        "vermouth.h"
 #endif  #endif
   
   #ifdef __cplusplus
   extern "C" {
   #endif
   void __fastcall satuation_s16mmx(SINT16 *dst, const SINT32 *src, UINT size);
   #ifdef __cplusplus
   }
   #endif
   
   
 #if 1  #if 1
 #define DSBUFFERDESC_SIZE       20                      // DirectX3 Structsize  #define DSBUFFERDESC_SIZE       20                      // DirectX3 Structsize
Line 30  static LPDIRECTSOUNDBUFFER pDSData3; Line 38  static LPDIRECTSOUNDBUFFER pDSData3;
 static  UINT                            dsstreambytes;  static  UINT                            dsstreambytes;
 static  BYTE                            dsstreamevent;  static  BYTE                            dsstreamevent;
 static  LPDIRECTSOUNDBUFFER pDSwave3[SOUND_MAXPCM];  static  LPDIRECTSOUNDBUFFER pDSwave3[SOUND_MAXPCM];
 static  BYTE                            mute;  static  UINT                            mute;
 static  void                            (PARTSCALL *fnmix)(SINT16 *dst,  static  void                            (PARTSCALL *fnmix)(SINT16 *dst,
                                                                                                 const SINT32 *src, UINT size);                                                                                                  const SINT32 *src, UINT size);
   
Line 66  UINT soundmng_create(UINT rate, UINT ms) Line 74  UINT soundmng_create(UINT rate, UINT ms)
         UINT                    samples;          UINT                    samples;
         DSBUFFERDESC    dsbdesc;          DSBUFFERDESC    dsbdesc;
         PCMWAVEFORMAT   pcmwf;          PCMWAVEFORMAT   pcmwf;
 #if defined(VERMOUTH_LIB)  
         UINT                    num;  
 #endif  
   
         if ((pDSound == NULL) ||          if ((pDSound == NULL) ||
                 (rate != 11025) && (rate != 22050) && (rate != 44100)) {                  (rate != 11025) && (rate != 22050) && (rate != 44100)) {
                 goto stcre_err1;                  goto stcre_err1;
         }          }
         if (ms < 50) {          if (ms < 40) {
                 ms = 50;                  ms = 40;
         }          }
         else if (ms > 1000) {          else if (ms > 1000) {
                 ms = 1000;                  ms = 1000;
Line 87  UINT soundmng_create(UINT rate, UINT ms) Line 92  UINT soundmng_create(UINT rate, UINT ms)
         samples = (rate * ms) / 2000;          samples = (rate * ms) / 2000;
         samples = (samples + 3) & (~3);          samples = (samples + 3) & (~3);
         dsstreambytes = samples * 2 * sizeof(SINT16);          dsstreambytes = samples * 2 * sizeof(SINT16);
         fnmix = satuation_s16;          soundmng_setreverse(FALSE);
   
         ZeroMemory(&pcmwf, sizeof(PCMWAVEFORMAT));          ZeroMemory(&pcmwf, sizeof(PCMWAVEFORMAT));
         pcmwf.wf.wFormatTag = WAVE_FORMAT_PCM;          pcmwf.wf.wFormatTag = WAVE_FORMAT_PCM;
Line 110  UINT soundmng_create(UINT rate, UINT ms) Line 115  UINT soundmng_create(UINT rate, UINT ms)
   
 #if defined(VERMOUTH_LIB)  #if defined(VERMOUTH_LIB)
         vermouth_module = midimod_create(rate);          vermouth_module = midimod_create(rate);
         for (num=0; num<128; num++) {          midimod_loadall(vermouth_module);
                 midimod_loadprogram(vermouth_module, num);  
                 midimod_loadrhythm(vermouth_module, num);  
         }  
 #endif  #endif
         dsstreamevent = (BYTE)-1;          dsstreamevent = (BYTE)-1;
         soundmng_reset();          soundmng_reset();
Line 242  void soundmng_sync(void) { Line 244  void soundmng_sync(void) {
   
 void soundmng_setreverse(BOOL reverse) {  void soundmng_setreverse(BOOL reverse) {
   
         fnmix = (reverse)?satuation_s16x:satuation_s16;          if (!reverse) {
                   if (mmxflag) {
                           fnmix = satuation_s16;
                   }
                   else {
                           fnmix = satuation_s16mmx;
                   }
           }
           else {
                   fnmix = satuation_s16x;
           }
 }  }
   
   
Line 447  void soundmng_deinitialize(void) { Line 459  void soundmng_deinitialize(void) {
   
 // ----  // ----
   
 void soundmng_enable(void) {  void soundmng_enable(UINT proc) {
   
         if (mute) {          if (!(mute & (1 << proc))) {
                 mute = 0;                  return;
           }
           mute &= ~(1 << proc);
           if (!mute) {
                 soundmng_reset();                  soundmng_reset();
                 streamenable(TRUE);                  streamenable(TRUE);
         }          }
 }  }
   
 void soundmng_disable(void) {  void soundmng_disable(UINT proc) {
   
         if (!mute) {          if (!mute) {
                 mute = 1;  
                 streamenable(FALSE);                  streamenable(FALSE);
                 pcmstop();                  pcmstop();
         }          }
           mute |= 1 << proc;
 }  }
   

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


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