Re: [hatari-devel] ikbd overrun when using midi (Bad Mood for Falcon)

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 11/11/2022 à 00:48, Eero Tamminen a écrit :
Hi,

On 10.11.2022 23.22, Nicolas Pomarède wrote:
as discussed on atari-forum.com, the game Bad Mood by DML shows some error in the sequence of received ikbd bytes, resulting in loss of synchronisation when processing multi-bytes packets (when moving mouse for example)

problem is not reproducible on real Falcon ; under Hatari it happens when midi runs at the same time.

Looking at the code for both ikbd and midi IRQ, I might have an idea of what is causing this.

Eero, as you managed to reproduce the bug on Hatari, can you try the following patch with Bad Mood latest binary and see if any hang in Bad Mood happens after printing those debug lines ""error clearing mfp irq" ?

It's possible some lines are printed and bad mood doesn't hang,

Yes, they do.

 >but I
think than when bad mood hangs this error line should be printed just before.

It looks like that, but I cannot be sure.


I get them, and Douglas' BM HALT, even when MIDI is not enabled in _Hatari_:
---------------------------------------
GEMDOS 0x3E Fclose(68) at PC 0x78F10
error clearing mfp irq for midi but acia irq is still set
error clearing mfp irq for acia but midi irq is still set
error clearing mfp irq for acia but midi irq is still set
error clearing mfp irq for acia but midi irq is still set
error clearing mfp irq for acia but midi irq is still set
error clearing mfp irq for acia but midi irq is still set
error clearing mfp irq for midi but acia irq is still set
error clearing mfp irq for midi but acia irq is still set
RING[14746]: KC:22 KD:00 KP:aa MC:55 MD:-- MS:-- GP:31 I:01
RING[14745]: KC:-- KD:-- KP:-- MC:82 MD:30 MS:-- GP:21 I:01
---------------------------------------

MIDI output needs to be enabled from BM to trigger it though.

There's no problem, and none of those warnings, if MIDI output is disabled in BM.

Hi

that's because MIDI IRQ is only changed when MIDI output is enabled and some bytes are received/sent.

Both ACIAs for IKBD and MIDI have their IRQ line connected to the same GPIP4 pin on the MFP. This means that if any of the 2 ACIAs request an IRQ, then IRQ should be set at the GPIP4 side. On the opposite, IRQ should be cleared on GPIP4 if both ACIAs have their IRQ clear.

There was a bug in Hatari : if one of the 2 ACIAs cleared its IRQ, then it cleared the IRQ on GPIP4, instead of checking if IRQ was still set on the other ACIA and keeping IRQ set on GPIP4 :(

This would definitely create some problems when IKBD and MIDI bytes are sent/received at the same time.

This could be the reason for Bad Mood's loss of IKBD bytes, but also for MidiMaze not working after a while.

Eero, can you check if there's any improvement for these 2 cases ?

Nicolas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/