diff options
Diffstat (limited to 'src/devices/bus/sunmouse/sunmouse.cpp')
-rw-r--r-- | src/devices/bus/sunmouse/sunmouse.cpp | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/src/devices/bus/sunmouse/sunmouse.cpp b/src/devices/bus/sunmouse/sunmouse.cpp index 9b59529c54a..15635831ed2 100644 --- a/src/devices/bus/sunmouse/sunmouse.cpp +++ b/src/devices/bus/sunmouse/sunmouse.cpp @@ -72,13 +72,6 @@ DEFINE_DEVICE_TYPE(SUNMOUSE_PORT, sun_mouse_port_device, "sunmouse", "Sun Mouse Port") -int const device_sun_mouse_port_interface::START_BIT_COUNT; -int const device_sun_mouse_port_interface::DATA_BIT_COUNT; -device_serial_interface::parity_t const device_sun_mouse_port_interface::PARITY; -device_serial_interface::stop_bits_t const device_sun_mouse_port_interface::STOP_BITS; -int const device_sun_mouse_port_interface::BAUD; - - sun_mouse_port_device::sun_mouse_port_device( machine_config const &mconfig, @@ -97,7 +90,7 @@ sun_mouse_port_device::sun_mouse_port_device( device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) - , device_slot_interface(mconfig, *this) + , device_single_card_slot_interface<device_sun_mouse_port_interface>(mconfig, *this) , m_rxd(0) , m_rxd_handler(*this) , m_dev(nullptr) @@ -112,41 +105,18 @@ sun_mouse_port_device::~sun_mouse_port_device() void sun_mouse_port_device::device_config_complete() { - m_dev = dynamic_cast<device_sun_mouse_port_interface *>(get_card_device()); -} - - -void sun_mouse_port_device::device_validity_check(validity_checker &valid) const -{ - device_t *const card(get_card_device()); - if (card && !dynamic_cast<device_sun_mouse_port_interface *>(card)) - { - osd_printf_error( - "Card device %s (%s) does not implement device_sun_mouse_port_interface\n", - card->tag(), - card->name()); - } + m_dev = get_card_device(); } void sun_mouse_port_device::device_resolve_objects() { m_rxd = 1; - - m_rxd_handler.resolve_safe(); } void sun_mouse_port_device::device_start() { - if (get_card_device() && !m_dev) - { - throw emu_fatalerror( - "Card device %s (%s) does not implement device_sun_mouse_port_interface\n", - get_card_device()->tag(), - get_card_device()->name()); - } - save_item(NAME(m_rxd)); if (!m_dev) @@ -154,7 +124,7 @@ void sun_mouse_port_device::device_start() } -WRITE_LINE_MEMBER( sun_mouse_port_device::write_txd ) +void sun_mouse_port_device::write_txd(int state) { if (m_dev) m_dev->input_txd(state ? 0 : 1); @@ -163,7 +133,7 @@ WRITE_LINE_MEMBER( sun_mouse_port_device::write_txd ) device_sun_mouse_port_interface::device_sun_mouse_port_interface(machine_config const &mconfig, device_t &device) - : device_slot_card_interface(mconfig, device) + : device_interface(device, "sunmouse") , m_port(dynamic_cast<sun_mouse_port_device *>(device.owner())) { } |