summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/pckeybrd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/pckeybrd.cpp')
-rw-r--r--src/devices/machine/pckeybrd.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/devices/machine/pckeybrd.cpp b/src/devices/machine/pckeybrd.cpp
index 015c534327c..3e59b741798 100644
--- a/src/devices/machine/pckeybrd.cpp
+++ b/src/devices/machine/pckeybrd.cpp
@@ -24,8 +24,10 @@
/* AT keyboard documentation comes from www.beyondlogic.org and HelpPC documentation */
-/* to enable logging of keyboard read/writes */
-#define LOG_KEYBOARD 0
+/* for logging of keyboard read/writes */
+#define LOG_KEYBOARD (1U << 1)
+#define VERBOSE (0)
+#include "logmacro.h"
/*
@@ -300,7 +302,7 @@ at_keyboard_device::at_keyboard_device(const machine_config &mconfig, const char
}
-void pc_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(pc_keyboard_device::poll_keys)
{
polling();
if(!charqueue_empty())
@@ -325,16 +327,17 @@ void pc_keyboard_device::device_start()
ioport_accept_char_delegate(&pc_keyboard_device::accept_char, this),
ioport_charqueue_empty_delegate(&pc_keyboard_device::charqueue_empty, this));
- m_out_keypress_func.resolve_safe();
- m_keyboard_timer = timer_alloc();
+ m_keyboard_timer = timer_alloc(FUNC(at_keyboard_device::poll_keys), this);
}
void at_keyboard_device::device_start()
{
- save_item(NAME(m_scan_code_set));
- save_item(NAME(m_input_state));
pc_keyboard_device::device_start();
+
m_leds.resolve();
+
+ save_item(NAME(m_scan_code_set));
+ save_item(NAME(m_input_state));
}
void pc_keyboard_device::device_reset()
@@ -378,8 +381,7 @@ void pc_keyboard_device::enable(int state)
/* insert a code into the buffer */
void pc_keyboard_device::queue_insert(uint8_t data)
{
- if (LOG_KEYBOARD)
- logerror("keyboard queueing %.2x\n",data);
+ LOGMASKED(LOG_KEYBOARD, "keyboard queueing %.2x\n", data);
m_queue[m_head] = data;
m_head++;
@@ -622,8 +624,7 @@ uint8_t pc_keyboard_device::read()
data = m_queue[m_tail];
- if (LOG_KEYBOARD)
- logerror("read(): Keyboard Read 0x%02x\n",data);
+ LOGMASKED(LOG_KEYBOARD, "read(): Keyboard Read 0x%02x\n", data);
m_tail++;
m_tail %= std::size(m_queue);
@@ -690,8 +691,7 @@ SeeAlso: #P046
void at_keyboard_device::write(uint8_t data)
{
- if (LOG_KEYBOARD)
- logerror("keyboard write %.2x\n",data);
+ LOGMASKED(LOG_KEYBOARD, "keyboard write %.2x\n", data);
switch (m_input_state)
{