Re: [hatari-devel] rev 3689 : splitting cpu cycles above 20

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


On 07/01/2012 00:28, Laurent Sallafranque wrote:



Le 07/01/2012 00:13, Nicolas Pomarède a écrit :

What you really need is not call dsp_run more often *after* the cpu
emulation, it's to call dsp_run every 4 or 8 cycles *while* emulating
*every* cpu instructions (the same things that winuae does in the most
precise 68000 cycle exact mode).

But doing that is really complicated, because you need to know the
inner working of each 68030 instruction, and that's unfortunately not
described in any official doc.


Yes, I agree here.
For now, I don't try to be that accurate (and it wouldn't make sense
from my point of view, as DSP and 68030 are working with different clocks).
This kind of optimisations would be for a specific case and would
necessite a lot of energy to code it.

I'm more trying to have a "cycle accurate" 68030 because it's it who
drives all the other components (and the DSP).


OK, but we should avoid putting "test" code that don't have a really measurable impact in the source tree. Else, it's difficult for other people that might want to help to understand the way emulation works.

If the while has no effect (which is what I think in almost every case), then we should remove it ; it adds unncessary code to the cpu emulation (which is already quite complicated :) )


I'm soon going to start the videl emu.
I already tried it once last year, but there's a problem for now : the
video code is too much melted in many hatari functions.
I don't want to add some if falcon else STE everywhere in hatari to
point on the videl code or the video code.
(I managed to split properly crossbar and stedma sound, because SteDma
sound was not too much melted into hatari's source.

Video source is a nightmare (it's called from too much other sources).

Do you think it would be possible to separate the calls of video.c
before I split, just to do it cleanly ?

Yes, it's possible. But you would need to list what functions you want to split according to your code, so I can give a look.

In my opinion, there shouldn't be that much code to split :
 - vbl
 - hbl
 - timer b interrupt

with 3 specific falcon functions for this, I think it should be fine to do a lot of the videl emuation (and then call the usual functions to display the resulting pixels on screen)


Nicolas



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