One of the things I would do back in the day was to turn off and on the printer to clear the internal buffer, especially on a runaway print job, so how to do it on the Ap2000?
You can reset the maincpu and that won't quite do it. You can also send an NMI interrupt, and that won't quite do it.
After some experimentation, it seems that you have to do both.
You have to reset the maincpu and then send an NMI interrupt a short while later (minimum 0.9 seconds later).
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Reset Printer") PORT_CODE(KEYCODE_2_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, epson_lx810l_device, reset_printer, 0)
INPUT_CHANGED_MEMBER(epson_lx810l_device::reset_printer)
{
if (newval)
{
m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); // reset cpu
m_e05a30->reset(); // this will generate an NMI interrupt when the e05a30 is ready (minimum 0.9 seconds after reset)
}
}
and then it's not too hard to hook up the centronics init signal to a routine that will pulse the reset line and reset the e05a30 too.
I found a neat little DOS program that would allow init testing:
Parallel Port Debug Tool Version 2.0