mb87078: only update channel latch when dsel is low (nw)

This commit is contained in:
hap 2018-11-06 18:48:34 +01:00
parent 1cc99d3619
commit 044370414f
4 changed files with 11 additions and 6 deletions

View File

@ -96,13 +96,15 @@ void mb87078_device::device_start()
m_data = 0;
m_control = 0;
// invalidate gain index
for (int i = 0; i < 4; i++)
m_gain_index[i] = 0;
m_gain_index[i] = 66;
// output volume table, 0dB to -32dB in steps of -0.5dB
for (int i = 0; i < (64+1); i++)
m_lut_gains[i] = pow(10.0, (-0.5 * i) / 20.0);
m_lut_gains[65] = 0.0; // -infinity
m_lut_gains[66] = m_lut_gains[0];
// register for savestates
save_item(NAME(m_gain_index));
@ -164,10 +166,13 @@ void mb87078_device::data_w(offs_t offset, u8 data)
if (offset & 1)
m_control = data & 0x1f;
else
{
m_data = data & 0x3f;
m_channel_latch[m_control & 3] = (m_control << 4 & 0x1c0) | m_data;
gain_recalc();
// set channel volume gain
m_channel_latch[m_control & 3] = (m_control << 4 & 0x1c0) | m_data;
gain_recalc();
}
}
u8 mb87078_device::data_r(offs_t offset)

View File

@ -35,7 +35,7 @@ protected:
private:
void gain_recalc();
double m_lut_gains[64+2];
double m_lut_gains[64+3];
// internal state
int m_gain_index[4]; // per-channel current index to m_lut_gains

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, Aaron Giles, R. Belmont, hap, Philip Bennett
// copyright-holders:Bryan McPhail, Aaron Giles, R. Belmont, Philip Bennett
/***************************************************************************
Taito Ensoniq ES5505-based sound hardware

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, Aaron Giles, R. Belmont, hap, Philip Bennett
// copyright-holders:Bryan McPhail, Aaron Giles, R. Belmont, Philip Bennett
/***************************************************************************
Taito Ensoniq ES5505-based sound hardware