This should fix the framelimiter, looks a bit inaccurate though (was it like that already ?)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3929 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
sl1nk3.s 2009-08-02 17:04:21 +00:00
parent a56a07056d
commit a9cf2e09d0
1 changed files with 18 additions and 16 deletions

View File

@ -602,17 +602,18 @@ void Callback_VideoCopiedToXFB(bool video_update)
static Common::Timer Timer;
static u32 frames = 0;
static u32 videoupd = 0;
static u64 old_frametime=0;
if (video_update)
videoupd++;
else
{
frames++;
// Custom frame limiter
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
u32 targetfps = (SConfig::GetInstance().m_Framelimit)*5;
static u64 old_frametime=0;
u64 new_frametime;
s16 wait_frametime;
@ -626,6 +627,7 @@ void Callback_VideoCopiedToXFB(bool video_update)
if (wait_frametime > 0)
Common::SleepCurrentThread(wait_frametime*2);
}
}
if (Timer.GetTimeDifference() >= 1000)
{