diff options
Diffstat (limited to 'src/devices/bus/pc_kbd/pc_kbdc.cpp')
-rw-r--r-- | src/devices/bus/pc_kbd/pc_kbdc.cpp | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/src/devices/bus/pc_kbd/pc_kbdc.cpp b/src/devices/bus/pc_kbd/pc_kbdc.cpp index 6bb4c61153e..4eee89f4188 100644 --- a/src/devices/bus/pc_kbd/pc_kbdc.cpp +++ b/src/devices/bus/pc_kbd/pc_kbdc.cpp @@ -25,47 +25,18 @@ The following basic program can be useful for identifying scancodes: // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(PC_KBDC_SLOT, pc_kbdc_slot_device, "pc_kbdc_slot", "PC keyboard port") +DEFINE_DEVICE_TYPE(PC_KBDC, pc_kbdc_device, "pc_kbdc", "PC keyboard connector") //************************************************************************** // LIVE DEVICE //************************************************************************** //------------------------------------------------- -// pc_kbdc_slot_device - constructor -//------------------------------------------------- -pc_kbdc_slot_device::pc_kbdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, PC_KBDC_SLOT, tag, owner, clock), - device_single_card_slot_interface<device_pc_kbd_interface>(mconfig, *this), - m_kbdc_device(nullptr) -{ -} - - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void pc_kbdc_slot_device::device_start() -{ - device_pc_kbd_interface *const pc_kbd = get_card_device(); - if (pc_kbd) - pc_kbd->set_pc_kbdc(m_kbdc_device); -} - - -//************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - -DEFINE_DEVICE_TYPE(PC_KBDC, pc_kbdc_device, "pc_kbdc", "PC KBDC") - - -//------------------------------------------------- // pc_kbdc_device - constructor //------------------------------------------------- pc_kbdc_device::pc_kbdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBDC, tag, owner, clock), + device_single_card_slot_interface<device_pc_kbd_interface>(mconfig, *this), m_out_clock_cb(*this), m_out_data_cb(*this), m_clock_state(-1), @@ -87,8 +58,9 @@ void pc_kbdc_device::set_keyboard(device_pc_kbd_interface *keyboard) //------------------------------------------------- void pc_kbdc_device::device_resolve_objects() { - m_out_clock_cb.resolve_safe(); - m_out_data_cb.resolve_safe(); + device_pc_kbd_interface *const pc_kbd = get_card_device(); + if (pc_kbd) + pc_kbd->set_pc_kbdc(this); } void pc_kbdc_device::device_start() @@ -151,28 +123,28 @@ void pc_kbdc_device::update_data_state(bool fromkb) } -WRITE_LINE_MEMBER(pc_kbdc_device::clock_write_from_mb) +void pc_kbdc_device::clock_write_from_mb(int state) { m_mb_clock_state = state; update_clock_state(false); } -WRITE_LINE_MEMBER(pc_kbdc_device::data_write_from_mb) +void pc_kbdc_device::data_write_from_mb(int state) { m_mb_data_state = state; update_data_state(false); } -WRITE_LINE_MEMBER(pc_kbdc_device::clock_write_from_kb) +void pc_kbdc_device::clock_write_from_kb(int state) { m_kb_clock_state = state; update_clock_state(true); } -WRITE_LINE_MEMBER(pc_kbdc_device::data_write_from_kb) +void pc_kbdc_device::data_write_from_kb(int state) { m_kb_data_state = state; update_data_state(true); @@ -204,12 +176,12 @@ device_pc_kbd_interface::~device_pc_kbd_interface() } -WRITE_LINE_MEMBER(device_pc_kbd_interface::clock_write) +void device_pc_kbd_interface::clock_write(int state) { } -WRITE_LINE_MEMBER(device_pc_kbd_interface::data_write) +void device_pc_kbd_interface::data_write(int state) { } |