heathkit/tlb.cpp Implement interrupt handling for break key (#11406)

This commit is contained in:
Mark Garlanger 2023-07-14 09:03:29 -05:00 committed by GitHub
parent e6e769e7e9
commit 8e4f4c24c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View file

@ -19,6 +19,8 @@
TODO: TODO:
- determine why ULTRA ROM's self-diag (ESC |) fails for the ROM and - determine why ULTRA ROM's self-diag (ESC |) fails for the ROM and
scratchpad memory scratchpad memory
- INS8250 needs to implement "Set Break" (LCR, bit 6) before Break key
will function as expected.
****************************************************************************/ ****************************************************************************/
/*************************************************************************** /***************************************************************************
@ -167,6 +169,7 @@ void heath_tlb_device::device_start()
save_item(NAME(m_reset_key)); save_item(NAME(m_reset_key));
save_item(NAME(m_keyboard_irq_raised)); save_item(NAME(m_keyboard_irq_raised));
save_item(NAME(m_serial_irq_raised)); save_item(NAME(m_serial_irq_raised));
save_item(NAME(m_break_key_irq_raised));
m_strobe = false; m_strobe = false;
m_key_click_active = false; m_key_click_active = false;
@ -176,6 +179,7 @@ void heath_tlb_device::device_start()
m_reset_key = false; m_reset_key = false;
m_keyboard_irq_raised = false; m_keyboard_irq_raised = false;
m_serial_irq_raised = false; m_serial_irq_raised = false;
m_break_key_irq_raised = false;
m_key_click_timer = timer_alloc(FUNC(heath_tlb_device::key_click_off), this); m_key_click_timer = timer_alloc(FUNC(heath_tlb_device::key_click_off), this);
m_bell_timer = timer_alloc(FUNC(heath_tlb_device::bell_off), this); m_bell_timer = timer_alloc(FUNC(heath_tlb_device::bell_off), this);
@ -288,7 +292,8 @@ void heath_tlb_device::serial_irq_w(int state)
void heath_tlb_device::set_irq_line() void heath_tlb_device::set_irq_line()
{ {
m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_maincpu->set_input_line(INPUT_LINE_IRQ0,
(m_keyboard_irq_raised || m_serial_irq_raised) ? ASSERT_LINE : CLEAR_LINE); (m_keyboard_irq_raised || m_serial_irq_raised || m_break_key_irq_raised) ?
ASSERT_LINE : CLEAR_LINE);
} }
void heath_tlb_device::check_for_reset() void heath_tlb_device::check_for_reset()
@ -310,14 +315,14 @@ void heath_tlb_device::check_for_reset()
void heath_tlb_device::reset_key_w(int state) void heath_tlb_device::reset_key_w(int state)
{ {
m_reset_key = (state == CLEAR_LINE); m_reset_key = (state == 0);
check_for_reset(); check_for_reset();
} }
void heath_tlb_device::right_shift_w(int state) void heath_tlb_device::right_shift_w(int state)
{ {
m_right_shift = (state == CLEAR_LINE); m_right_shift = (state == 0);
check_for_reset(); check_for_reset();
} }
@ -328,6 +333,13 @@ void heath_tlb_device::repeat_key_w(int state)
m_repeat_clock->set_duty_cycle(state == CLEAR_LINE ? 0.5 : 0); m_repeat_clock->set_duty_cycle(state == CLEAR_LINE ? 0.5 : 0);
} }
void heath_tlb_device::break_key_w(int state)
{
m_break_key_irq_raised = (state == 0);
set_irq_line();
}
MC6845_UPDATE_ROW(heath_tlb_device::crtc_update_row) MC6845_UPDATE_ROW(heath_tlb_device::crtc_update_row)
{ {
rgb_t const *const palette = m_palette->palette()->entry_list_raw(); rgb_t const *const palette = m_palette->palette()->entry_list_raw();
@ -405,7 +417,7 @@ static INPUT_PORTS_START( tlb )
PORT_START("MODIFIERS") PORT_START("MODIFIERS")
// bit 0 - 0x001 connects to B8 of MM5740 - low if either shift key is // bit 0 - 0x001 connects to B8 of MM5740 - low if either shift key is
PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CapsLock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CapsLock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_PAUSE) PORT_BIT(0x004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_PAUSE) PORT_WRITE_LINE_MEMBER(heath_tlb_device, break_key_w)
PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("OffLine") PORT_CODE(KEYCODE_F12) PORT_TOGGLE PORT_BIT(0x008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("OffLine") PORT_CODE(KEYCODE_F12) PORT_TOGGLE
PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_BIT(0x010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LeftShift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_BIT(0x020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LeftShift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)

View file

@ -35,6 +35,7 @@ public:
void reset_key_w(int state); void reset_key_w(int state);
void right_shift_w(int state); void right_shift_w(int state);
void repeat_key_w(int state); void repeat_key_w(int state);
void break_key_w(int state);
void serial_irq_w(int state); void serial_irq_w(int state);
protected: protected:
@ -100,6 +101,7 @@ private:
bool m_reset_key; bool m_reset_key;
bool m_keyboard_irq_raised; bool m_keyboard_irq_raised;
bool m_serial_irq_raised; bool m_serial_irq_raised;
bool m_break_key_irq_raised;
}; };
class heath_super19_tlb_device : public heath_tlb_device class heath_super19_tlb_device : public heath_tlb_device