notaz.gp2x.de
/
fceu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed: broken fs0, sram saves
[fceu.git]
/
drivers
/
cli
/
throttle.c
diff --git
a/drivers/cli/throttle.c
b/drivers/cli/throttle.c
index
91879ae
..
33941bb
100644
(file)
--- a/
drivers/cli/throttle.c
+++ b/
drivers/cli/throttle.c
@@
-1,4
+1,5
@@
#include <sys/time.h>
#include <sys/time.h>
+#include <unistd.h>
#include "main.h"
#include "throttle.h"
#include "main.h"
#include "throttle.h"
@@
-7,10
+8,7
@@
static uint64 desiredfps;
void RefreshThrottleFPS(void)
{
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(). */
}
tfreq=1000000;
tfreq<<=16; /* Adjustment for fps returned from FCEUI_GetDesiredFPS(). */
}
@@
-26,7
+24,7
@@
static uint64 GetCurTime(void)
return(ret);
}
return(ret);
}
-
INLINE
void SpeedThrottle(void)
+void SpeedThrottle(void)
{
static uint64 ttime,ltime;
{
static uint64 ttime,ltime;
@@
-36,6
+34,7
@@
INLINE void SpeedThrottle(void)
if( (ttime-ltime) < (tfreq/desiredfps) )
{
if( (ttime-ltime) < (tfreq/desiredfps) )
{
+ usleep(1000);
goto waiter;
}
if( (ttime-ltime) >= (tfreq*4/desiredfps))
goto waiter;
}
if( (ttime-ltime) >= (tfreq*4/desiredfps))