pcat101: housekeeping (nw)

Still doesn't process commands from the host properly - not sure if it's a cpu or port issue.
This commit is contained in:
Patrick Mackinlay 2019-05-16 11:32:06 +07:00
parent a5d54d8a16
commit 3c11bce7e1
2 changed files with 9 additions and 14 deletions

View File

@ -14,7 +14,6 @@
* 1391401 US English 101-key
*
* TODO
* - requires mask rom 6805u3 and timer
* - fix issue receiving commands
*/
@ -46,8 +45,7 @@ const tiny_rom_entry *ibm_pc_at_101_keyboard_device::device_rom_region() const
void ibm_pc_at_101_keyboard_device::device_add_mconfig(machine_config &config)
{
// FIXME: really a 6805U3 (mask ROM, not EPROM) part
M68705U3(config, m_mcu, 4_MHz_XTAL);
M6805U3(config, m_mcu, 4_MHz_XTAL);
// ports A and C control the matrix column select
m_mcu->porta_w().set([this](u8 data) { m_porta = data; });
@ -60,8 +58,8 @@ void ibm_pc_at_101_keyboard_device::device_add_mconfig(machine_config &config)
m_mcu->portb_r().set(FUNC(ibm_pc_at_101_keyboard_device::portb_r));
m_mcu->portb_w().set(FUNC(ibm_pc_at_101_keyboard_device::portb_w));
// TODO: timer is held high
//m_mcu->timer_r().set_constant(1);
// timer is tied high
m_mcu->timer_w(1);
}
INPUT_PORTS_START(ibm_pc_at_101_keyboard)
@ -244,6 +242,9 @@ void ibm_pc_at_101_keyboard_device::device_start()
{
set_pc_kbdc_device();
save_item(NAME(m_porta));
save_item(NAME(m_portc));
m_leds.resolve();
}
@ -254,15 +255,12 @@ void ibm_pc_at_101_keyboard_device::device_reset()
void ibm_pc_at_101_keyboard_device::data_write(int state)
{
m_mcu->set_input_line(M68705_IRQ_LINE, state);
m_mcu->set_input_line(M6805_IRQ_LINE, state);
}
u8 ibm_pc_at_101_keyboard_device::portb_r()
{
if (clock_signal())
return m_portb & ~0x02;
else
return m_portb | 0x02;
return clock_signal() ? 0x00 : 0x02;
}
void ibm_pc_at_101_keyboard_device::portb_w(u8 data)
@ -271,8 +269,6 @@ void ibm_pc_at_101_keyboard_device::portb_w(u8 data)
m_leds[LED_NUM] = BIT(data, 4);
m_leds[LED_SCROLL] = BIT(data, 3);
m_portb = data;
m_pc_kbdc->data_write_from_kb(!BIT(data, 2));
m_pc_kbdc->clock_write_from_kb(!BIT(data, 0));
}

View File

@ -47,12 +47,11 @@ private:
void portb_w(u8 data);
u8 portd_r();
required_device<m68705_device> m_mcu;
required_device<m6805u3_device> m_mcu;
required_ioport_array<16> m_matrix;
output_finder<3> m_leds;
u8 m_porta;
u8 m_portb;
u8 m_portc;
};