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/dsjoy.h | |
parent | e92ac9e0fa8e99869894bea00589bbb526be30aa (diff) |
Move all devices into separate part of src tree (nw)
Diffstat (limited to 'src/devices/bus/centronics/dsjoy.h')
-rw-r--r-- | src/devices/bus/centronics/dsjoy.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/devices/bus/centronics/dsjoy.h b/src/devices/bus/centronics/dsjoy.h new file mode 100644 index 00000000000..a6eec3668ad --- /dev/null +++ b/src/devices/bus/centronics/dsjoy.h @@ -0,0 +1,47 @@ +// license:BSD-3-Clause +// copyright-holders:smf +/*************************************************************************** + + Dempa Shinbunsha Joystick + +***************************************************************************/ + +#ifndef __CENTRONICS_DSJOY_H__ +#define __CENTRONICS_DSJOY_H__ + +#pragma once + +#include "ctronics.h" + +class dempa_shinbunsha_joystick_device : public device_t, + public device_centronics_peripheral_interface +{ +public: + // construction/destruction + dempa_shinbunsha_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_start(); + virtual ioport_constructor device_input_ports() const; + + virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) { if (state) m_data |= 0x01; else m_data &= ~0x01; update_perror(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) { if (state) m_data |= 0x02; else m_data &= ~0x02; update_perror(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) { if (state) m_data |= 0x04; else m_data &= ~0x04; update_perror(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) { if (state) m_data |= 0x08; else m_data &= ~0x08; update_perror(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) { if (state) m_data |= 0x10; else m_data &= ~0x10; update_perror(); } + virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) { if (state) m_data |= 0x20; else m_data &= ~0x20; update_perror(); } + +private: + required_ioport m_lptjoy; + + void update_perror(); + + UINT8 m_data; + int m_perror; +}; + +// device type definition +extern const device_type DEMPA_SHINBUNSHA_JOYSTICK; + +#endif |