I thought it could be related to wrong timings, but now I found a way to get better mouse movement with the same timings, so maybe they're right. Below is part of Steem doc. Noticeable is that delays are longer than they should be, and this for one case, Froggies over the Fence. And there's a hack in Hatari for it as well:
Code: Select all
/* TODO : an extra delay of 7000 cycles is necessary to have $81 and $80*/
/* received after the overrun condition was cleared at the 68000 level. */
/* Does it mean some timings are wrong with acia/ikbd ? */
Not sure the delay is the same as in Steem (70 ACIA cycles), but it's the same idea.
In the text below RDRS and TDRS are the shift registers for ACIA's in (RDR) and out respectively (TDR).
ACIA <--> IKBD timings
Data is transmitted at 7812.5 bauds between the ACIA and the HD6301.
7812.5 bit/s, 10bits should translate into 1280 ACIA cycles/byte
(Even less if we should count 8 bits: 1024).
In Steem, we must use 1350 cycles instead, that is 70 cycles more,
or Froggies menu won't work well.
No improvement in ACIA emu could lower this number, so we try and
justify it instead
When the CPU sends $4, IKBD sends 4 bytes.
With adapted timing, 2 bytes are ignored due to ACIA OVR, the
program uses the 2 remaining bytes and it works.
With theoretical timings, 3 bytes are ignored and it's broken.
Possible explanation: there's starting & finishing delay for each byte,
because copying TDR to TDRS and RDRS to RDR takes some time in both chips,
maybe more in one that the other.
Code: Select all
ACIA frequency 1000000
ACIA cycles/byte 1280
TDR->TDRS delay 25
in CPU cycles 200 (value OK for Nightdawn and Hades Nebula)
RDRS->RDR delay 25
in CPU cycles 200
ACIA cycles/byte 1330
MC68000 real frequency 8021248
MC68000 used frequency 8000000
ACIA cycles/byte 1333.53248
More delay in 6301? 16.5
ACIA cycles/byte 1350.03248 (value OK for Froggies over the Fence)
MC68000 cycles/byte 10800.25984
This is speculative.
Anyway, a difference of 70 ACIA cycles isn't too terrible. It looked worse
- WinSTon/Hatari used a "measured" value of 7200 (CPU cycles)
That was the older versions. In current version of Hatari there's a low level
emulation of the ACIA, but we notice a hack for Froggies in it as well, where
the timings are made longer than theory.
- 7812.5 baud is ambiguous, it isn't clear that you must add control bits to
get real speed.