Ap2000 fixes to get it to start up properly; Also adding green ready led indicator to printhead box to see status. (#7079)

ap2000: Fixes to get it to start up properly
- Proper initialization NMI delay
- Make printhead display ready status
This commit is contained in:
goldnchild 2020-08-15 12:22:17 -07:00 committed by GitHub
parent b27ad435a8
commit fb81629f73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -179,6 +179,8 @@ static INPUT_PORTS_START( epson_lx810l )
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_9_PAD)
PORT_START("LOADEJECT")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Load/Eject") PORT_CODE(KEYCODE_1_PAD)
PORT_START("PAPEREND")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Paper End Sensor") PORT_CODE(KEYCODE_6_PAD)
/* DIPSW1 */
PORT_START("DIPSW1")
@ -376,10 +378,11 @@ uint8_t epson_lx810l_device::porta_r(offs_t offset)
{
uint8_t result = 0;
uint8_t hp_sensor = m_cr_pos_abs <= 0 ? 0 : 1;
uint8_t pe_sensor = m_pf_pos_abs <= 0 ? 1 : 0;
//uint8_t pe_sensor = m_pf_pos_abs <= 0 ? 1 : 0;
result |= hp_sensor; /* home position */
result |= pe_sensor << 1; /* paper end */
//result |= pe_sensor << 1; /* paper end */
result |= ioport("PAPEREND")->read() << 1; // simulate a paper out error
result |= ioport("LINEFEED")->read() << 6;
result |= ioport("FORMFEED")->read() << 7;
@ -517,7 +520,8 @@ void epson_lx810l_device::cr_stepper(uint8_t data)
WRITE_LINE_MEMBER( epson_lx810l_device::e05a30_ready )
{
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::from_double(0.09)); // must be longer than attotime::zero
// 0.09 is minimum to initialize properly
}
@ -531,7 +535,9 @@ uint32_t epson_lx810l_device::screen_update_lx810l(screen_device &screen, bitmap
copyscrollbitmap(bitmap, m_bitmap, 0, nullptr, 1, &scrolly, cliprect);
/* draw "printhead" */
bitmap.plot_box(m_real_cr_pos + CR_OFFSET - 10, PAPER_HEIGHT - 36, 20, 36, 0x888888);
int bordersize = 1;
bitmap.plot_box(m_real_cr_pos + CR_OFFSET - 10 - bordersize, PAPER_HEIGHT - 36 - bordersize, 20 + bordersize * 2, 36 + bordersize * 2, 0x000000 );
bitmap.plot_box(m_real_cr_pos + CR_OFFSET - 10, PAPER_HEIGHT - 36, 20, 36, m_e05a30->ready_led() ? 0x55ff55 : 0x337733 );
return 0;
}

View File

@ -39,6 +39,8 @@ public:
DECLARE_WRITE_LINE_MEMBER( centronics_input_data6 ) { if (state) m_centronics_data |= 0x40; else m_centronics_data &= ~0x40; }
DECLARE_WRITE_LINE_MEMBER( centronics_input_data7 ) { if (state) m_centronics_data |= 0x80; else m_centronics_data &= ~0x80; }
int ready_led() { return !m_centronics_busy; }
protected:
// device-level overrides
virtual void device_start() override;