mirror of
https://github.com/holub/mame
synced 2025-07-03 00:56:03 +03:00
i8279: Correct keyboard scan rate and logging thereof
pp: Fix shift/control key polarity (nw)
This commit is contained in:
parent
516651c298
commit
5d1ebeb648
@ -159,8 +159,8 @@ void i8279_device::device_reset()
|
|||||||
// from here is confirmed
|
// from here is confirmed
|
||||||
m_cmd[0] = 8;
|
m_cmd[0] = 8;
|
||||||
m_cmd[1] = 31;
|
m_cmd[1] = 31;
|
||||||
logerror("Initial clock = 3100kHz\n");
|
|
||||||
timer_adjust();
|
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
|
// 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.
|
// 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;
|
u32 new_clock = clock() / divider;
|
||||||
|
|
||||||
if (m_scanclock != new_clock)
|
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;
|
m_scanclock = new_clock;
|
||||||
}
|
}
|
||||||
@ -477,8 +477,8 @@ void i8279_device::cmd_w(u8 data)
|
|||||||
case 1:
|
case 1:
|
||||||
if (data > 1)
|
if (data > 1)
|
||||||
{
|
{
|
||||||
logerror("Clock set to %dkHz\n",data*100);
|
|
||||||
timer_adjust();
|
timer_adjust();
|
||||||
|
logerror("Clock set to %.2f kHz\n", m_scanclock / 1000.0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -210,13 +210,13 @@ u8 pp_state::kbd_cols_r()
|
|||||||
READ_LINE_MEMBER(pp_state::cntl_r)
|
READ_LINE_MEMBER(pp_state::cntl_r)
|
||||||
{
|
{
|
||||||
// pin 1 of J13 connector
|
// pin 1 of J13 connector
|
||||||
return (m_modifiers->read() & 0x5) != 0x5;
|
return (m_modifiers->read() & 0x5) == 0x5;
|
||||||
}
|
}
|
||||||
|
|
||||||
READ_LINE_MEMBER(pp_state::shift_r)
|
READ_LINE_MEMBER(pp_state::shift_r)
|
||||||
{
|
{
|
||||||
// pin 3 of J13 connector
|
// 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)
|
WRITE_LINE_MEMBER(pp_state::printer_busy_w)
|
||||||
|
Loading…
Reference in New Issue
Block a user