WRITE_LINE_MEMBER( e05a30_device::centronics_input_strobe )
{
// using a buffer to hold the incoming data when printer can't keep up.
// This is obviously not correct, but until the answer is found,
// allows the ap2000 to function without dropping characters.
// if (m_centronics_strobe == true && state == false && !m_centronics_busy) {
if (m_centronics_strobe == true && state == false) {
if (m_centronics_data_latched) { // will lose data, so put into buffer
minibuffer[minibufferhead] = m_centronics_data;
minibufferhead ++;
minibufferhead %= minibuffersize;
}
else {
m_centronics_data_latch = m_centronics_data;
m_centronics_data_latched = true;
m_centronics_busy = true;
m_write_centronics_busy(m_centronics_busy);
}
}
m_centronics_strobe = state;
@@ -203,6 +219,15 @@ uint8_t e05a30_device::read(offs_t offset)
case 0x03:
result = m_centronics_data_latch;
m_centronics_data_latched = false;
+
+ if (minibufferhead != minibuffertail) {
+ m_centronics_data_latch = minibuffer[minibuffertail++];
+ minibuffertail %= minibuffersize;
+ m_centronics_data_latched = true;
+ m_centronics_busy = true;
+ m_write_centronics_busy(m_centronics_busy);
+ }
+
break;
case 0x04:
result |= m_centronics_busy << 0;
diff --git a/src/devices/machine/e05a30.h b/src/devices/machine/e05a30.h
index 5dfb51ac81c..d7220c4bc89 100644
--- a/src/devices/machine/e05a30.h
+++ b/src/devices/machine/e05a30.h
@@ -76,6 +76,11 @@ private:
uint8_t m_centronics_strobe;
uint8_t m_centronics_data_latch;
uint8_t m_centronics_data_latched;
+
+ static const int minibuffersize=1e6; // temporary fix for dropping characters
+ int minibuffer[minibuffersize];
+ int minibufferhead;
+ int minibuffertail;
};
DECLARE_DEVICE_TYPE(E05A30, e05a30_device)