That's really cool, does it work in Metroid Prime? (E.g. Limiting frames to 30 instead of 50/60, keepinig speed at full)
i dont know, only got the 4 games i wrote for testing.
but you can compile it yourself to test it.
at the moment its 75% chance that it works
edit : made a new one.
the old one changes waitingtime only once a second.
The new one uses each new frametime for cpu-suspend.
This produces much more stable FPS + will not cause any slowdown if game runs slower then choosen framelimit.
still, SSBM does not work. other 3 games work very well.
Code:
[b]static u32 targetfps = 30;
static u64 old_frametime=0;
u64 new_frametime;
s16 wait_frametime;[/b]
frames++;
[b]new_frametime=Timer.GetTimeDifference()-old_frametime;
old_frametime=Timer.GetTimeDifference();
wait_frametime=((1000/targetfps)-new_frametime)-1;
if (wait_frametime>0)
Common::SleepCurrentThread(wait_frametime*2);
[/b]
if (Timer.GetTimeDifference() >= 1000)
{
[b]old_frametime=0;[/b]
included it into main config window.
Few screens attached.
to compare : with "other audio on" its 18fps with 100% cpu use
[
attachment=535][
attachment=536][
attachment=537]
still need help with the thread management.
it seems "CurrentThread" isn't enough for every game. but i have no idea which threads are running and how i can make them go to sleep.
can you compile the lastest version of dolphin, with that plz?
To test, if my games work too =p
and this is one great think that MUST be implemented in googlecode, to the official dolphin project =p
i don't know how to compile this, but isn't there a way to compile only the file tan contains this frame limit think, and than replace the file in normal dolphin?
it would be possible for the same rev of dolphin, but as this changes 20 times a day, it would not make sense to do that.
i'll upload a compiled version of newest svn + framelimit tomorrow.
edit : got it
problem was the dualcore watchdog which was only checking every 4th frame at 60fps.
this means 3 frames were still running too fast resulting in too fast gameplay.
i updated it to check every frame @ 60fps and now SSBM also works
compiled file and sourcecode in first post.