Hi Vas,

I don't know enough about mame's scheduler to really answer how the upd7810 gets scheduled. I see that the upd7810 cpu has a member m_icount and it executes a certain number of instructions inside execute_run().


[Linked Image from i.imgur.com]

Looking at the schematic, it looks like the a2pic is getting a clock from pin 38 on the a2bus which is phi 1 I think, and that's labeled as C1M for 1Mhz.

When the a2pic sets the timer, it uses ticks based on clock() which comes in at 7M (which is pin 36 on the a2bus) which is perhaps 7x too fast.

Code
        m_strobe_timer->adjust(attotime::from_ticks(cycles, clock()));
        LOG("Now remaining = %.9f\n",m_strobe_timer->remaining().as_double());

Code
ack=0  busy=0    datalatched=3f
Time = 26.525418
[:sl1:parallel] /ACK=1
[:sl1:parallel] Active /ACK edge
[:sl1:parallel] Setting acknowledge latch
[:sl1:parallel] Time = 26.525418
[:sl1:parallel] Diff = 0.000026
[:sl1:parallel] Read C0n0
[:sl1:parallel] Write C0n0=3F
[:sl1:parallel] Latch data 3F
[:sl1:parallel] Output /STROBE=0 for 1 cycles
[:sl1:parallel] Time = 26.525616
[:sl1:parallel] Clearing acknowledge latch
[:sl1:parallel] Now remaining = 0.000000140      <<< finding out the remaining time on the timer immediately after setting
WRITE_C004_TIME: time = 1.737467e+02  usec ':sl1:parallel:prn:ap2000:maincpu' (20A0)

nack=1  busy=1    datalatched=3f
Time = 26.525592
[:sl1:parallel] /ACK=0
WRITE_C004_TIME: time = 5.289714e+00  usec ':sl1:parallel:prn:ap2000:maincpu' (20A6)

nack=1  busy=0    datalatched=3f
Time = 26.525597
WRITE_C004_TIME: time = 5.289714e+00  usec ':sl1:parallel:prn:ap2000:maincpu' (20AC)

nack=0  busy=0    datalatched=3f
Time = 26.525603
[:sl1:parallel] /ACK=1
[:sl1:parallel] Active /ACK edge
[:sl1:parallel] Active strobe prevents acknowledge latch from being set
[:sl1:parallel] m_strobe_timer remaining = 0.000013
[:sl1:parallel] attotime::from_ticks(1,clock()) = 0.000000140
[:sl1:parallel] clock = 7159090                          <<<< clock is 7M
[:sl1:parallel] Time = 26.525603
[:sl1:parallel] Diff = -0.000013
[:sl1:parallel] Output /STROBE=1
[:sl1:parallel] Read C0n0
[:sl1:parallel] Write C0n0=3F
[:sl1:parallel] Latch data 3F
[:sl1:parallel] Output /STROBE=0 for 1 cycles
[:sl1:parallel] Time = 26.525839
[:sl1:parallel] Clearing acknowledge latch
[:sl1:parallel] Now remaining = 0.000000140
[:sl1:parallel] Output /STROBE=1
WRITE_C004_TIME: time = 2.398682e+02  usec ':sl1:parallel:prn:ap2000:maincpu' (20A0)

nack=1  busy=1    datalatched=3f
Time = 26.525842


If I let it set the latch even though the strobe is still active, it seems to work perfectly.
Code
    if (m_strobe_timer->enabled())
        {
                LOG("Active strobe prevents acknowledge latch from being set\n");
                LOG("m_strobe_timer remaining = %f\n",m_strobe_timer->remaining().as_double());
                LOG("attotime::from_ticks(1,clock()) = %.9f\n",attotime::from_ticks(1,clock()).as_double());
                LOG("clock = %.9f\n",clock());
                LOG("Time = %f\n",machine().time().as_double());
                LOG("Diff = %f\n",machine().time().as_double()-time1);
                m_ack_latch = 1U;    // let it set the latch anyway
        }

030b_Combined_Enhanced_Graphics.dsk
[Linked Image from i.imgur.com]

Allowing the latch to be set, seems to work with Amperdump (treating the pic as an epson apl)
[Linked Image from i.imgur.com]