X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=sound.c;h=70ce2d4cc1a63e85fb061284727a87a72a15fb8c;hp=f6e6a34110f90b67b06540d68dd70da0965b76f2;hb=ebde7d27f12cb4e1002670fd481076fb9ba509ff;hpb=778873069e1caaf3afbe7e99b9cefa4f770959c0 diff --git a/sound.c b/sound.c index f6e6a34..70ce2d4 100644 --- a/sound.c +++ b/sound.c @@ -40,6 +40,7 @@ #include "sound.h" uint32 Wave[2048+512]; +int32 WaveHi[40000]; // unused int16 WaveFinalMono[2048+512]; EXPSOUND GameExpSound={0,0,0,0,0,0}; @@ -877,6 +878,8 @@ static int32 flt_acc=0, flt_acc2=0; static void FilterSound(uint32 *in, int16 *outMono, int count) { // static int min=0, max=0; + int sh=2; + if (soundvol < 5) sh += 5 - soundvol; for(;count;count--,in++,outMono++) { @@ -888,7 +891,7 @@ static void FilterSound(uint32 *in, int16 *outMono, int count) flt_acc2+= (int32) (((int64)((diff-flt_acc2)*lowp))>>16); *in=0; - *outMono = flt_acc2*7 >> 2; // * 1.75 + *outMono = flt_acc2*7 >> sh; // * 7 >> 2 = * 1.75 // if (acc2 < min) { printf("min: %i %04x\n", acc2, acc2); min = acc2; } // if (acc2 > max) { printf("max: %i %04x\n", acc2, acc2); max = acc2; } }