[hatari-devel] Hatari CPU frequency shifter issue
Laurent Sallafranque
laurent.sallafranque at free.fr
Sun Jan 30 00:25:32 CET 2011
Hi Eero,
Give me a day or two to have a look at your patch, please.
Regards
Laurent
Le 29/01/2011 21:59, Eero Tamminen a écrit :
> Hi,
>
> On perjantai 28 tammikuu 2011, Eero Tamminen wrote:
>>> Actually, no memory snapshots are required.
>>>
>>> Just opening and closing the Hatari Options menu breaks the Mahab demo
>>> for me.
>> F12 + Enter does it. Canceling the Options menu with Esc doesn't have
>> any issues.
>>
>> After iterating this a lot with debug prints, I found out that
>> although no options were changed, this code in
>> configuration.c::Configuration_Apply():
> ...
>> Changes the nCpuFreqShift from zero to one and that breaks (freezes)
>> Mahab.
>>
>> If Hatari is started with something else than --machine st/ste,
>> nCpuFreqShift is non-zero and Mahab won't even start.
>>
>> I strongly think that above code should be moved to
>> M68000_CheckCpuLevel() which is called both by TOS switch and
>> Configuration_Apply() code. Rest of the CPU related checks are anyway
>> done there already.
>>
>> Does anybody have any objections for this?
> Patch attached. With this it made sense to rename the function too
> and re-ordering the lines in tos.c makes it a bit clearer what affects what.
>
> This fixes Hatari to always work the same way (as it should) regardless of
> TOS version changes and means that Mahab demo doesn't anymore work
> when using the old UAE core (even when starting with ST emulation).
>
>
>> As to nCpuFreqShift variable, besides above code, it's referenced only in
>> following places:
>> ----------
>> ./includes/m68000.h:extern int nCpuFreqShift;
>> ./includes/m68000.h: cycles = cycles>> nCpuFreqShift;
>> ./includes/m68000.h: cycles = cycles>> nCpuFreqShift;
>> ./m68000.c:int nCpuFreqShift; /* Used to emulate higher CPU
>> frequencies: 0=8MHz, 1=16MHz, 2=32Mhz */
>> ./blitter.c: nCyclesMainCounter += all_cycles>> nCpuFreqShift;
>> ./blitter.c:
>> CycInt_AddRelativeInterrupt((CurrentInstrCycles+nWaitStateCycles)>>nCpuFr
>> eqShift, ----------
>>
>> Because Mahab works fine with it being zero and breaks when it's
>> non-zero, maybe DSP cycle count isn't taking it into account properly?
> Laurent?
>
>
> - Eero
>
>
> _______________________________________________
> hatari-devel mailing list
> hatari-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/hatari-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20110130/cd3fc342/attachment.html>
More information about the hatari-devel
mailing list