summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti99/colorbus/colorbus.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ti99/colorbus/colorbus.h')
-rw-r--r--src/devices/bus/ti99/colorbus/colorbus.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/devices/bus/ti99/colorbus/colorbus.h b/src/devices/bus/ti99/colorbus/colorbus.h
index c32e242dab8..d0139e4b736 100644
--- a/src/devices/bus/ti99/colorbus/colorbus.h
+++ b/src/devices/bus/ti99/colorbus/colorbus.h
@@ -20,32 +20,29 @@
namespace bus { namespace ti99 { namespace colorbus {
-class ti99_colorbus_device;
+class v9938_colorbus_device;
/********************************************************************
Common parent class of all devices attached to the color bus
********************************************************************/
-class device_ti99_colorbus_interface : public device_slot_card_interface
+class device_v9938_colorbus_interface : public device_slot_card_interface
{
-public:
- virtual void poll(int& delta_x, int& delta_y, int& buttons) = 0;
-
protected:
using device_slot_card_interface::device_slot_card_interface;
virtual void interface_config_complete() override;
- ti99_colorbus_device* m_colorbus = nullptr;
+ v9938_colorbus_device* m_colorbus = nullptr;
};
/********************************************************************
Color bus port
********************************************************************/
-class ti99_colorbus_device : public device_t, public device_slot_interface
+class v9938_colorbus_device : public device_t, public device_slot_interface
{
public:
template <typename U>
- ti99_colorbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, U &&opts, const char *dflt)
- : ti99_colorbus_device(mconfig, tag, owner, clock)
+ v9938_colorbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, U &&opts, const char *dflt)
+ : v9938_colorbus_device(mconfig, tag, owner, clock)
{
option_reset();
opts(*this);
@@ -53,23 +50,27 @@ public:
set_fixed(false);
}
- ti99_colorbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- line_state left_button(); // left button is not connected to the V9938 but to a TMS9901 pin
- void poll();
+ v9938_colorbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ // For the extra button (V9938 only handles 2)
+ auto extra_button_cb() { return m_extra_button.bind(); }
+
+ // Called from the device
+ void movex(int delta);
+ void movey(int delta);
+ void buttons(int bstate);
protected:
- void device_start() override { }
- void device_config_complete() override;
+ void device_start() override;
private:
- device_ti99_colorbus_interface* m_connected;
required_device<v9938_device> m_v9938;
- bool m_left_button_pressed;
+ devcb_write_line m_extra_button;
};
} } } // end namespace bus::ti99::colorbus
-DECLARE_DEVICE_TYPE_NS(TI99_COLORBUS, bus::ti99::colorbus, ti99_colorbus_device)
+DECLARE_DEVICE_TYPE_NS(V9938_COLORBUS, bus::ti99::colorbus, v9938_colorbus_device)
void ti99_colorbus_options(device_slot_interface &device);