[hatari-devel] Froggies over the fence
Nicolas Pomarède
npomarede at corp.free.fr
Thu Jul 14 10:58:39 CEST 2011
Le 14/07/2011 02:32, David Savinkoff a écrit :
> On Jul 13, 2011, Nicolas Pomarède<npomarede at corp.free.fr> wrote:
>
>> Hello
>
> <snip>
>
>> I added a workaround to not cancel transits when ACIA is reset, but this
>> seems odd, according to the 6850's doc, a reset should initialize the
>> receive/transmit parts, so I understand it should imply that current
>> transfers are cancelled.
>>
> I looked at ikbd.c and could not determine whether the code emulated
> the double-buffered nature of the RX and TX registers.
> If double-buffering is not emulated, then your workaround appears
> correct for RX but should not be applied to TX.
> Note that the ACIA internally uses a shift register and a latch
> (effectively 2 registers) for each of RX and TX; the latch is not reset.
> I believe the latched TX value is ignored then overwritten the next time
> you send a byte. The RX value can be read as many times as you like.
>
> David
>
Hello
no, ikbd.c doesn't emulate the double buffer. As the code in ikbd.c is
getting rather complex, I prefered not adding it 2 months ago, unless I
found a program that really needs it.
But I didn't found a doc that clearly tells what happens to the latch
and shift register when acia is reset.
In the case of Froggies's menu, move.b #$ff,$fffc02 should set
tx_latch=$ff and tx_shift=$ff.
But if acia is reset before the whole $ff byte was sent to the ikbd,
what happens to tx_shift (that was already partially shifted) ?
Or does it mean that after the reset tx_latch is send again ? But that
seems odd, I would expect tx_latch to be copied in tx_shift only when a
write is detected in tx_latch.
Why do you say the workaround doesn't work for TX ? On the contrary, it
works because the $ff byte to be sent to the ikbd is not canceled.
Well, as I said, acia part should be rewritten after doing various
measures on a real ST, regarding RX and TX delays.
Nicolas
More information about the hatari-devel
mailing list