Pizza: Fix bug that broke sound channel 3 in certain cases. Bug was introduced by the porting process and does not exist in original core.

This commit is contained in:
nattthebear 2017-07-01 09:38:20 -04:00
parent bdfb859480
commit 8e1df5562a
2 changed files with 21 additions and 27 deletions

Binary file not shown.

View File

@ -63,8 +63,7 @@ static void blip_ch3()
if (sound.channel_three.active)
{
uint16_t sample;
uint8_t shift = (sound.nr32->volume_code == 0 ?
4 : sound.nr32->volume_code - 1);
uint8_t shift = sound.nr32->volume_code == 0 ? 4 : sound.nr32->volume_code - 1;
/* volume is zero in any case */
if (shift == 4)
@ -85,17 +84,12 @@ static void blip_ch3()
sample = ((s * 0x222) >> shift);
}
/* not silence? */
if (sample != 0)
{
if (sound.nr51->ch3_to_so1)
BLIP_RIGHT(sample, 2);
if (sound.nr51->ch3_to_so2)
BLIP_LEFT(sample, 2);
}
}
}
static void blip_ch4()
{
if (sound.channel_four.active)