|Re: [hatari-devel] Hatari/EmuTOS Conflict|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
On 10/06/2013 15:34, Nicolas Pomarède wrote:
Le 10/06/2013 14:19, David Savinkoff a écrit :
I've been looking at the code in emutos/bios/ikbd.c (line 541) and
code in hatari/src/acia.c (line 279). It appears that Hatari somehow
doesn't succeed in performing the software ACIA reset when
EmuTOS writes 0x03 to 0xFFFFFC02 And the keyboard is attempting
to communicate with the ACIA.
I should have a look at this later with --trace acia, but the code in
Hatari looks correct to me.
I don't see any problem in this part, acia reset is correctly detected
and emutos-cvs-20130604 boots with functional mouse/keyboard, even
without the patch I added to force acia at 9600 bauds on cold start.
Here're the traces :
acia ikbd write fffc00 cr=0x03 video_cyc=59888 452@117 pc=e06b1a
acia ikbd write cr data=0x03 VBL=53 HBL=117
acia ikbd master reset VBL=53 HBL=117
-> reset is made
acia ikbd write fffc00 cr=0x96 video_cyc=59912 476@117 pc=e06b20
acia ikbd write cr data=0x96 VBL=53 HBL=117
acia ikbd start timer divider=64 cpu_cycles=1024 VBL=53 HBL=117
-> acia is initialized at 9600 bauds
ikbd acia get_rx received rsr=0x80 VBL=53 HBL=138
ikbd acia get_rx received rsr=0x01 VBL=53 HBL=158
IKBD_Cmd_Reset VBLs=53 framecyc=80396
ikbd boot rom clear_all=no
ikbd reset done, starting reset timer
ikbd acia get_rx received rsr=0x1a VBL=53 HBL=178
ikbd acia get_rx received rsr=0x12 VBL=53 HBL=198
ikbd cancel commands 0x12 and 0x1a received during reset, enabling
joystick and mouse reporting at the same time
ikbd reset timer completed, resuming ikbd processing VBLs=57 framecyc=47984
So, Hatari looks correct to me.
But there's a problem in Emutos : we can see it still sends 0x1a and
0x12 *during* the reset, which is not correct, it should send them after
getting a 0xf0 or 0xf1 from the ikbd.
in emutos bios/acia.c :
ikbd_version = ikbd_readb(); /* Usually 0xf1, or 0xf0 for antique
ikbd_read doesn't seem to wait for RDRF bit in sr, bytes 0x1a is sent
just after 0x80 0x01 (reset).
Is this version of Emutos CVS really compiled with CONF_WITH_IKBD_ACIA ?
I have the feeling ikbd_readb() returns immediatly without waiting.
Vincent do you know anything about this ?
Maybe this line should be enabled :
560 #if DBG_KBD
561 kprintf("ikbd_version = 0x%02x\n", ikbd_version);
To see if emutos really received 0xf1 or 0xf0, or bypassed the test.