Re: [hatari-devel] Suggested patch to fix problem handling STOP when DSP is active

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


Le 30/10/2020 à 03:13, Roger Burrows a écrit :
On 29 Oct 2020 at 22:41, Nicolas Pomarède wrote:

But doing it on a 100 cycles basis is not really fully accurate, so I
did the attached patch where DSP_Run is called on each loop during the
STOP state (at the interval where MFP is updated too).

Please check if it improves sound in your case (maybe it will require
more CPU than your patch on every 100 cycles)

OK, I've tested it.  At my normal settings (16MHz system), I can't really tell
any difference between your patch and mine.  Neither is perfect.  The audio
runs a little slow, and there are lots of artifacts, although the main tune is
quite distinct (which it isn't with the unpatched system).

However, if I change to an 8MHz 68030 clock, the sound improves for both
patches - but the sound with my patch is noticeably better.  I think that this
shows that my system is just not fast enough: although reducing the speed of
the emulated 68030 allows more time for everything else to run properly, it's
not quite enough for the extra requirements of the DSP.  Calling Dsp_Run() less
often then makes just enough difference to be noticeable, and is more
beneficial than an increased accuracy of emulation.

I don't think you should pay too much attention to how my system runs.  It's an
AMD Athlon 64 3200+ which has a CPU Mark score of 332.  My Windoze system
(which is by no means new) is an AMD Phenom II X4 955 with a score of 2430 ...

Thanks for all your help!


Patch applied, indeed it requires quite some cpu when DSP is updated much more often (as DSP runs at twice the cpu freq and usually takes less cycle per instruciton than the 68030, we can consider that the DSP can run nearly 6-8 instructions while the CPU runs only one)

It's really important to update DSP every 2 or 4 cycles, because the DSP can trigger some interrupts that could exit the STOP state and some program could expect that the STOP state is exited at a precise time, not something rounded to the next 100 cycles (for example if DSP does some DMA to RAM without handshake, you really need to ensure that CPU and DSP are updated on a very close basis)

As for your old PC, I also have an old Athlon 64X2,not really faster than yours, so I know what you mean :) (but I also built a better PC based on ryzen 3800 some months ago, which really goes fast (fast enough to run DML's "030" Falcon demo) :) )

Nicolas





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