summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2025-04-17 14:24:31 +0100
committer smf- <smf-@users.noreply.github.com>2025-04-17 18:29:29 +0100
commit7fc77f3f4c3d4ba696bf384b4ee2cd44010854c6 (patch)
tree1793dc03bd50dee5bf8239d34cdbe237b71a3a22 /src/devices
parentf724192b8599f7ef265eb01c2c6d2f797024e55d (diff)
Work round a race condition in the Compaq i8042 rom. Fixes using ctmouse.exe (v2.1 beta4) in shutms11. [smf]
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/machine/at_keybc.cpp15
-rw-r--r--src/devices/machine/at_keybc.h2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/devices/machine/at_keybc.cpp b/src/devices/machine/at_keybc.cpp
index 98b5b5f6ca1..d4beb3ce68e 100644
--- a/src/devices/machine/at_keybc.cpp
+++ b/src/devices/machine/at_keybc.cpp
@@ -484,6 +484,8 @@ void ps2_keyboard_controller_device::device_start()
{
at_kbc_device_base::device_start();
+ m_aux_irq_timer = timer_alloc(FUNC(ps2_keyboard_controller_device::set_aux_irq_timer_callback), this);
+
save_item(NAME(m_aux_irq));
save_item(NAME(m_aux_clk_in));
save_item(NAME(m_aux_clk_out));
@@ -552,6 +554,17 @@ void ps2_keyboard_controller_device::p2_w(uint8_t data)
if (BIT(data & ~m_p2_data, 4))
set_kbd_irq(1U);
if (BIT(data & ~m_p2_data, 5))
- set_aux_irq(1U);
+ {
+ // HACK: delay raising the aux irq until compaq queues the data
+ if (m_mcu->pcbase() == 0x7ba)
+ m_aux_irq_timer->adjust(attotime::from_hz(clock() / 16));
+ else
+ set_aux_irq(1U);
+ }
m_p2_data = data;
}
+
+TIMER_CALLBACK_MEMBER(ps2_keyboard_controller_device::set_aux_irq_timer_callback)
+{
+ set_aux_irq(1U);
+}
diff --git a/src/devices/machine/at_keybc.h b/src/devices/machine/at_keybc.h
index a65c1a61e72..784ecb803b5 100644
--- a/src/devices/machine/at_keybc.h
+++ b/src/devices/machine/at_keybc.h
@@ -144,11 +144,13 @@ private:
// internal sync helpers
TIMER_CALLBACK_MEMBER(set_aux_clk_in);
TIMER_CALLBACK_MEMBER(set_aux_data_in);
+ TIMER_CALLBACK_MEMBER(set_aux_irq_timer_callback);
// MCU I/O handlers
uint8_t p1_r();
void p2_w(uint8_t data);
+ emu_timer* m_aux_irq_timer;
devcb_write_line m_aux_irq_cb;
devcb_write_line m_aux_clk_cb, m_aux_data_cb;