Re: [hatari-devel] EKO System crash |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] EKO System crash
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Fri, 1 Jan 2021 09:28:08 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1609489690; bh=v4GePOFF9NwPH8Y1sMc+FxsFA0ofgNKt970MQXyVmro=; h=Date:From:To:Subject:From; b=Hk9rHFZ4MW79wOYbhNJtjouuygHnSnk3E9xlHZKj7O2+q2qbCHm325VxQaMJ5IZWI b3KJJEx8+jAwpMn95SSOF/Hy4QKO0rOZmIZhNA2t0Y6xFNzDsUYrp8cW8ynRHKhE0D 6GpCArpgj2lFHsnbCF58B+9rF3hLgDso1YYXdXv+ASOpIb6pHnkr6yC6kuMRoBLFzg pWqgvQKg4JH53sVGdMQgJxfvpxwAfrlZpRuRKVg3lryc5lZs8s054DbA72wLtyyJJ2 8Hufj2a7prpkOUG61S4FoTlbEqHQZ+xmmQgEDGYQcMErmMlQsjPWuKidc21RZp19iE iwhZfepvkomTw==
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