diff options
author | 2015-09-13 08:41:44 +0200 | |
---|---|---|
committer | 2015-09-13 08:41:44 +0200 | |
commit | f88cefad27a1737c76e09d99c9fb43e173506081 (patch) | |
tree | 2d8167d03579c46e226471747eb4407bd00ed6fa /src/devices/bus/centronics/covox.h | |
parent | e92ac9e0fa8e99869894bea00589bbb526be30aa (diff) |
Move all devices into separate part of src tree (nw)
Diffstat (limited to 'src/devices/bus/centronics/covox.h')
-rw-r--r-- | src/devices/bus/centronics/covox.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/devices/bus/centronics/covox.h b/src/devices/bus/centronics/covox.h new file mode 100644 index 00000000000..c4d3d3ea94a --- /dev/null +++ b/src/devices/bus/centronics/covox.h @@ -0,0 +1,94 @@ +// license:BSD-3-Clause +// copyright-holders:Miodrag Milanovic +/*************************************************************************** + + Covox Speech Thing + +***************************************************************************/ + +#ifndef __CENTRONICS_COVOX_H__ +#define __CENTRONICS_COVOX_H__ + +#pragma once + +#include "ctronics.h" +#include "sound/dac.h" + +// ======================> centronics_covox_device + +class centronics_covox_device : public device_t, + public device_centronics_peripheral_interface +{ +public: + // construction/destruction + centronics_covox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + +protected: + // device-level overrides + virtual void device_start(); + + virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) { if (state) m_data |= 0x01; else m_data &= ~0x01; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) { if (state) m_data |= 0x02; else m_data &= ~0x02; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) { if (state) m_data |= 0x04; else m_data &= ~0x04; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) { if (state) m_data |= 0x08; else m_data &= ~0x08; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) { if (state) m_data |= 0x10; else m_data &= ~0x10; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) { if (state) m_data |= 0x20; else m_data &= ~0x20; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data6 ) { if (state) m_data |= 0x40; else m_data &= ~0x40; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data7 ) { if (state) m_data |= 0x80; else m_data &= ~0x80; update_dac(); } + +private: + required_device<dac_device> m_dac; + + void update_dac(); + + UINT8 m_data; +}; + +// device type definition +extern const device_type CENTRONICS_COVOX; + +// ======================> centronics_covox_stereo_device + +class centronics_covox_stereo_device : public device_t, + public device_centronics_peripheral_interface +{ +public: + // construction/destruction + centronics_covox_stereo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + +protected: + // device-level overrides + virtual void device_start(); + + virtual DECLARE_WRITE_LINE_MEMBER( input_strobe ) { m_strobe = state; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) { if (state) m_data |= 0x01; else m_data &= ~0x01; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) { if (state) m_data |= 0x02; else m_data &= ~0x02; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) { if (state) m_data |= 0x04; else m_data &= ~0x04; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) { if (state) m_data |= 0x08; else m_data &= ~0x08; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) { if (state) m_data |= 0x10; else m_data &= ~0x10; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) { if (state) m_data |= 0x20; else m_data &= ~0x20; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data6 ) { if (state) m_data |= 0x40; else m_data &= ~0x40; update_dac(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data7 ) { if (state) m_data |= 0x80; else m_data &= ~0x80; update_dac(); if (started()) output_busy(state); } + virtual DECLARE_WRITE_LINE_MEMBER( input_autofd ) { m_autofd = state; update_dac(); } + +private: + required_device<dac_device> m_dac_left; + required_device<dac_device> m_dac_right; + + void update_dac(); + + int m_strobe; + UINT8 m_data; + int m_autofd; +}; + +// device type definition +extern const device_type CENTRONICS_COVOX_STEREO; + +#endif /* __CENTRONICS_COVOX_H__ */ |