From 937ebdc8240a9c35adefd553259cfcd3f55cf55d Mon Sep 17 00:00:00 2001 From: "R. Belmont" Date: Tue, 1 Jul 2014 02:29:36 +0000 Subject: [PATCH] (MESS) Apple II: Add volume control register to DX-1 card. [R. Belmont] --- src/emu/bus/a2bus/a2dx1.c | 9 ++++++++- src/emu/bus/a2bus/a2dx1.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/emu/bus/a2bus/a2dx1.c b/src/emu/bus/a2bus/a2dx1.c index 68f1ef87158..cb4b191e8c0 100644 --- a/src/emu/bus/a2bus/a2dx1.c +++ b/src/emu/bus/a2bus/a2dx1.c @@ -70,10 +70,14 @@ void a2bus_dx1_device::device_start() { // set_a2bus_device makes m_slot valid set_a2bus_device(); + + save_item(NAME(m_volume)); + save_item(NAME(m_lastdac)); } void a2bus_dx1_device::device_reset() { + m_volume = m_lastdac = 0; } 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) { case 5: // volume + m_volume = data; + m_dac->write_unsigned16(data*m_lastdac); break; case 6: - m_dac->write_unsigned8(data); + m_lastdac = data; + m_dac->write_unsigned16(data*m_volume); break; } } diff --git a/src/emu/bus/a2bus/a2dx1.h b/src/emu/bus/a2bus/a2dx1.h index 970a1b56810..99b9d98193a 100644 --- a/src/emu/bus/a2bus/a2dx1.h +++ b/src/emu/bus/a2bus/a2dx1.h @@ -41,6 +41,9 @@ protected: virtual UINT8 read_c0nx(address_space &space, UINT8 offset); virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data); virtual bool take_c800(); + +private: + UINT8 m_volume, m_lastdac; }; // device type definition