[hatari-devel] I'm lucky ;) K.prg is working
npomarede at corp.free.fr
npomarede at corp.free.fr
Tue Feb 23 23:11:57 CET 2010
On Tue, 23 Feb 2010, Eero Tamminen wrote:
> Hi,
>
> On Tuesday 23 February 2010, npomarede at corp.free.fr wrote:
>> On Tue, 23 Feb 2010, Laurent Sallafranque wrote:
>>> OK, I'll try all these tests tonight.
>>> But just a last question :
>>>
>>> Why shouldn't we execute some DSP code if there was an exception or
>>> interrupt ?
>>> (the return after do_specialties ())
>>
>> You're right, I didn't pay attention to this, but this is obviously wrong
>> to return without running the dsp part.
>
> If you check what do_specialties() does, it causes return only in two cases:
> 1. CPU type is changed (causes reset I think)
> 2. Quit request from user (click to close button, AltGr+Q, quit in debugger)
>
> So I don't see how it could be causing K to work or not to work.
>
> As user can in some 2) cases cancel the quit, it's correct to
> still run DSP though.
I spent some time on the dsp code there, as you noted the problem was not
in the fact that DSP_Run is not called before returning, as we can
consider that m68k_run_1 never return in normal condition.
I don't think it's useful to call DSP_Run before returning in case a 'quit
request' is received ; at most this will mean some dsp instructions will
be called one CPU instructions later, which is quite harmless (the code in
m68k_run_1 is already quite complicated).
See other post for case 1)
>
>
>> But moving dsp code block is not completly correct, because at that point
>> (before do_specialites) "cycles" doesn't take into account the number of
>> cycles generated by the exception.
>
> But as DSP is running in real HW at the same time as CPU, it in Hatari
> waiting for exceptions isn't necessarily right either...
Yes, that's the problem where hatari's "clock" is the cpu, while on the
real machine it's the bus : we can't run both cpu and dsp in a synchronous
way, but if we correctly run then one after the other, there should be
minimal impact (but some things can't be emulated this way of course)
Nicolas
More information about the hatari-devel
mailing list