Re: [hatari-devel] EKO System crash

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


Am Sun, 1 Nov 2020 21:52:29 +0100
schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:

> Le 01/11/2020 à 09:18, Thomas Huth a écrit :
[...]
> >> So, dmaSnd.c should also be modified to use get_word().
> >>
> >> We could add a common function DMA_ReadWord() in m68000.c to be
> >> called by blitter.c / dmaSnd.c / crossbar.c.
> >>
> >> What do you think ?  
> > 
> > Sounds reasonable ... I'm just a little bit afraid that the
> > performance of Hatari might suffer quite a bit, since dma samples
> > are processed quite frequently, so always going through the complex
> > get_word function might slow down things a little bit...?  
> 
> This will add a small overhead, but if we consider 50KHz 16 bit
> stereo sound, we have 100000 words to read per sec, which gives 2000
> words per VBL using these new DMA functions.
> Which is in a fact a rather low number of words if you compare it to
> the words accesses needed to emulate the CPU or the video.
> 
> Also, if we want to handle the cases where DMA accesses bus error 
> regions, or even overlaps RAM and non-RAM region, then I think using
> the usual memory access functions is the safest way to go (if not,
> one would need to use something like 'STMemory_SafeCopy()' which adds
> a lot of 'if' and doesn't support all possible memory region types)
> 
> You can try the attached patch to see if it safely replaces your
> change using "% STRamEnd". It only handles the "play" case, but it's
> easy to use it for "record" too.

OK, I've added the "record" part now, too, and committed the change.

 Thomas



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