From 5d1ebeb648a4fca524e497417d66a4c3d4b8009e Mon Sep 17 00:00:00 2001 From: AJR Date: Mon, 24 Feb 2020 22:22:10 -0500 Subject: i8279: Correct keyboard scan rate and logging thereof pp: Fix shift/control key polarity (nw) --- src/devices/machine/i8279.cpp | 8 ++++---- src/mame/drivers/pp.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/devices/machine/i8279.cpp b/src/devices/machine/i8279.cpp index 47ac639e6bd..c030bae7b1d 100644 --- a/src/devices/machine/i8279.cpp +++ b/src/devices/machine/i8279.cpp @@ -159,8 +159,8 @@ void i8279_device::device_reset() // from here is confirmed m_cmd[0] = 8; m_cmd[1] = 31; - logerror("Initial clock = 3100kHz\n"); timer_adjust(); + logerror("Initial clock = %.2f kHz\n", m_scanclock / 1000.0); } @@ -169,12 +169,12 @@ void i8279_device::timer_adjust() // Real device runs at about 100kHz internally, clock divider is chosen so that // this is the case. If this is too long, the sensor mode doesn't work correctly. - u8 divider = (m_cmd[1]) ? m_cmd[1] : 1; + u8 divider = (m_cmd[1] >= 2) ? m_cmd[1] : 2; u32 new_clock = clock() / divider; if (m_scanclock != new_clock) { - m_timer->adjust(attotime::from_hz(new_clock), 0, attotime::from_hz(new_clock)); + m_timer->adjust(attotime::from_ticks(64, new_clock), 0, attotime::from_ticks(64, new_clock)); m_scanclock = new_clock; } @@ -477,8 +477,8 @@ void i8279_device::cmd_w(u8 data) case 1: if (data > 1) { - logerror("Clock set to %dkHz\n",data*100); timer_adjust(); + logerror("Clock set to %.2f kHz\n", m_scanclock / 1000.0); } break; case 2: diff --git a/src/mame/drivers/pp.cpp b/src/mame/drivers/pp.cpp index a16b62a719b..30ae4f265fd 100644 --- a/src/mame/drivers/pp.cpp +++ b/src/mame/drivers/pp.cpp @@ -210,13 +210,13 @@ u8 pp_state::kbd_cols_r() READ_LINE_MEMBER(pp_state::cntl_r) { // pin 1 of J13 connector - return (m_modifiers->read() & 0x5) != 0x5; + return (m_modifiers->read() & 0x5) == 0x5; } READ_LINE_MEMBER(pp_state::shift_r) { // pin 3 of J13 connector - return (m_modifiers->read() & 0x6) != 0x6; + return (m_modifiers->read() & 0x6) == 0x6; } WRITE_LINE_MEMBER(pp_state::printer_busy_w) -- cgit v1.2.3