summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/smartboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/smartboard.h')
-rw-r--r--src/devices/machine/smartboard.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/devices/machine/smartboard.h b/src/devices/machine/smartboard.h
new file mode 100644
index 00000000000..73237f2580c
--- /dev/null
+++ b/src/devices/machine/smartboard.h
@@ -0,0 +1,64 @@
+// license:BSD-3-Clause
+// copyright-holders:Sandro Ronco, hap
+/*
+
+ Tasc SmartBoard SB30
+
+*/
+
+#ifndef MAME_MACHINE_SMARTBOARD_H
+#define MAME_MACHINE_SMARTBOARD_H
+
+#pragma once
+
+#include "machine/sensorboard.h"
+
+class tasc_sb30_device : public device_t
+{
+public:
+ tasc_sb30_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
+
+ // configuration helpers
+ auto data_out() { return m_data_out.bind(); } // data_r
+ auto led_out() { return m_led_out.bind(); } // optional, outputs to sb30_ledy.x when not used
+
+ // external read/write lines
+ void reset_w(int state);
+ void data0_w(int state);
+ void data1_w(int state);
+ int data_r() { return m_output; }
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_add_mconfig(machine_config &config) override;
+
+private:
+ required_device<sensorboard_device> m_board;
+ output_finder<8,8> m_out_leds;
+
+ devcb_write_line m_data_out;
+ devcb_write8 m_led_out;
+
+ void scan_board();
+ void update_output();
+ bool piece_available(u8 id);
+ void init_cb(int state);
+ u8 spawn_cb(offs_t offset);
+
+ // i/o lines
+ int m_reset = 0;
+ int m_data0 = 0;
+ int m_data1 = 0;
+ int m_output = 0;
+
+ // internal use
+ u32 m_pos = 0;
+ u8 m_shift = 0;
+ u32 m_squares[64]; // board state
+};
+
+
+DECLARE_DEVICE_TYPE(TASC_SB30, tasc_sb30_device)
+
+#endif // MAME_MACHINE_SMARTBOARD_H