Re: [hatari-devel] DSP for Previous |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
Am 11.06.2015 um 23:21 schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:
> Le 11/06/2015 23:08, Andreas Grabher a écrit :
>> You're welcome! I found some more problems. But now it seems that the
>> DSP works for me!
>>
>> Most problems i found were related to the interrupt system. It does not
>> reflect real behavior. I think i found most issues, but with this method
>> of doing interrupts we will run into further problems sooner or later. I
>> think it needs to be rewritten. My current patch is just a workaround.
>>
>> Now it works like this:
>> The device sends the interrupt to the DSP like some kind of message. If
>> it is not masked, it is then added to a list. The DSP reads the
>> interrupt from the list, removes it and executes the interrupt service
>> routine. If a masked interrupt is unmasked, the interrupt message needs
>> to be re-sent. If an interrupt is on the list while it gets masked, it
>> needs to be removed from the list. If the service routine does not make
>> the device release the interrupt on first try, it needs to be sent
>> again, if it isn't masked.
>>
>> How it should work:
>> The device asserts the interrupt line. The DSP samples the line and sees
>> the interrupt, if it is not masked. It executes the service routine,
>> which then makes the device release the interrupt line. If a masked
>> interrupt is unmasked, the DSP will start seeing it. If a pending
>> interrupt is masked, the DSP will no longer see it. If the service
>> routine does not make the device release the interrupt, the DSP will
>> keep on seeing it, unless it is masked.
>>
>
>
> Hi
>
> thanks for your patch ; regarding changing the interrupt behaviour, the current one might not be complete, but it seems it doesn't cause failure so far (because demos/programs don't rely on it), so I think we should wait after 1.9 is released before doing big changes in Hatari.
>
> But we certainly need to handle it by having a pending and a mask registers (as for the 680xx), not temporarily as a list ; better go for the good way to handle it, instead of having an intermediate one with lists (and handling mask/pending is in fact much simpler than handling lists of events, resending events, ...)
>
> As for the rest, I think Laurent knows the DSP better than I do :)
>
> Nicolas
>
I see! I also would not change it, if it worked for me ;-)
But in case you want to apply the changes anyway, i appended another little patch. Again this needs to be added manually, as our versions are drifting away. It might be easier to just wait until i'm done and then merge.
In the meantime i tested some things and it seems to work quite well. I love to finally hear sound playing! But while testing i may have found another bug. This time it may be in the DSP logic itself.
If you look at the appended screenshot of a Mandelbrot application you may notice a black line in the middle (vertically) of the DSP (right) window. I can't test on real hardware, but i don't think it should be there.
I tried to get some useful debugging output and think i have copied 2 full loops of what it does. The output is in the appended Mandelbrot debug text.
Maybe someone used to the DSP can see an instruction in the loop that may be responsible for this. Then i think it will be easy to fix.
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |