Re: [hatari-devel] WinUAE core freeze with ST emulation

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


Hi,

Doing some tests, I've noticed that a part of my code is probably too naive for now.
I mean in newcpu.c

/* Laurent : if 68030 instr cache is on, cycles are computed with head / tail / and cache_cycles
         *           else, cycles are equal to non cache cycles.
         */
        falcon_instr_cycle = regs.ce030_instr_cycles;

if ((currprefs.cpu_model == 68030) && ((r->cacr & 3) == 1)) { // not frozen and enabled
            if (falcon_instr_cycle.head < sav_tail)
curr_cycles = (falcon_instr_cycle.cache_cycles - falcon_instr_cycle.head);
            else
                curr_cycles = (falcon_instr_cycle.cache_cycles - sav_tail);

            sav_tail = falcon_instr_cycle.tail;
        }
        else {
            curr_cycles = falcon_instr_cycle.noncache_cycles;
        }


In fact, I think that if the instruction is not in the cache, it may take some cycles to prefetch, which is not well coded here. Actually, I only test if the cache is active and in this case, I use the "cache cycles" instead of the "non cache cycles"

If I remove all the code in the if condition and only keep the single line :
            curr_cycles = falcon_instr_cycle.noncache_cycles;

The Falcon works as if the cache was not activated.
In this mode, I have 2 or 3 more demos running (I don't remenber the names, but Eero, you noticed them in a previous thread.

Maybe we should comment these lines for now, and recode this better in the next release, no ?

Best regards

Laurent






Le 04/06/2012 23:32, Eero Tamminen a écrit :
Hi,

On maanantai 04 kesäkuu 2012, Thomas Huth wrote:
Ok, thanks for the extensive tests! I think I found and fixed the
problem with extended VDI/GEMDOS now: The problem was how the CPU cores
emulated the CPU internal prefetch ... the code changed between our old
core and WinUAE core.
Could you please do again some regression test to see whether it works
now as expected and take care of the TT FPU (Falcon was not shipped with
a FPU by default, so I think you only have to set it for TT mode).
OK, attached is the winuae patch with CPU prefetch/exact stuff removed,
does it look OK to apply?

I tested your changes with it and now all TOS versions boot fine
with the WinUAE core in all HW configs TOS tester checks!


I guess also some tests with few cycle exact Falcon demos would also
be needed to verify that the changes didn't affect the Falcon emulation
side negatively.


	- Eero




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