ref: d63850570c52ba28a3d5359cc9244f8ee8847099
parent: 96b5d96b90c0d63bb0a5f170671689ea7e99ed5a
author: aiju <aiju@phicode.de>
date: Thu Sep 11 07:20:57 EDT 2014
games/nes: reduce volume, causes overflow and confuses ac97
--- a/sys/src/games/nes/apu.c
+++ b/sys/src/games/nes/apu.c
@@ -225,6 +225,7 @@
audiosample(void)
{
double d;
+ static int i;
if(sbufp == nil)
return;
@@ -231,8 +232,8 @@
d = 95.88 / (8128.0 / (0.01 + pulse(0) + pulse(1)) + 100);
d += 159.79 / (1.0 / (0.01 + tri()/8227.0 + noise()/12241.0 + dmc()/22638.0) + 100.0);
if(sbufp < sbuf + nelem(sbuf) - 1){
- *sbufp++ = d * 20000;
- *sbufp++ = d * 20000;
+ *sbufp++ = d * 10000;
+ *sbufp++ = d * 10000;
}
}