mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
Merge pull request #5735 from cam900/ymf278b_fmmix
ymf278b.cpp : Allow scaling for FM DO2 output
This commit is contained in:
commit
609c828890
@ -2615,16 +2615,15 @@ void ymf262_update_one(void *_chip, OPL3SAMPLE **buffers, int length)
|
|||||||
signed int *chanout = chip->chanout;
|
signed int *chanout = chip->chanout;
|
||||||
uint8_t rhythm = chip->rhythm&0x20;
|
uint8_t rhythm = chip->rhythm&0x20;
|
||||||
|
|
||||||
OPL3SAMPLE *ch_a = buffers[0];
|
OPL3SAMPLE *ch_a = buffers[0]; // DO2 (mixed) left output for OPL4
|
||||||
OPL3SAMPLE *ch_b = buffers[1];
|
OPL3SAMPLE *ch_b = buffers[1]; // DO2 (mixed) right output for OPL4
|
||||||
OPL3SAMPLE *ch_c = buffers[2];
|
OPL3SAMPLE *ch_c = buffers[2]; // DO0 (FM only) left output for OPL4
|
||||||
OPL3SAMPLE *ch_d = buffers[3];
|
OPL3SAMPLE *ch_d = buffers[3]; // DO0 (FM only) right output for OPL4
|
||||||
|
|
||||||
for( i=0; i < length ; i++ )
|
for( i=0; i < length ; i++ )
|
||||||
{
|
{
|
||||||
int a,b,c,d;
|
int a,b,c,d;
|
||||||
|
|
||||||
|
|
||||||
advance_lfo(chip);
|
advance_lfo(chip);
|
||||||
|
|
||||||
/* clear channel outputs */
|
/* clear channel outputs */
|
||||||
|
@ -225,6 +225,14 @@ void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t *
|
|||||||
{
|
{
|
||||||
// TODO : FM only output is DO0, DO2 is actually mixed FM+PCM outputs
|
// TODO : FM only output is DO0, DO2 is actually mixed FM+PCM outputs
|
||||||
ymf262_update_one(m_ymf262, outputs, samples);
|
ymf262_update_one(m_ymf262, outputs, samples);
|
||||||
|
vl = m_mix_level[m_fm_l];
|
||||||
|
vr = m_mix_level[m_fm_r];
|
||||||
|
for (i = 0; i < samples; i++)
|
||||||
|
{
|
||||||
|
// DO2 mixing
|
||||||
|
outputs[0][i] = (outputs[0][i] * vl) >> 16;
|
||||||
|
outputs[1][i] = (outputs[1][i] * vr) >> 16;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user