mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
(MESS) Apple II: Add volume control register to DX-1 card. [R. Belmont]
This commit is contained in:
parent
8b285d1e81
commit
937ebdc824
@ -70,10 +70,14 @@ void a2bus_dx1_device::device_start()
|
|||||||
{
|
{
|
||||||
// set_a2bus_device makes m_slot valid
|
// set_a2bus_device makes m_slot valid
|
||||||
set_a2bus_device();
|
set_a2bus_device();
|
||||||
|
|
||||||
|
save_item(NAME(m_volume));
|
||||||
|
save_item(NAME(m_lastdac));
|
||||||
}
|
}
|
||||||
|
|
||||||
void a2bus_dx1_device::device_reset()
|
void a2bus_dx1_device::device_reset()
|
||||||
{
|
{
|
||||||
|
m_volume = m_lastdac = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 a2bus_dx1_device::read_c0nx(address_space &space, UINT8 offset)
|
UINT8 a2bus_dx1_device::read_c0nx(address_space &space, UINT8 offset)
|
||||||
@ -98,10 +102,13 @@ void a2bus_dx1_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data
|
|||||||
switch (offset)
|
switch (offset)
|
||||||
{
|
{
|
||||||
case 5: // volume
|
case 5: // volume
|
||||||
|
m_volume = data;
|
||||||
|
m_dac->write_unsigned16(data*m_lastdac);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
m_dac->write_unsigned8(data);
|
m_lastdac = data;
|
||||||
|
m_dac->write_unsigned16(data*m_volume);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,9 @@ protected:
|
|||||||
virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
|
virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
|
||||||
virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
|
virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
|
||||||
virtual bool take_c800();
|
virtual bool take_c800();
|
||||||
|
|
||||||
|
private:
|
||||||
|
UINT8 m_volume, m_lastdac;
|
||||||
};
|
};
|
||||||
|
|
||||||
// device type definition
|
// device type definition
|
||||||
|
Loading…
Reference in New Issue
Block a user