Previous 199869 Revisions Next

r31151 Tuesday 1st July, 2014 at 02:29:36 UTC by R. Belmont
(MESS) Apple II: Add volume control register to DX-1 card. [R. Belmont]
[src/emu/bus/a2bus]a2dx1.c a2dx1.h

trunk/src/emu/bus/a2bus/a2dx1.c
r31150r31151
7070{
7171   // set_a2bus_device makes m_slot valid
7272   set_a2bus_device();
73
74   save_item(NAME(m_volume));
75   save_item(NAME(m_lastdac));
7376}
7477
7578void a2bus_dx1_device::device_reset()
7679{
80   m_volume = m_lastdac = 0;
7781}
7882
7983UINT8 a2bus_dx1_device::read_c0nx(address_space &space, UINT8 offset)
r31150r31151
98102   switch (offset)
99103   {
100104      case 5:   // volume
105         m_volume = data;
106         m_dac->write_unsigned16(data*m_lastdac);
101107         break;
102108
103109      case 6:
104         m_dac->write_unsigned8(data);
110         m_lastdac = data;
111         m_dac->write_unsigned16(data*m_volume);
105112         break;
106113   }
107114}
trunk/src/emu/bus/a2bus/a2dx1.h
r31150r31151
4141   virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
4242   virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
4343   virtual bool take_c800();
44
45private:
46   UINT8 m_volume, m_lastdac;
4447};
4548
4649// device type definition

Previous 199869 Revisions Next


© 1997-2024 The MAME Team