summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/upd4701.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/upd4701.h')
-rw-r--r--src/devices/machine/upd4701.h63
1 files changed, 34 insertions, 29 deletions
diff --git a/src/devices/machine/upd4701.h b/src/devices/machine/upd4701.h
index dcf389ff1c1..a1ecc151331 100644
--- a/src/devices/machine/upd4701.h
+++ b/src/devices/machine/upd4701.h
@@ -37,41 +37,43 @@ public:
template <typename T> void set_porty_tag(T &&tag) { m_porty.set_tag(std::forward<T>(tag)); }
auto cf_cb() { return m_cf_cb.bind(); }
auto sf_cb() { return m_sf_cb.bind(); }
-
- void x_add(s16 data);
- void y_add(s16 data);
-
- DECLARE_WRITE_LINE_MEMBER(cs_w);
- DECLARE_WRITE_LINE_MEMBER(xy_w);
- DECLARE_WRITE_LINE_MEMBER(ul_w);
- DECLARE_WRITE_LINE_MEMBER(resetx_w);
- DECLARE_WRITE_LINE_MEMBER(resety_w);
- DECLARE_READ8_MEMBER(reset_x_r);
- DECLARE_WRITE8_MEMBER(reset_x_w);
- DECLARE_READ8_MEMBER(reset_y_r);
- DECLARE_WRITE8_MEMBER(reset_y_w);
- DECLARE_READ8_MEMBER(reset_xy_r);
- DECLARE_WRITE8_MEMBER(reset_xy_w);
-
- DECLARE_READ8_MEMBER(d_r);
- DECLARE_READ8_MEMBER(read_x);
- DECLARE_READ8_MEMBER(read_y);
- DECLARE_READ8_MEMBER(read_xy);
-
- DECLARE_WRITE_LINE_MEMBER(left_w);
- DECLARE_WRITE_LINE_MEMBER(right_w);
- DECLARE_WRITE_LINE_MEMBER(middle_w);
-
- DECLARE_READ_LINE_MEMBER(cf_r);
- DECLARE_READ_LINE_MEMBER(sf_r);
+ auto open_bus_cb() { return m_open_bus_cb.bind(); }
+
+ void update();
+ void recalibrate();
+
+ void cs_w(int state);
+ void xy_w(int state);
+ void ul_w(int state);
+ void resetx_w(int state);
+ void resety_w(int state);
+ u8 reset_x_r();
+ void reset_x_w(u8 data);
+ u8 reset_y_r();
+ void reset_y_w(u8 data);
+ u8 reset_xy_r();
+ void reset_xy_w(u8 data);
+
+ u8 d_r();
+ u8 read_x(offs_t offset);
+ u8 read_y(offs_t offset);
+ u8 read_xy(offs_t offset);
+
+ void left_w(int state);
+ void right_w(int state);
+ void middle_w(int state);
+
+ int cf_r();
+ int sf_r();
protected:
// device-level overrides
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
private:
// internal helpers
- void analog_update();
+ void x_add(s16 data);
+ void y_add(s16 data);
void switch_update(u8 mask, bool state);
// control lines
@@ -90,6 +92,8 @@ private:
s16 m_starty;
s16 m_x;
s16 m_y;
+ u16 m_last_x_read;
+ u16 m_last_y_read;
// switch state
u8 m_switches;
@@ -99,6 +103,7 @@ private:
bool m_cf;
devcb_write_line m_cf_cb;
devcb_write_line m_sf_cb;
+ devcb_read8 m_open_bus_cb;
};
DECLARE_DEVICE_TYPE(UPD4701A, upd4701_device)