summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/xavix_mtrk_wheel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/xavix_mtrk_wheel.h')
-rw-r--r--src/mame/machine/xavix_mtrk_wheel.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/mame/machine/xavix_mtrk_wheel.h b/src/mame/machine/xavix_mtrk_wheel.h
new file mode 100644
index 00000000000..593fdf4808d
--- /dev/null
+++ b/src/mame/machine/xavix_mtrk_wheel.h
@@ -0,0 +1,40 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+
+#ifndef MAME_MACHINE_XAVIX_MTRK_WHEEL_H
+#define MAME_MACHINE_XAVIX_MTRK_WHEEL_H
+
+#pragma once
+
+#include "machine/timer.h"
+
+DECLARE_DEVICE_TYPE(XAVIX_MTRK_WHEEL, xavix_mtrk_wheel_device)
+
+
+class xavix_mtrk_wheel_device : public device_t
+{
+public:
+ // construction/destruction
+ xavix_mtrk_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ auto event_out_cb() { return m_event_out_cb.bind(); }
+
+ int read_direction();
+ DECLARE_INPUT_CHANGED_MEMBER( changed );
+
+protected:
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual ioport_constructor device_input_ports() const override;
+
+private:
+ devcb_write_line m_event_out_cb;
+ required_ioport m_in;
+ TIMER_CALLBACK_MEMBER(event_timer);
+ emu_timer *m_event_timer;
+ int m_direction;
+ void check_wheel();
+ int m_is_running;
+};
+
+#endif // MAME_MACHINE_XAVIX_MTRK_WHEEL_H