mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
Update title/status bar when pausing emulation.
This commit is contained in:
parent
6f7f02aeaf
commit
e74dc0b41f
@ -625,6 +625,56 @@ void VideoThrottle()
|
|||||||
u32 ElapseTime = (u32)Timer.GetTimeDifference();
|
u32 ElapseTime = (u32)Timer.GetTimeDifference();
|
||||||
if ((ElapseTime >= 1000 && DrawnVideo > 0) || g_requestRefreshInfo)
|
if ((ElapseTime >= 1000 && DrawnVideo > 0) || g_requestRefreshInfo)
|
||||||
{
|
{
|
||||||
|
UpdateTitle();
|
||||||
|
|
||||||
|
// Reset counter
|
||||||
|
Timer.Update();
|
||||||
|
Common::AtomicStore(DrawnFrame, 0);
|
||||||
|
DrawnVideo = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawnVideo++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Executed from GPU thread
|
||||||
|
// reports if a frame should be skipped or not
|
||||||
|
// depending on the framelimit set
|
||||||
|
bool ShouldSkipFrame(int skipped)
|
||||||
|
{
|
||||||
|
const u32 TargetFPS = (SConfig::GetInstance().m_Framelimit > 1)
|
||||||
|
? SConfig::GetInstance().m_Framelimit * 5
|
||||||
|
: VideoInterface::TargetRefreshRate;
|
||||||
|
const u32 frames = Common::AtomicLoad(DrawnFrame);
|
||||||
|
const bool fps_slow = !(Timer.GetTimeDifference() < (frames + skipped) * 1000 / TargetFPS);
|
||||||
|
|
||||||
|
return fps_slow;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Callbacks for backends / engine ---
|
||||||
|
|
||||||
|
// Should be called from GPU thread when a frame is drawn
|
||||||
|
void Callback_VideoCopiedToXFB(bool video_update)
|
||||||
|
{
|
||||||
|
if(video_update)
|
||||||
|
Common::AtomicIncrement(DrawnFrame);
|
||||||
|
Movie::FrameUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Callback_ISOName: Let the DSP emulator get the game name
|
||||||
|
//
|
||||||
|
const char *Callback_ISOName()
|
||||||
|
{
|
||||||
|
SCoreStartupParameter& params =
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
if (params.m_strName.length() > 0)
|
||||||
|
return params.m_strName.c_str();
|
||||||
|
else
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateTitle()
|
||||||
|
{
|
||||||
|
u32 ElapseTime = (u32)Timer.GetTimeDifference();
|
||||||
g_requestRefreshInfo = false;
|
g_requestRefreshInfo = false;
|
||||||
SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
|
||||||
@ -695,51 +745,6 @@ void VideoThrottle()
|
|||||||
Host_UpdateTitle(scm_rev_str);
|
Host_UpdateTitle(scm_rev_str);
|
||||||
} else
|
} else
|
||||||
Host_UpdateTitle(TMessage.c_str());
|
Host_UpdateTitle(TMessage.c_str());
|
||||||
|
|
||||||
|
|
||||||
// Reset counter
|
|
||||||
Timer.Update();
|
|
||||||
Common::AtomicStore(DrawnFrame, 0);
|
|
||||||
DrawnVideo = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawnVideo++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Executed from GPU thread
|
|
||||||
// reports if a frame should be skipped or not
|
|
||||||
// depending on the framelimit set
|
|
||||||
bool ShouldSkipFrame(int skipped)
|
|
||||||
{
|
|
||||||
const u32 TargetFPS = (SConfig::GetInstance().m_Framelimit > 1)
|
|
||||||
? SConfig::GetInstance().m_Framelimit * 5
|
|
||||||
: VideoInterface::TargetRefreshRate;
|
|
||||||
const u32 frames = Common::AtomicLoad(DrawnFrame);
|
|
||||||
const bool fps_slow = !(Timer.GetTimeDifference() < (frames + skipped) * 1000 / TargetFPS);
|
|
||||||
|
|
||||||
return fps_slow;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Callbacks for backends / engine ---
|
|
||||||
|
|
||||||
// Should be called from GPU thread when a frame is drawn
|
|
||||||
void Callback_VideoCopiedToXFB(bool video_update)
|
|
||||||
{
|
|
||||||
if(video_update)
|
|
||||||
Common::AtomicIncrement(DrawnFrame);
|
|
||||||
Movie::FrameUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Callback_ISOName: Let the DSP emulator get the game name
|
|
||||||
//
|
|
||||||
const char *Callback_ISOName()
|
|
||||||
{
|
|
||||||
SCoreStartupParameter& params =
|
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter;
|
|
||||||
if (params.m_strName.length() > 0)
|
|
||||||
return params.m_strName.c_str();
|
|
||||||
else
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Core
|
} // Core
|
||||||
|
@ -89,6 +89,8 @@ bool ShouldSkipFrame(int skipped);
|
|||||||
void VideoThrottle();
|
void VideoThrottle();
|
||||||
void RequestRefreshInfo();
|
void RequestRefreshInfo();
|
||||||
|
|
||||||
|
void UpdateTitle();
|
||||||
|
|
||||||
// waits until all systems are paused and fully idle, and acquires a lock on that state.
|
// waits until all systems are paused and fully idle, and acquires a lock on that state.
|
||||||
// or, if doLock is false, releases a lock on that state and optionally unpauses.
|
// or, if doLock is false, releases a lock on that state and optionally unpauses.
|
||||||
// calls must be balanced (once with doLock true, then once with doLock false) but may be recursive.
|
// calls must be balanced (once with doLock true, then once with doLock false) but may be recursive.
|
||||||
|
@ -951,6 +951,7 @@ void CFrame::DoPause()
|
|||||||
Core::SetState(Core::CORE_PAUSE);
|
Core::SetState(Core::CORE_PAUSE);
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||||
m_RenderParent->SetCursor(wxNullCursor);
|
m_RenderParent->SetCursor(wxNullCursor);
|
||||||
|
Core::UpdateTitle();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user