[hatari-devel] Fire button freezes Hatari in the Downfall game

Nicolas Pomarède npomarede at corp.free.fr
Fri Dec 24 10:52:11 CET 2010


Le 24/12/2010 01:51, Thomas Huth a écrit :
> On Thu, 23 Dec 2010 09:10:09 +0100
> Thomas Huth<huth at users.berlios.de>  wrote:
>
>> On Wed, 22 Dec 2010 23:41:25 +0100
>> Nicolas Pomarède<npomarede at corp.free.fr>  wrote:
>>
>>>
>>> I think the problem could come from a bad delay in :
>>>
>>>           IKBD_AddKeyToKeyboardBufferWithDelay(0xFD, 35000);
>>>
>>> I will try to give it a look later (unless Thomas got an idea on
>>> this ?)
>>
>> IIRC I once measured most IKBD timings on my real ST, so the problem
>> might be something slightly different. But I also don't have a good
>> clue what might be wrong right now...
>
> Ok, I've fixed it now: As expected, the problem was not due to the
> delay value there, but something different:
> Since it continually issued this command during the title screen,
> Hatari continually tried to put three bytes into the internal keyboard buffer.
> But the game did not consume the bytes as fast as issuing the command,
> so it finally flooded our Keyboard.Buffer ... in the end, we could not put the
> whole packet into the buffer anymore, and the game hang due to these incomplete
> answers.
> To avoid this situation, I've put a check to only execute this command if there
> is enough space left in our Keyboard.Buffer!
>

Interesting, I wonder what a real ikbd does on an ST ?
Does the ikbd stop sending bytes because it detects the 68000 has not 
read the already sent bytes, or does it continuously send the bytes too 
and they overwrite the last byte sent previously ?

Nicolas



More information about the hatari-devel mailing list