split generic ARM code from gp2x
[fceu.git] / sound.c
diff --git a/sound.c b/sound.c
index 0c60871..f95b050 100644 (file)
--- a/sound.c
+++ b/sound.c
@@ -845,7 +845,7 @@ static void RDoNoise(int32 end)
    }
 }
 
-static DECLFW(Write_IRQFM)
+DECLFW(Write_IRQFM)
 {
  PSG[0x17]=V;
  V=(V&0xC0)>>6;
@@ -877,6 +877,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 +890,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; }
  }
@@ -968,9 +970,7 @@ void ResetSound(void)
         nreg=1;
 }
 
-void (*SetSoundVariables)(void) = 0;
-
-void SetSoundVariables081(void)
+void SetSoundVariables(void)
 {
   int x;