diff options
author | 2013-05-14 21:39:57 +0000 | |
---|---|---|
committer | 2013-05-14 21:39:57 +0000 | |
commit | d1ef4803722799d1bd4e32bf85a912e1eddd5a1a (patch) | |
tree | 202d8b62037aaf68d062acec5daf5c1dcac7c6fc /src/mess/machine/pc_joy_sw.h | |
parent | 335de9f804f6665d2ffbc20fa6d2bb4a14b8bdee (diff) |
(mess) pc_joy_sw: add MS Sidewinder pad [Carl]
Diffstat (limited to 'src/mess/machine/pc_joy_sw.h')
-rw-r--r-- | src/mess/machine/pc_joy_sw.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mess/machine/pc_joy_sw.h b/src/mess/machine/pc_joy_sw.h new file mode 100644 index 00000000000..041ab8ad3dc --- /dev/null +++ b/src/mess/machine/pc_joy_sw.h @@ -0,0 +1,36 @@ +#ifndef PC_JOY_SW_H_ +#define PC_JOY_SW_H_ + +#include "machine/pc_joy.h" + +class pc_mssw_pad_device : public device_t, + public device_pc_joy_interface +{ +public: + pc_mssw_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ioport_constructor device_input_ports() const; + + virtual UINT8 btn() { return m_state; } + // timing is guessed, calibrated for at486 + virtual void port_write() { if(!m_active) { m_timer->adjust(attotime::from_usec(50), 0, attotime::from_usec(5)); m_active = true; } } + +protected: + virtual void device_start(); + virtual void device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr); + virtual void device_reset(); + +private: + required_ioport m_btn1; + required_ioport m_btn2; + required_ioport m_btn3; + required_ioport m_btn4; + required_ioport m_conf; + emu_timer *m_timer; + int m_count; + UINT8 m_state; + bool m_active; +}; + +extern const device_type PC_MSSW_PAD; + +#endif /* PC_JOY_SW_H_ */ |