From d6cf857a0613af032f1597ce9898623a431383e9 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 9 Feb 2015 23:10:57 +0100 Subject: [PATCH] Make it impossible to set Auto Frameskip and Non-buffered together as they interact in a bad way --- Core/Config.cpp | 5 +++++ Core/HLE/sceDisplay.cpp | 2 ++ UI/GameSettingsScreen.cpp | 7 +++++++ Windows/WndMainWindow.cpp | 3 +++ 4 files changed, 17 insertions(+) diff --git a/Core/Config.cpp b/Core/Config.cpp index afb1dce059..cc410dc67f 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -35,6 +35,7 @@ #include "Common/StringUtils.h" #include "Core/Config.h" #include "Core/Loaders.h" +#include "GPU/Common/FramebufferCommon.h" #include "HLE/sceUtility.h" #ifndef USING_QT_UI @@ -868,6 +869,10 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { // Fix Wrong MAC address by old version by "Change MAC address" if (sMACAddress.length() != 17) sMACAddress = CreateRandMAC(); + + if (g_Config.bAutoFrameSkip && g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) { + g_Config.iRenderingMode = FB_BUFFERED_MODE; + } } void Config::Save() { diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 061987e7f5..6ebfedef8d 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -51,6 +51,7 @@ #include "GPU/GPUState.h" #include "GPU/GPUInterface.h" +#include "GPU/Common/FramebufferCommon.h" struct FrameBufferState { u32 topaddr; @@ -527,6 +528,7 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) { curFrameTime = time_now_d(); // Auto-frameskip automatically if speed limit is set differently than the default. + bool useAutoFrameskip = g_Config.bAutoFrameSkip && g_Config.iRenderingMode != FB_NON_BUFFERED_MODE; if (g_Config.bAutoFrameSkip || (g_Config.iFrameSkip == 0 && fpsLimiter == FPS_LIMIT_CUSTOM && g_Config.iFpsLimit > 60)) { // autoframeskip // Argh, we are falling behind! Let's skip a frame and see if we catch up. diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 13d0a4b89c..93f96afba2 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -565,6 +565,9 @@ UI::EventReturn GameSettingsScreen::OnAutoFrameskip(UI::EventParams &e) { if (g_Config.bAutoFrameSkip && g_Config.iFrameSkip == 0) { g_Config.iFrameSkip = 1; } + if (g_Config.bAutoFrameSkip && g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) { + g_Config.iRenderingMode = FB_BUFFERED_MODE; + } return UI::EVENT_DONE; } @@ -619,6 +622,10 @@ UI::EventReturn GameSettingsScreen::OnRenderingMode(UI::EventParams &e) { postProcEnable_ = !g_Config.bSoftwareRendering && (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE); resolutionEnable_ = !g_Config.bSoftwareRendering && (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE); + + if (g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) { + g_Config.bAutoFrameSkip = false; + } return UI::EVENT_DONE; } diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index bfccea360a..62985e12ad 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -727,6 +727,7 @@ namespace MainWindow switch(g_Config.iRenderingMode) { case FB_NON_BUFFERED_MODE: osm.Show(g->T("Non-Buffered Rendering")); + g_Config.bAutoFrameSkip = false; break; case FB_BUFFERED_MODE: @@ -1343,6 +1344,8 @@ namespace MainWindow case ID_OPTIONS_FRAMESKIP_AUTO: g_Config.bAutoFrameSkip = !g_Config.bAutoFrameSkip; + if (g_Config.bAutoFrameSkip && g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) + g_Config.iRenderingMode = FB_BUFFERED_MODE; break; case ID_TEXTURESCALING_AUTO: setTexScalingMultiplier(TEXSCALING_AUTO); break;