Re: [hatari-devel] WinUAE FPU model values options? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
The reason that i did the changes was, that even if i didn't change anything from the preferences it detected an FPU change. Unfortunately i did forget the exact cause of this ... but making our preference values same as the ones from cpu core fixed it. I think it was somehow related to check_prefs_changed_cpu() ...
Am 22.03.2012 um 21:46 schrieb Eero Tamminen:
> Hi,
>
> On torstai 22 maaliskuu 2012, Laurent Sallafranque wrote:
>> At first glance, it seems wrong to me too.
>>
>> If the initial question was : should we reboot when the FPU is changed,
>> I would answear yes.
>> Since now, I've tried to add as little change as possible to the winuae
>> code, to keep updates as easy as possible.
>>
>> Could you explain what this change is supposed to correct ?
>
> Make FPU type values closer to ones used by WinUAE FPU emulation I guess,
> as current Hatari configuration.h enum values for those are 0-3, whereas
> WinUAE seems to be usign values 0, 68881, 68882, 68040 and 68060 for it.
>
> Also, shouldn't FPU_CPU define be renamed either FPU_68040 or FPU_68060?
>
>
> - Eero
>
>> Regards
>>
>> Laurent
>>
>> Le 22/03/2012 20:16, Eero Tamminen a écrit :
>>> Hi,
>>>
>>> On lauantai 17 maaliskuu 2012, Andreas Grabher wrote:
>>>> There's a problem with detection, if a reset is necessary in new cpu
>>>> core. It has been fixed in Previous. Maybe take a look at previous
>>>> sources and FPUTYPE enum in configuration.h and
>>>> M68000_CheckCpuSettings in m68000.c.
>>>
>>> You mean these changes:
>>> http://previous.svn.sourceforge.net/viewvc/previous/trunk/src/includes/
>>> configuration.h?r1=137&r2=149 ?
>>>
>>> Yea, the FPU values given in configuration.h indeed seem wrong:
>>> ---------------
>>> #if ENABLE_WINUAE_CPU
>>> typedef enum
>>> {
>>>
>>> FPU_NONE,
>>> FPU_68881,
>>> FPU_68882,
>>> FPU_CPU
>>>
>>> } FPUTYPE;
>>> #endif
>>> ...
>>>
>>> FPUTYPE n_FPUType;
>>>
>>> ---------------
>>>
>>>
>>> As they're transferred to "fpu_model" and WinUAE code uses these kind
>>> of values for "fpu_model":
>>> ---------------
>>> static int get_fpu_version (void)
>>> {
>>>
>>> int v = 0;
>>>
>>> if (currprefs.fpu_revision>= 0)
>>>
>>> return currprefs.fpu_revision;
>>>
>>> switch (currprefs.fpu_model)
>>> {
>>>
>>> case 68881:
>>> v = 0x1f;
>>> break;
>>>
>>> case 68882:
>>> v = 0x20; /* ??? */
>>> break;
>>>
>>> case 68040:
>>> v = 0x41;
>>> break;
>>>
>>> }
>>> return v;
>>>
>>> }
>>> ---------------
>>> $ grep fpu_model $(find src/ -type f)
>>> src/m68000.c: changed_prefs.fpu_model =
>>> ConfigureParams.System.n_FPUType; src/cpu/custom.c:
>>> p->fpu_model = 68040;
>>> src/cpu/custom.c: p->fpu_model = 68060;
>>> src/cpu/newcpu.c: currprefs.fpu_model = changed_prefs.fpu_model;
>>> src/cpu/newcpu.c: regs.pcr = currprefs.fpu_model == 68060
>>> ? MC68060_PCR : MC68EC060_PCR;
>>> src/cpu/newcpu.c: if (currprefs.fpu_model) {
>>> src/cpu/hatari-glue.c: currprefs.fpu_model = changed_prefs.fpu_model =
>>> ConfigureParams.System.n_FPUType;
>>> src/cpu/fpp.c: if (currprefs.fpu_model == 68060) {
>>> src/cpu/fpp.c: } else if (currprefs.fpu_model == 68040) {
>>> src/cpu/fpp.c: int idle_size = currprefs.fpu_model == 68882 ?
>>> 0x38
>>>
>>> : 0x18;
>>>
>>> src/cpu/fpp.c: if (currprefs.fpu_model == 68060) {
>>> src/cpu/fpp.c: } else if (currprefs.fpu_model == 68040) {
>>> ---------------
>>>
>>> (I left only interesting lines for last part.)
>>>
>>>
>>> Laurent?
>>>
>>> - Eero
>
>
>