[hatari-devel] Little question with relative_interrupts
Thomas Huth
huth at users.berlios.de
Wed Sep 16 22:48:47 CEST 2009
On Wed, 16 Sep 2009 00:35:23 +0200 (CEST)
npomarede at corp.free.fr wrote:
> On Wed, 16 Sep 2009, Laurent Sallafranque wrote:
>
> > Hello,
> >
> > While reading code in int.c and int.h (for the crossbar), I asked
> > me the following question :
> >
> > Extract from int.c
> >
> > Thanks to Arnaud Carre (Leonard / Oxygene) for sharing this method
> > used in Saint (and also
> > used in sc68).
> >
> > Conversions are based on these values :
> > real MFP frequency is 2457600 Hz
> > real CPU frequency is 8021247 Hz (PAL european STF), which we
> > round to 8021248.
> >
> > Then :
> > 8021248 = ( 2^8 * 31333 )
> > 2457600 = ( 2^15 * 3 * 5^2 )
> >
> > So, the ratio 8021248 / 2457600 can be expressed as 31333 / 9600
> >
> >
> > Are these values still OK for a falcon (where the CPU is ~16 000
> > 000 and not 8 021 248 ?
> >
> > If no, would this explain that some demos/games need to run at 32
> > Mhz ?
>
> yes, the current MFP code is adapted to a 68000 cpu and an MFP as
> found in an STF/STE.
>
> Some factors should be applied when the cpu freq is different from
> 8021247 Hz.
int.c always thinks that the CPU runs at 8 MHz. To emulate higher CPU
frequencies, we simply divide the CPU cycles by two or four in
M68000_AddCycles(). This should have the same effect as multiplying the
frequencies by two or four.
Thomas
More information about the hatari-devel
mailing list