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:
parent
bdfb859480
commit
8e1df5562a
Binary file not shown.
|
@ -63,37 +63,31 @@ static void blip_ch3()
|
||||||
if (sound.channel_three.active)
|
if (sound.channel_three.active)
|
||||||
{
|
{
|
||||||
uint16_t sample;
|
uint16_t sample;
|
||||||
uint8_t shift = (sound.nr32->volume_code == 0 ?
|
uint8_t shift = sound.nr32->volume_code == 0 ? 4 : sound.nr32->volume_code - 1;
|
||||||
4 : sound.nr32->volume_code - 1);
|
|
||||||
|
|
||||||
/* volume is zero in any case */
|
/* volume is zero in any case */
|
||||||
if (shift == 4)
|
if (shift == 4)
|
||||||
sample = 0;
|
sample = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* apply volume change */
|
/* apply volume change */
|
||||||
uint8_t idx = sound.channel_three.index;
|
uint8_t idx = sound.channel_three.index;
|
||||||
uint16_t s;
|
uint16_t s;
|
||||||
|
|
||||||
/* extract current sample */
|
/* extract current sample */
|
||||||
if ((idx & 0x01) == 0)
|
if ((idx & 0x01) == 0)
|
||||||
s = (sound.wave_table[idx >> 1] & 0xf0) >> 4;
|
s = (sound.wave_table[idx >> 1] & 0xf0) >> 4;
|
||||||
else
|
else
|
||||||
s = sound.wave_table[idx >> 1] & 0x0f;
|
s = sound.wave_table[idx >> 1] & 0x0f;
|
||||||
|
|
||||||
/* transform it into signed 16 bit sample */
|
/* transform it into signed 16 bit sample */
|
||||||
sample = ((s * 0x222) >> shift);
|
sample = ((s * 0x222) >> shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sound.nr51->ch3_to_so1)
|
||||||
/* not silence? */
|
BLIP_RIGHT(sample, 2);
|
||||||
if (sample != 0)
|
if (sound.nr51->ch3_to_so2)
|
||||||
{
|
BLIP_LEFT(sample, 2);
|
||||||
if (sound.nr51->ch3_to_so1)
|
|
||||||
BLIP_RIGHT(sample, 2);
|
|
||||||
if (sound.nr51->ch3_to_so2)
|
|
||||||
BLIP_LEFT(sample, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void blip_ch4()
|
static void blip_ch4()
|
||||||
|
|
Loading…
Reference in New Issue