X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fcli%2Fthrottle.c;h=33941bbe707da99e32451e91ec3ea3d77e71706f;hp=91879aecc0e1e7262ac5f605725150bc2bf8f3d8;hb=2a6855a31daf79cad83545b1eeee646e10481e5e;hpb=5232c20c0fa2c80964fe1d3f597c239bcf93d6fc diff --git a/drivers/cli/throttle.c b/drivers/cli/throttle.c index 91879ae..33941bb 100644 --- a/drivers/cli/throttle.c +++ b/drivers/cli/throttle.c @@ -1,4 +1,5 @@ #include +#include #include "main.h" #include "throttle.h" @@ -7,10 +8,7 @@ static uint64 desiredfps; void RefreshThrottleFPS(void) { - uint64 f=FCEUI_GetDesiredFPS(); - // great, a bit faster than before - //f = (f*65) >> 6; - desiredfps=f>>8; + desiredfps=FCEUI_GetDesiredFPS()>>8; tfreq=1000000; tfreq<<=16; /* Adjustment for fps returned from FCEUI_GetDesiredFPS(). */ } @@ -26,7 +24,7 @@ static uint64 GetCurTime(void) return(ret); } -INLINE void SpeedThrottle(void) +void SpeedThrottle(void) { static uint64 ttime,ltime; @@ -36,6 +34,7 @@ INLINE void SpeedThrottle(void) if( (ttime-ltime) < (tfreq/desiredfps) ) { + usleep(1000); goto waiter; } if( (ttime-ltime) >= (tfreq*4/desiredfps))