9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] games/gb: fix reversed audio channels
@ 2021-02-08  0:12 Michael Forney
  2021-02-08  4:02 ` qwx
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Forney @ 2021-02-08  0:12 UTC (permalink / raw)
  To: 9front

The high bits correspond to the left channel, and the low bits to the
right channel.

Reference: https://gbdev.io/pandocs/#sound-control-registers

diff 3fc115a6ff6eef65210fb78a51128958d2b55910 9d0249f7a978b4e84f3cd9083f787b4f3f533b41
--- a/sys/src/games/gb/apu.c	Sun Feb  7 15:22:39 2021
+++ b/sys/src/games/gb/apu.c	Sun Feb  7 16:12:28 2021
@@ -115,13 +115,13 @@
 		if(i == 2 ? ((reg[NR30] & 0x80) == 0) : ((*sndch[i].env & 0xf8) == 0))
 			continue;
 		v = sndch[i].samp * 2 - 15;
-		if((cnth & 1<<i) != 0)
-			ov0 += v;
 		if((cnth & 1<<4<<i) != 0)
+			ov0 += v;
+		if((cnth & 1<<i) != 0)
 			ov1 += v;
 	}
-	ov0 *= 1 + (cntl & 7);
-	ov1 *= 1 + (cntl >> 4 & 7);
+	ov0 *= 1 + (cntl >> 4 & 7);
+	ov1 *= 1 + (cntl & 7);
 }
 
 static void

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] games/gb: fix reversed audio channels
  2021-02-08  0:12 [9front] games/gb: fix reversed audio channels Michael Forney
@ 2021-02-08  4:02 ` qwx
  0 siblings, 0 replies; 2+ messages in thread
From: qwx @ 2021-02-08  4:02 UTC (permalink / raw)
  To: 9front

All three gb patches confirmed, checked ok and pushed.

Thanks!!

qwx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-08  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08  0:12 [9front] games/gb: fix reversed audio channels Michael Forney
2021-02-08  4:02 ` qwx

9front - general discussion about 9front

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/9front

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9front 9front/ http://inbox.vuxu.org/9front \
		9front@9front.org
	public-inbox-index 9front

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9front


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git