summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2013-07-06 20:39:31 +0000
committer Curt Coder <curtcoder@mail.com>2013-07-06 20:39:31 +0000
commite2fef83146ac76c0bc4ea29571cb091d117052df (patch)
tree5d069580e65f529aedcca3263cd51bee047b07d0 /src/mess/machine
parent1e4c01c7e68296c1801e9dd99cf33f017063e26a (diff)
(MESS) Fixed PC/XT keyboard interface. (nw)
Diffstat (limited to 'src/mess/machine')
-rw-r--r--src/mess/machine/genpc.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/src/mess/machine/genpc.c b/src/mess/machine/genpc.c
index cab98efc357..b0d9debb9cd 100644
--- a/src/mess/machine/genpc.c
+++ b/src/mess/machine/genpc.c
@@ -296,29 +296,15 @@ const struct pit8253_interface pc_pit8253_config =
**********************************************************/
WRITE_LINE_MEMBER( ibm5160_mb_device::keyboard_clock_w )
{
- if ( m_ppi_clock_signal != state )
+ if (!m_ppi_keyboard_clear && !state && !m_ppi_shift_enable)
{
- if ( m_ppi_keyb_clock && m_ppi_shift_enable )
- {
- m_ppi_clock_signal = state;
- if ( ! m_ppi_keyboard_clear )
- {
- /* Data is clocked in on a high->low transition */
- if ( ! state )
- {
- UINT8 trigger_irq = m_ppi_shift_register & 0x01;
-
- m_ppi_shift_register = ( m_ppi_shift_register >> 1 ) | ( m_ppi_data_signal << 7 );
- if ( trigger_irq )
- {
- m_pic8259->ir1_w(1);
- m_ppi_shift_enable = 0;
- m_ppi_clock_signal = 0;
- m_pc_kbdc->clock_write_from_mb(m_ppi_clock_signal);
- }
- }
- }
- }
+ m_ppi_shift_enable = m_ppi_shift_register & 0x01;
+
+ m_ppi_shift_register >>= 1;
+ m_ppi_shift_register |= m_ppi_data_signal << 7;
+
+ m_pic8259->ir1_w(m_ppi_shift_enable);
+ m_pc_kbdc->data_write_from_mb(!BIT(m_ppi_portb, 2) && !m_ppi_shift_enable);
}
}
@@ -395,16 +381,17 @@ WRITE8_MEMBER( ibm5160_mb_device::pc_ppi_portb_w )
m_pit8253->gate2_w(BIT(data, 0));
pc_speaker_set_spkrdata( data & 0x02 );
- m_ppi_clock_signal = ( m_ppi_keyb_clock ) ? 1 : 0;
- m_pc_kbdc->clock_write_from_mb(m_ppi_clock_signal);
-
/* If PB7 is set clear the shift register and reset the IRQ line */
if ( m_ppi_keyboard_clear )
{
- m_pic8259->ir1_w(0);
m_ppi_shift_register = 0;
- m_ppi_shift_enable = 1;
+ m_ppi_shift_enable = 0;
+ m_pic8259->ir1_w(m_ppi_shift_enable);
}
+
+ m_pc_kbdc->data_write_from_mb(!BIT(m_ppi_portb, 2) && !m_ppi_shift_enable);
+ m_ppi_clock_signal = ( m_ppi_keyb_clock ) ? 1 : 0;
+ m_pc_kbdc->clock_write_from_mb(m_ppi_clock_signal);
}