Re: [hatari-devel] Data cache Issues? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
On perjantai 05 kesäkuu 2015, Nicolas Pomarède wrote:
> Le 04/06/2015 21:39, Eero Tamminen a écrit :
> > With this change, B-o-R game and Yepyha & Firestarter demos work.
> >
> > Whether issues are bug(s) in emulation or just related to timings
> > changing slightly with data caches, I don't know. At least
> > none of these programs needs DSP, so it shouldn't be related to
> > CPU<->DSP timings.
>
> I think this is now fixed ; although loading data directly in RAM for
> gemdos HD emulation was very likely to cause a mismatch between current
> cache and new RAM content, which required to flush the data cache,
> writing directly to RAM could also cause mismatches between instruction
> cache and real program (that's less likely but still possible, which is
> why the crash were random)
>
> In that case, as instruction cache was not flushed it could contain code
> dating before writing to RAM, so we would execute some wrong 680xx
> program because we prefetch some old 16 bit words.
>
> I changed this to clear both data and instruction caches
I think it should be enough to do that only for Fread(), as only
that can be used to load code into memory.
(I.e. there might be separate functions for data & instruction
cache invalidation, and in future also for 040 data cache flushing.)
Note: Debugger's binary data load functions will also need to flush
instruction cache for the same reason. Currently they just use
STMemory memory write functions.
> and I can now
> run Virtual City in prefetch/compatible or CE modes (those 2 modes make
> use of the instruction cache)
The version I had still bombs, but then I loaded the version from pouet.net,
and that works fine. On comparing them, the version I had was packed with
JAM packer. I threw that away as apparently it's also causing the issues
with autostart + >4MB memory consumption.
I updated Hatari docs accordingly.
> Please test again with Beats Of Rage and your other demos, it should
> hopefully work better.
They still don't work.
Firestarter is packed with Sentry 2.2.
I found another demo that doesn't work with caches, but works
by changing cancahe030():
http://www.pouet.net/prod.php?which=13601
- Eero