code: plan9front

Download patch

ref: 2a1d36928154c3b295510664191d3e47403f73b9
parent: aadbcf0a32c92b1ba4584ad9487854ede43932ca
author: aiju <aiju@phicode.de>
date: Sat Apr 11 12:07:15 EDT 2015

games/gb: limit audio range to prevent clipping

--- a/sys/src/games/gb/apu.c
+++ b/sys/src/games/gb/apu.c
@@ -270,8 +270,8 @@
 	s[1] *= 1 + (cntl >> 4 & 7);
 	
 	if(sbufp < sbuf + nelem(sbuf)){
-		sbufp[0] = s[0] * 60;
-		sbufp[1] = s[1] * 60;
+		sbufp[0] = s[0] * 30;
+		sbufp[1] = s[1] * 30;
 		sbufp += 2;
 	}
 }