From 415c110b284bdd519e6dedcfea97e45edcb8977a Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 8 Feb 2021 04:58:49 +0100 Subject: games/gb: fix reversed audio channels The high bits correspond to the left channel, and the low bits to the right channel. Reference: https://gbdev.io/pandocs/#sound-control-registers Tested with pokemon crystal. --- sys/src/games/gb/apu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/src/games/gb/apu.c b/sys/src/games/gb/apu.c index 900f7e793..e0862ebdf 100644 --- a/sys/src/games/gb/apu.c +++ b/sys/src/games/gb/apu.c @@ -115,13 +115,13 @@ filter(int t) if(i == 2 ? ((reg[NR30] & 0x80) == 0) : ((*sndch[i].env & 0xf8) == 0)) continue; v = sndch[i].samp * 2 - 15; - if((cnth & 1<> 4 & 7); + ov0 *= 1 + (cntl >> 4 & 7); + ov1 *= 1 + (cntl & 7); } static void -- cgit v1.2.3