From: Michael Forney <mforney@mforney.org>
To: 9front@9front.org
Subject: [9front] games/gb: fix reversed audio channels
Date: Mon, 08 Feb 2021 00:12:28 +0000 [thread overview]
Message-ID: <6E7E5BB481C0829E09FCC1A4BB6964E7@arrow.hsd1.ca.comcast.net> (raw)
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
next reply other threads:[~2021-02-08 3:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 0:12 Michael Forney [this message]
2021-02-08 4:02 ` qwx
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6E7E5BB481C0829E09FCC1A4BB6964E7@arrow.hsd1.ca.comcast.net \
--to=mforney@mforney.org \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).