[hatari-devel] I'm lucky ;) K.prg is working
npomarede at corp.free.fr
npomarede at corp.free.fr
Wed Feb 24 00:15:22 CET 2010
On Tue, 23 Feb 2010, Laurent Sallafranque wrote:
>> Even on a real ST, the sound interrupt can't interrupt an instruction while
> it's being executed, the interrupt will be delayed after the current cpu
> intruction.
>
>> So this can't be the reason why the sound would be good on a real falcon
> and not in hatari, except if some instructions don't have the correct cycles
> count under hatari when compared to a real falcon.
>
>
> We're not speaking of the same thing (or I don't understand anything ;)
>
> I think you speak about timer A, B, C or D.
>
> My timer is an internal Hatari cycint.c timer I use to synchronize sound
> with DSP, DMA , microphone and DAC.
>
> I thought that a 68x00 instruction was about 20 cycles maximum. And as this
> is the base counter for all chipsets emulated, it was a good time counter for
> my needs in crossbar (and for my DSP clock).
In hatari, the behaviour will in fact be the same.
An MFP timer can't interrupt a 680xx instructions, but due to the way
hatari is working, the cpu is driving the master clock and can't be
interrupted on a sub instruction level.
On a real falcon, the bus will be mostly shared between cpu, dma, blitter
and video. In that case those parts are running asynchronously, each one
is waiting for its turn (the blitter can't interrupt the cpu for example)
But the dsp (or even the ikbd in fact) are working independantly of the
main bus and can run synchronously to the cpu. So on a real machine, you
could have some dsp event that occur at the same time that a cpu
instruction is executed. But on Hatari, a cycint's timer will always be
delayed to the end of the current instruction.
So, the longer the cpu instruction is, the more you will delay the
execution of the dsp instructions for a time interval. And then it's true
that when 30 or more cycles are used you might get a non "regular" flow of
dsp instructions.
Unfortunately, many instructions are > 30 cycles (the worst being movem)
That's why only a mode where we split instruction on every 2 cycles can
give the best result, but it's a long way to go.
Nicolas
More information about the hatari-devel
mailing list