mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Disable Vsync while holding tab to disable the frame limit, and allow toggling vsync while emulation is running in OGL.
D3D9 still doesn't support changing vsync while emulation is running. Fixes issue 6111.
This commit is contained in:
@ -104,6 +104,7 @@ static bool g_requestRefreshInfo = false;
|
||||
static int g_pauseAndLockDepth = 0;
|
||||
|
||||
SCoreStartupParameter g_CoreStartupParameter;
|
||||
bool isTabPressed = false;
|
||||
|
||||
std::string GetStateFileName() { return g_stateFileName; }
|
||||
void SetStateFileName(std::string val) { g_stateFileName = val; }
|
||||
@ -603,9 +604,13 @@ void VideoThrottle()
|
||||
u32 TargetVPS = (SConfig::GetInstance().m_Framelimit > 2) ?
|
||||
(SConfig::GetInstance().m_Framelimit - 1) * 5 : VideoInterface::TargetRefreshRate;
|
||||
|
||||
if (Host_GetKeyState('\t'))
|
||||
isTabPressed = true;
|
||||
|
||||
// Disable the frame-limiter when the throttle (Tab) key is held down. Audio throttle: m_Framelimit = 2
|
||||
if (SConfig::GetInstance().m_Framelimit && SConfig::GetInstance().m_Framelimit != 2 && !Host_GetKeyState('\t'))
|
||||
{
|
||||
isTabPressed = false;
|
||||
u32 frametime = ((SConfig::GetInstance().b_UseFPS)? Common::AtomicLoad(DrawnFrame) : DrawnVideo) * 1000 / TargetVPS;
|
||||
|
||||
u32 timeDifference = (u32)Timer.GetTimeDifference();
|
||||
|
@ -38,6 +38,8 @@ namespace Core
|
||||
// TODO: kill, use SConfig instead
|
||||
extern SCoreStartupParameter g_CoreStartupParameter;
|
||||
|
||||
extern bool isTabPressed;
|
||||
|
||||
void Callback_VideoCopiedToXFB(bool video_update);
|
||||
|
||||
enum EState
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "VideoConfig.h"
|
||||
#include "VideoCommon.h"
|
||||
#include "FileUtil.h"
|
||||
#include "Core.h"
|
||||
|
||||
VideoConfig g_Config;
|
||||
VideoConfig g_ActiveConfig;
|
||||
@ -292,3 +293,8 @@ void VideoConfig::GameIniSave(const char* default_ini, const char* game_ini)
|
||||
|
||||
iniFile.Save(game_ini);
|
||||
}
|
||||
|
||||
bool VideoConfig::IsVSync()
|
||||
{
|
||||
return Core::isTabPressed ? false : bVSync;
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ struct VideoConfig
|
||||
void Save(const char *ini_file);
|
||||
void GameIniSave(const char* default_ini, const char* game_ini);
|
||||
void UpdateProjectionHack();
|
||||
bool IsVSync();
|
||||
|
||||
// General
|
||||
bool bVSync;
|
||||
|
Reference in New Issue
Block a user